Building a Development Environment with VMware
Today, I decided to try and start back up with Palm webOS development (which I’m further putting off by writing this post) but before I could do that, I needed to set up my development environment. This time, rather than install it in my host operating system, which can change fairly often, I decided to create a dedicated virtual machine to do all of my webOS development in. There are a couple of advantages of this. First, my development environment remains stable and constant even when my host operating system changes or is upgrades. Secondly, I can have a 32 bit development environment when the rest of my desktop is 64 bit. This is helpful, because Palm currently only provides an i386 *.deb for the Mojo SDK, and while you can get it to work on a 64 bit system, I can avoid having to do these workarounds. Finally, it’s easy to pick up my entire development environment and take it with me from computer to computer, without having to worry about redownloading and libraries or tools on the new machine.
Since I’m using Ubuntu 9.04 x86_64 edition, most of this guide is tailored to Linux hosts, but should work fairly well on Windows or Mac hosts as well.
1. Install a Virtualization Platform
The first step was to set up my virtualization software. If you don’t already have something installed to do this, take a look at VMware Player 3.0, which is currently in the RC stages. You can get it here. Player 3 is improved over the previous versions in that it is now a fully fledged desktop virtualization product. In the past, it was only able to run virtual machines others had created, but it is now capable of creating them as well.
2. Install your Guest OS
Once you have VMware set up, you need to install your guest operating system that you will do your development on. For my example, I chose to use Ubuntu 8.04.3 LTS, which is an older release, but is an LTS release and also the version that Palm has targeted its SDK at. After downloading the image from http://releases.ubuntu.com/hardy/ setting up the virtual machine is very easy. All you have to do is create a new VM from Player’s UI, and give it the Ubuntu *.iso image when it asks for it. VMware will automatically set up the VM for you from there, including installing Ubuntu.
3. Set up your Environment
Next, just set up anything you need for the development you’ll be doing. In the case of Palm’s Mojo SDK, this means installing sun-java6-jre through apt, then installing the palm-sdk and palm-novacom packages from Palm’s webpage. You can also install an SDK if you prefer. I installed Eclipse 3.4.2, which was the version recommended by Palm. I then added the Palm and Aptana plugins.
4. Set up Remote Access
Finally, you can configure your virtual machine to be accessible remotely. The best way to do this (for a Linux guest) is via SSH. Install the package openssh-server in your virtual machine, then you can access it from your host through that. If you configure VMware to leave virtual machines running in the background you can close out of Player then run your IDE of choice over ssh by running something along these lines:
ssh -X user@vmipaddress /path/to/ide
which for my particular setup, winds up being:
ssh -X zach@172.16.156.129 /opt/eclipse/eclipse
You can save that command as either a bash alias or shell script, and make a launcher for it. Eclipse will then load up and run looking just like a native application, but it’s actually still keeping everything in the virtual machine, so you can still bundle up your entire environment easily.
There are some additional tricks you can do to futher integrate guest and host. One such thing that can come in handy is mounting your host’s hard drive in the guest via sshfs which will let you easily move files between guest and host.
Hopefully this will help you keep your development environment clean and stable, no matter how much you decide to tweak your host
Flickr
Last.fm
Twitter
Facebook