I spent a good portion of the last week tweaking out virtual machines. Part of this was that I have close to 15 different linux distros sitting on my desk and on my hard drive, and while I have a dedicated machine for testing builds now (or setting up a server as I keep promising my wife) it's far easier to set up a virtual machine than to set up a real one. For starters, you have a consistent hardware profile to worry about, which is extremely helpful when wrestling with X11 / X Server configuration. The big thing, though, is the compartmentalization that becomes possible.
My main machine these days is a Dell Inspiron 6000 running Windows XP. I tend to try out (read as install / uninstall) a lot of software, and as you might expect, the registry needs regular flossing or the performance just becomes poor. With a virtual machine set up just for testing out new software, I can stick a pristine copy of the VM in an archive and set it up, ready to go any time I need to start afresh.
Also, I can pull a lot of stuff off of Windows XP and stick it over on a Win 2k VM to keep things running optimally on the host OS. If I'm not doing development, why have all the hooks, registry entries and background tasks for my development sweet bogging down my main OS while I'm just checking mail in the morning?
Similarly for a server, or games - especially the annoying ones with copy protection! Not that I want to bypass the copy protection, but some of the craptaculous blends like Steam or Starforce that just sit there leaching your machine of resources till it goes belly up!!
So, I've done a fair amount of digging and had some help along the way and have a nice setup with very good if not excellent performance. You can read the thread that let to all of this over at Jake's site. To save you the trouble picking through it, though, here is a summary with links.
Pieces Parts
- Get VMPlayer for free
- Get a premade disk image (this same site also has a great tutorial)
- Get VMWare Tools from the VMWare website (registration requested but not required... yet)
Get an iso of your favorite OS
Get a template VM File to modify
Get 7 zip
OK, you now have all you need to begin. Before you start, create a folder for your new VM and put all the files you downloaded there. This will make it easier to organize, archive and duplicate your VMs later. Now, we need to tweak the vmx file a bit.
The Perfect Setup
- change the ide0:0 to point to the disk image file. e.g. ide0:0.fileName = "w2kdisk.vmdk"
- change the ide1:0 to point to the iso for your OS e.g. ide1:0.fileName = "windows2000pro.iso"
- Next, make sure you have the right guest OS listed in the vmx file. You can find a great list here towards the end of the page. Apparently this information once resided on the VMware website, as I found a support topic linking to it, but the page is no longer there or moved.
- Change the name of your VM. e.g. displayName = "Win 2k Tester"
- Save the file and start up your VM. If you made any mistakes, the VM will not launch. Paths for the above files are relative to where the vmx file resides.
- Install your OS on the VM as though it were a real machine. It might run a little slow for now. We'll install the VM Tools in a bit to take care of that.
- After installation, kill the VM completely (after any reboots it wants to go through) by clicking the X. Do not shut it down as it is quicker to restore state (which it will try to do later when you restart it) than reboot.
- Extract the VMware-workstation-5.5.0-18463.tar.gz with 7 zip
- In the archive, you will find a file windows.iso in the vmware-distrib\lib\isoimages folder. Use the iso appropriate to your OS for this next step.
- Extract the iso to the folder where your vmx file resides and edit the ide1:0 entry to mount this image.
- After saving the vmx again, launch it and the state will restore with the new iso mounted.
- Open the mounted CD image and run the installer or setup script / exe. This will install VM Tools to your VM and dramatically improve performance, extend the vga to svga, and give you (in Windows anyway) mouse over focussing so you don't have to click into your VM or ctrl+alt out anymore.
That's it! Now you can archive this machine in a zip, make copies of it and run it in as many different configurations as you like! If you run into trouble, first try the community forums for VMPlayer, then try google, then try here. I'm no expert yet but I got this far. :-) Ah, best bit for last: I was able to compose and post this blog from my VM, sharing the clipboard with my host OS. Very nice!