You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »


CheatSheet for setting up CloudStack Dev environment on Windows

Step 1) Install Cygwin. This will give you a unix like bash shell for your windows.

To install Cygwin, you download and run the setup.

  • The install option will download, cache, and install the packages that you have selected.
  • The selection of default packages to install is inadequate, because development and common editors are not included.
    • Under 'Develop', select git for 'Install'. Or set the whole 'Develop' category to install. This takes more time, but it is simpler.\
    • Under 'Editors', select vim or emacs depending on which you expect to be available from the Cygwin command line.
  • Unfortunately, the download can be slow depending on the mirror you select (~30 min or more).
    • Set unnecessary package categories to 'Uninstall', e.g. KDE and Games.\
  • After completing the install, you can run it again.  In that case, it will use the packages you last selected as the defaults.

NB: When you open a Cygwin shell, the Windows environment variables, including PATH, are imported into the shell environment. When we install the following items, we will update the Windows environment variables.

Step 2) Install the latest Eclipse

Eclipse is available from http://www.eclipse.org/downloads/

  • Eclipse does not have an O/S-specific installer. Thus, the .zip you download does not include an .MSI file
  • At the time of writing the latest version was Eclipse Juno (4.2)
  • Place the unzipped download in the folder you want to run Eclipse from.

Step 3) Install Apache Tomcat 6.0.33

Apache Tomcat is the open source web server and servlet container that hosts CloudStack's management server.

  • The web server portion is pure Java. In contrast, Apache web server is written in C
  • The servlet container conforms Java Servlet and the JavaServer Pages (JSP) specifications.

You can download Tomcat from http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.33/bin/apache-tomcat-6.0.33.exe

  • Unlike Eclipse, the downloaded Tomcat is a self-installing executable.
    • Leave the port at 8080 and the username/password empty
    • Your JRE will be auto detected. Mine was: C:\Program Files\Java\jre

To inform the Cygwin environment of where Tomcat is, update your Windows environment variables.

  • Define CATALINA_HOME as a Windows System environment variable, and give it the value of the install folder for Tomcat. E.g. C:\Program Files\Apache Software Foundation\Tomcat 6.0
    • Unlike JAVA, which an environment variable named after the product to locate its install directory (JAVA_HOME), Tomcat uses an environment variable named after the servlet container component (CATALINA_HOME)
  • Add '%CATALINA_HOME%\bin' to the Windows System environment variable PATH

NB: Test your environment variables by opening a Cygwin shell and typing 'which Tomcat6'. This should return the path to the Tomcat executable.

Step 4) Install the JDK.

You can download the latest JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html.
*Pick the self-installing executable corresponding to your O/S type (32 or 64bits)
*Note where you're installing it. Set the Windows System variable JAVA_HOME to this path.
**I removed the user 'JAVA_HOME' variable to prevent the System variable from being overriden.

Step 5) Install mysql for windows.

Download the self-installing exe from http://dev.mysql.com/downloads/mysql/5.0.html#downloads
*The most recent 5.1.x is recommended; however, developers are also using 5.5
*Check the box that asks whether you want to include mysql bin directory in the PATH. The option is a checkbox towards the end of the config wizard.

Step 6) Install Ant for Windows.

Ant is available from http://ant.apache.org/bindownload.cgi

  • Ant does not have an O/S-specific installer. Thus, the .zip you download does not include an .MSI file
  • Place the unzipped download in the folder you want to run Ant from.

To inform the Cygwin environment of where Ant is, update your Windows environment variables.

  • Define ANT_HOME as a Windows System environment variable, and give it the value of the install folder for Tomcat. E.g. C:\Program Files\Apache Software Foundation\apache-ant-1.8.4
  • Add '%ANT_HOME%\bin' to the Windows System environment variable PATH

NB: Test your environment variables by opening a Cygwin shell and typing 'which ant'. This should return the path to the ant executable.

Step 7) Download cloudstack-oss source

From a Cygwin window:
*Create a cloudstack-oss directory, cd into it
*Use git clone to download the a cone of the git repo from
**E.g. git clone ssh://<username>@git.cloud.com/var/lib/git/cloudstack-oss

Step 6) Edit the file cloudstack-oss/build/override/build-cloud.properties to include a tomcat_home variable:

              -> tomcat_home=C:\Tomcat 6.0

Step 7) Install "mkisofs" in windows if for any reason cygwin’s mkisofs isn’t picked up.

              -> http://svnpenn.blogspot.com/2011/06/mkisofs-for-windows_24.html

Copy over the above exe some place in C:\, and set the PATH env variable for Windows 7 to point to this directory.

Step 11) You will need to set a parameter DBROOTPW= in the build/override/replace.properties file. Here is how my file looks –

vijayendra1@sjcwvijayendra1 /cygdrive/c/Users/vijayendra1.CITRITE/My Documents/cloudstack/cloudstack-oss
$ cat build/override/replace.properties
DBUSER=cloud
DBPW=cloud
DBROOTPW=
MSLOG=vmops.log
APISERVERLOG=api.log
DBHOST=localhost
AGENTLOGDIR=logs
AGENTLOG=logs/agent.log
MSMNTDIR=/mnt
COMPONENTS-SPEC=components-premium.xml

vijayendra1@sjcwvijayendra1

Step 12) Issue the following command to build the mgmt server and start it up:

            ant clean-all build-all deploy-server deploydb

            ant debug

Step 13) Open the mgmt server console using http://localhost:8080 and configure it as required.

Step 14) When you make changes to the code, and want to restart the mgmt. server, you should not recreate the mysql database, because that would wipe out the setup. So you make your code changes, and then do –

            ant clean-all build-all deploy-server

            and debug



  • No labels