After converting my MacBook Pro in to a Windows developer dream, I wanted to have the same experience on a more portable, commodity hardware unit. Virtualizing Windows within Windows with VMware Server is something I’m familiar with. It’s something many Windows developers may prefer (and I recommend if you’re not comfy with linux as your host OS).
Quick background: Virtualizing a development/qa environment allows one to have an easily cleaned control environment. When a machine gets dirty (too many installs, tests, builds, or other garbage collects), you can simply delete the virtual instance and copy a fresh installation back over. This saves a ton of time. In dev, this allows a safe, clean, environment to test builds in. In a QA environment, this allows a very fast way to return to a known state.
My goal in a virtualized dev/qa environment is to run a host which consumes an absolute minimum amount of resources. I run virtualization software that allows more than one running VM at a time, such as VMware Workstation (PC), VMware Fusion (Mac), or VMware Server (PC or Linux). If you’re running Windows as your host OS, I recommend Windows 2000 Advanced Server because it is tunable to consume less resources than any other flavor of Windows (including Windows 2000 Professional).
Given that Linux runs on wrist-watch sized systems, it’s a safe assumption that one will get better performance from virtual machines than on a virtualized Windows environment. I chose Ubuntu since it’s super simple to install, is fairly reliable, offers similar features to Windows, and is still a smaller footprint my Win2kAS machines.
I started with version 8.04 desktop (hardy). The installation was a piece of cake, but there are no tuning options in the basic .iso. I installed VMware Server, but just while running the OS I could tell I would run in to performance issues later. The desktop flavor of Ubuntu isn’t light enough to pass all the processing power through to the VMs.
1. Install Ubuntu Server 8.04 – For those of you doing this for the first time and are coming from a Windows environment, you should use the following disk setup (assuming you have a single hard drive):
- 20 GB EXT3 partition, set as boot (“/”).
- 2 GB SWAP.
- remaining space, set up for home (“/home”).
2. Install Xubuntu with apt-get – Ubuntu Server doesn’t have a UI. Ubuntu Desktop is too heavy. Xfce is an outstanding light GUI desktop alternative. To get this installed:
- Boot up your now Ubuntu Server machine.
- You will land at the command prompt, type “sudo apt-get install xubuntu-desktop” (without the quotes).
- Enter your password to grant privledges to download/install the Xfce GUI. It will take a while to download as the Xubuntu install is about 300 MB.
- Reboot when ready, you’ll boot in to Xubuntu.
- At the login prompt, choose to change the type of GUI you’re logging in to. Select Xfce.
3. Install VMware Server (as of this writing, server 2.0 is in beta and not recommended for a performance environment – stick to 1.0.x) – This was a total pain in the butt my first time around. I hope my instructions here allow you a fairly pain-free installation. Additional resources here, here, and here.
- Open Firefox, available as a shortcut at the top of the screen.
- Download VMware Server here: http://vmware.com/products/server/
- It is now on your desktop, go to the Applications button at the top left and choose Accessories -> Terminal to open a terminal.
- Type “cd Desktop” to move to your desktop.
- Unpack the archive. Type “tar -xvf vmware[TAB]” (hit the tab key to complete the filename).
- Move in to your VMware folder. Type “cd vmware[TAB]”.
- Visit the ‘here, here, and here’ links above for all the resources you’ll need to get past the now-known errors you’ll run in to.
4. Copy VM instances from other systems – I use VMware Fusion on my Mac and VMware Workstation on a PC (haven’t used Workstation in a while). You can create instances in either of these products and then just copy them over to your Ubuntu system. Tips:
- Keep the fresh install VM instances as they are and make copies. You can now just drop in a copy of the fresh install so you don’t have to ever re-install the OS again.
- Install your dev and/or qa environment. Make a snapshot NOW. You can now revert to this snapshot immediately, whenever you want. Fresh, known, starting point: viola!
5. Tweak your VMware instance settings:
- Leave your host OS enough RAM to be comfortable. Give each VM as much as it needs.
- Disable 3D acceleration unless you absolutely need it in the VM for testing 3D. This is a resource hog.
- If your PC is multi-core, only give the VM 1 CPU (unless you need to test multi-core software).
6. Dev and QA to your heart’s content – You’re now free to revert, take snapshots, and otherwise manipulate your OS without the fear and wasted time of reinstallation. Enjoy!