Note: kindly consider a more modern appliance based CloudStack development with MonkeyBox.

If you're looking for a pre-configured CloudStack environment please refer to DevCloud.

This is a do-it-yourself guide to help you hack your own custom CloudStack development environment. JFYI, reverse-engineer DevCloud: /root/.bash_history and /home/devcloud/

Table of Contents

Getting started

New to CloudStack? Checkout the n00b developer's guide: Contributing as a non-committer

Terms used throughout the guide:

  • host or host-os, means your operating system running on top of your laptop/desktop.
  • hypervisor or hypervisor-vm or xen/server or xenserver-vm means a XenServer running inside a VM on VirtualBox.
  • guest-os or guest-vm means the virtual machine running on a xenserver-vm.

CAUTION: This kind of setup is unstable, in my case my system with 8GB RAM would crash a lot (make sure you allocate 500MB to dom0). This guide just shares a proof-of-concept setup, not necessarily the best.

For simplicity, in this guide we'll use the same kind of networking, IP ranges and filesystem paths as in DevCloud and create a non-monolithic setup:

  1. Two XenServer VMs (Both run as separate VMs on VirtualBox).
  2. One Ubuntu/Linux server to provide DNS and NFS for secondary storage (This may be on one the hypervisor's dom0).
  3. CloudStack development environment, the management server and the MySQL server runs on your host-os.
  4. When creating any VM, XenServer or Ubuntu/Linux, use these credentials;
    user: root
    password: password



XenServer 6.0.2: (if link fails, google for Citrix XenServer and download the free XenServer)

Ubuntu Server: (any, x86 or x86_64)

Get dependencies: Git, Java, Ant, Tomcat (use 6.0.33, problems with latest version), MySQL, mkisofs

Setting up CloudStack Development Environment

Setting up a CloudStack development environment on Mac OSX

Setting up Cloudstack dev environment on Windows

Setting up on Linux: Refer to INSTALL.txt in the root directory of the source code

Install MySQL with root user's password blanked out as used as default by CloudStack. In case you gave a password during installation:

DIY Setup


Configure a host-only network, a host-only network is a private network between your VMs and the host-os only:

  1. Goto VirtualBox/File->Preferences->Network->Add host-only network (check if there exists one, check the IP ranges below else add a new one)
  2. 2. Select the add host-only network, Edit host-only network with following IP ranges with DHCP disabled (untick Enable DHCP):
    IPv4 Address: (address of your gateway)
    IPv4 Network Mask:
  3. Leave other fields as it is and click OK, exit preferences.

Note: While configuring any host-only adapter adapter for a VM select its promiscuous mode to 'allow all'.

We'll use these IPs for our setup:





Ubuntu Linux as DNS/NFS

Create a VM in VirtualBox using the Ubuntu server ISO with about 500MB RAM or more, and disk 10+ GB.

In Network, enable two adapters: (select the first one for your primary network)

For the first one: select NAT.

For the second one: select host-only adapter, select vboxnet0 or appropriate adapter. Make sure to select the adapter's promiscuous mode to: Allow all..

The VirtualBox NAT has following defaults:

Gateway: | DNS: | DHCP:

Install Ubuntu Server (or any Linux distro) and install NFS and DNS server (DNS is optional):

sudo apt-get install bind9 nfs-kernel-server


To configure bind as a forwarding DNS, simply edit /etc/bind/named.conf.options: Enable forwarders to use

/etc/init.d/bind9 restart


Configure directory structure and NFS exports, setup a SSVM template:

        mkdir -p /opt/storage/secondary

        mkdir -p /opt/storage/secondary/template/tmpl/1/1

        mkdir -p /opt/storage/secondary/template/tmpl/1/5

        echo "/opt/storage/secondary *(rw,no_subtree_check,no_root_squash,fsid=0)" > /etc/exports


        wget $fileSvr/defaulttemplates/1/dc68eb4c-228c-4a78-84fa-b80ae178fbfd.vhd  -P /opt/storage/secondary/template/tmpl/1/1/

        wget $fileSvr/defaulttemplates/1/  -P /opt/storage/secondary/template/tmpl/1/1/

        /etc/init.d/nfs-kernel-server restart

Optional: get a sample centos/vm template (~50MB) for testing on your host-os:


A SSVM template is required in the secondary storage (chicken-egg problem), as CloudStack runs the SSVM from NFS and then SSVM then mounts the NFS as secondary storage, make sure the 'host' in global settings is correctly set to your management server IP and at port 8250 it is reachable.


We wish to use NAT as our default interface.

Setup static IP for eth1: (check/edit /etc/network/interfaces)

auto eth1
iface eth1 inet static

Check routes: route -n (if is not the default gateway, fix that)



Create two VMs (or create one VM, export it and import it as many time as number of XenServer VMs you want, depending on your system capability). Give it at least 2GB RAM, 10GB disk. Add one host-only adapter, select appropriate adapter (vboxnet0) and set promiscuous mode to 'Allow all'. Attach the XenServer ISO image and boot. During setup, skip check disk, skip supplementary packs, select manual time. For user root, use password: password. Static IP, (for 1st vm, (for 2nd vm,, netmask, gateway and dns

For safety: after the XenServer boots up, login to dom0 of each XenServers and allocate some memory:

ssh root@
xe host-list | grep uuid
xe vm-param-set memory-dynamic-max=500MiB uuid=<put here your dom0's uuid>




Read the README and INSTALL.txt. Grab the source code:
git clone pull -v # Have your master updated

To build, deploy-server and database:
$ ant clean-all build-all deploy-server deploydb

Type to run mgt server:
$ ant debug

Basic Zone Configuration

Open (localhost is vboxnet0 gateway) with user: admin, password: password

Select the option that you know CloudStack. Now, goto Global Settings and make sure to configure these settings: true true

Restart the management server, ant debug.

Now open the mgmt server, goto Infrastructure-> Zone(View All)>Add Zone>Basic->


Name: MyZone


Internal DNS1:

Hypervisor: XenServer


Pod Name: MyPod

Reserved system gateway:

Reserved system netmask:

Start reserved system IP:

End reserved system IP:


Guest Gateway:

Guest Netmask:

Guest start IP:

Guest end IP:


Cluster Name: MyCluster



username: root

password: password


Secondary Storage (Primary storage form will be skipped, if it shows up check your Global Settings with fields mentioned in above section):

NFS Server:

Path: /opt/storage/secondary


Launch Zone!

Wait till your SSVM/CPVM get started, watchout for errors on your terminal. Next add host, This setup would require a lot of RAM, your system may crash a lot.

If everything goes well, you've your own devcloud setup! Now try to add that template, try migration etc.

  • No labels