I decided to take the plunge. Go 100% VM for my development. The process converting was a bit icky (because I am new to VM, I'm sure), but now that I am converted, I wish I had done this a long, long, time ago. That being said, I don't proclaim to be an expert, but wanted to document my journey (several coworkers and compatriots have been asking for details).
I played with VM Server 1.x and 2.x Beta, and wasn't convinced at that time to make the move. Several folks in the Twitter Tribe recommended VMWare Work Station, but I wasn't willing to fork over the cash for an experiment.
Several factors came together to essentially force me down the virtualization path - VMWare Server 2.0 now includes a remote console (I couldn't stand the web based interface in the beta), and my main dev machine (DELL XPS 1710, Duo Core, 3GB RAM) was in desperate need of a repave.
VM Creation (aka learning on the fly)
I created my VMs in stages - started by creating a Vista VM that could then serve as a base for my other VMs. First lesson learned:
- Don't create your disks as pre-allocated. If you set up a 32GB disk, it will be 32GB.
Setting your disks to be "growable" causes the process of creation to slow down somewhat, but if you have the patience during the installation of your software, it will pay off. Some would say disk space is cheap, and I agree (to an extent), but I need to be mobile. I can't really haul around my 500GB drives everywhere I go. I live and breath with USB powered drives. Of course, I HIGHLY recommend using a 7200 RPM drive for creating and configuring your VMs.
I realized I needed to convert my disk to growable. Process is fairly painless once you cozy up to vmware-vdiskmanager.exe. Make sure you detach the disk from your VM first, then execute this command from a command window:
vmware-vdiskmanager.exe -r sourceDisk.vmdk -t 0 destinationDisk.vmdk
where -r is "convert" and -t is disk type. 0 sets it to a growable disk. You have to either rename the disk or move it to another location when you convert.
For reference, the other disk types are:
||single growable virtual disk
||growable virtual disk split in 2GB files
||pre-allocated virtual disk
||pre-allocated virtual disk split in 2GB files
||pre-allocated ESX-type virtual disk
||compressed disk optimized for streaming
After creating my OS base VM, I copied all of the files in my VM directory to another location so I could add Visual Studio and all of my dev tools (for more on what I use see this post) and still have a base VM for copying so I can play with bleeding edge stuff (like VS2010).
I then renamed my virtual disk and all of the related files. The Disk Manager exe provides a mechanism for renaming disks:
vmware-vdiskmanager.exe -n sourceName.vmdk destinationName.vmdk
But not the rest of your VM files. For that, get a good text editor and follow the following sequence:
||rename file to destinationName.vmxf
||replace sourceName.vmx with destinationName.vmx in the <vmxPathName> element
||rename file to destinationName.vmx
||replace all occurrences of sourceName with destinationName
||rename file to destinationName.vmsd
||rename file to destinationName.nvram
For my needs, I kept all of the OS and program installs on the first disk. I then created a second disk for my databases, program code, and other data. The advantage here is I have less to back up.
When I was done setting everything up, I exercised the command to defragment, prepare for shrink, then shrink my disks:
vmware-vdiskmanager.exe -d myDisk.vmdk
rem Prepare drive prior to shrinking
vmware-vdiskmanager.exe -p myDisk.vmdk
vmware-vdiskmanager.exe -k myDisk.vmdk
Turned out to not benefit me much, and took forever to run. But there are the commands if you decide to try it.
||create disk. Additional creation options must be specified.
||expand the disk to the specified capacity (must also use -x)
||check a sparse virtual disk for consistency and attempt to repair any errors.
Additional options for Create (-c) and Convert (-r):
||(for use with -c only) adapter type (ide, buslogic or lsilogic)
||capacity of the virtual disk (specified in sectors, KB, MB or GB)
The acceptable ranges:
ide adapter : [1MB, 950.0GB]
scsi adapter: [1MB, 950.0GB]
OS issues (and how I worked around them)
Keep in mind these are my experiences over the past week. I am open to input as to how my environment could be made better, but I am extremely pleased with the performance that I am getting currently.
I am using 32bit vista for my host, and my VMs are also 32bit Vista. (Why? Because.) There are a couple of things that I ran into.
- Set up your VM as a single processor box. It just works better.
- I have 3GB on my host. Evidently, it doesn't matter. All of my VMs run best when set to 1024MB of memory.
- ReadyBoost. Don't use it. I found that it significantly slowed everything down when I had my thumb drive in and being used for ReadyBoost.
- Set up two nics. Make the first Bridged, the second HostOnly. Bridged gets you out to the intertubes. HostOnly gets you to the host.
- Set the HostOnly network to private so sharing will be enabled. For some reason that I haven't pinpointed, every time I reboot my VMs I have to reset the HostOnly network to private.
- Bridge the networks (on the VM) together if you want to VPN out of a Vista VM. (No, I don't know why, I'm not a network expert. I just figured out that was what I needed to get it to work)
- Manually add an audio device. You will have run windows update to get the drivers installed for your audio device in Vista. This is from the VM Documentation, and they weren't lying. It's an easy fix.
One of my other hesitations was putting all of my program files in a VM. It just makes me nervous. I can dissect a drive if everything goes south, but not sure how to do that with a VM. My solution (for everything that isn't in source control) is to use SynchBack SE to synch my files between my host and my VM. I decided to make it a manual process because I don't have that much that is NOT in subversion.
Well, there it is. My path to virtualization. All that is running on my host is Office, VMWare Server, Skype, and other such utility programs. So far, the performance has been extraordinarily good.