One day my machine died L. It had been playing up for a little while and one day it just decided it wouldn't boot, the culprit seemed to be a dodgy hard disk.
At my company we use VMware Workstation to run test stacks on our local machines which we can develop against in isolation. Due to most of our development being targeted toward 32bit windows under Visual Studio 2008 we tend to use Vista 32 bit as our main OS. Our machines are fairly beefy with 4 GB of ram, however, we cannot fully utilise the 4 GB using 32bit Vista and whilst running VMs I'd ideally like 8 GB or more.
As I sat considering my imminent rebuild it occurred to me that I could install a 64bit OS and run my 32 bit development environment within a VM.
There seems to be several advantages to running my development environment within a VM.
I could play around with new development tools, plug-ins, etc. software within a familiar environment without risk as I could easily rollback to a previous snapshot.
Even if the worst happened and my VM got corrupted somehow I could be up and running quickly from backup (I realize this could be achieved with software such as Ghost or dd).
- I could place more memory in my machine (8 GB max in my current box) and take advantage of it whilst continuing to developer and test in 32bit environments.
My initial thinking was, if I could install a relatively lightweight host OS I should be able run more VMs. So it begins....
Configuration 1 – Kubuntu 8.04 64bit Host
First thing to state is that my personal preference when using Linux is to use the KDE desktop environment. It just seems feels slightly less patronising, allowing me to get the day to day tasks done quickly and easily without hiding away features I perhaps ought not to be trusted with J
The first host configuration I tried was Kubuntu 8.04 64bit. Kubuntu seemed to have performance issues running VMware 6.04 and also felt a little like the KDE had been slapped on as an afterthought, which may not be far from the truth as the main distribution "Ubuntu" is Gnome based.
I later found that the performance issues with VMware were related to a general Linux kernel/VMware version issues and were not specific to Kubuntu.
Configuration 2 – OpenSuse 11 Host
I then decided to try a KDE based distribution, and opted for OpenSuse 11 64bit. Installation went well; the whole thing was installed in about 20minutes including all recommended updates and the native NVIDIA drivers. One thing I particularly liked about OpenSuse was that it included the NVIDIA settings tool by default with the driver which made configuring multi-monitor a doddle (something that would be quite difficult for a novice in Kubuntu as the forums would have you doing all sorts of things to you xorg.conf file).
I then installed VMware, and experience similar, although not quite as bad issues with performance as before.
After trawling a few forums posts I got the impression there was a general issue with at least versions 6.03 and 6.04 of VMware with my kernel. The suggested option was to try VMware 6.5 beta, which I wanted to play with anyway due to the support for DirectX 9.0c and new integrated desktop features dubbed "Unity".
VMware 6.5 beta went on to my system without any problems, it was time to start running some VMs. And that's where the problems began...
When running more than one virtual machine my machine became almost completely unusable, the mouse would stop responding for a few seconds at a time and CPU utilisation was almost permanently at 100%. After running "top" I discovered that a large proportion of the CPU was being consumed waiting for IO to complete. So (sigh), back to the forums..., turns out that by default VMware performs background memory paging, which on my machine was murdering IO. Performance was significantly improved by adding the following lines to my .vmx file:
mainMem.useNamedFile = "FALSE"
sched.mem.pshare.enable = "FALSE"
MemTrimRate = "0"
Ok, I was now able to mount 3 guest VMs, a Vista Desktop, a 2003 Server with a complete TFS test stack, and another XP desktop just for good measure. Performance was great, I was really cooking on gas... that was, until I decided to switch back to my host and do some web browsing. I launched Firefox and started to type in the address bar, Firefox closed abruptly without any warnings or messages, I tried again, same thing, and then again, need I continue? It was at this point that I noticed that I couldn't type any upper case characters, my shift and caps lock keys were not working! At this point my head hit the desk L
After removing the ice pack, I gritted my teeth in grim determination for my imminent return to the forums.
It seems the crashes are related to two bugs, one being VMware workstation clearing the keyboard modifier map, the other being the GTK crashing when it encounters and empty modifier list (This has reportedly now been fixed). The VMware issue seems to have been around for some time, I have tracked it back to at least version 5 in the forums, so it doesn't appear that this is going to get fixed any time soon (VMware?).
To prevent VMware from clearing the keyboard modifier map you should switch back to your host using the mouse rather than the keyboard (Ctrl + Alt by default). If on returning to your host you find you caps lock indicator is not working you can re-initialise you keyboard by running the following command:
setxkbmap
I continued to try and work this way for a while, mainly out of sheer stubbornness and reluctance to admit things weren't working out as well as I had planned. I also didn't want to spend any more time in the forums or installing software, I'm a developer with a job to do (write code); I lost interest in hacking around installing software back in my Amiga days (pauses to reminisce).
Finally I gave up, I really couldn't live with the keyboard issue and I certainly wasn't going to run a scheduled task to reset my keyboard modifiers every n seconds as some had suggested (argh!!!).
I decided to try Vista 64bit.
Configuration 3 – Vista Enterprise 64bit
I almost wish I had more to say here. The installation of Vista Enterprise 64bit and VMware 6.5 beta went without issue. I fired up my VMs and have been running them successfully for about a week.
I should point out at this stage that the changes I made to .vmx files to prevent paging were kept and I haven't gotten around to proving whether the performance issues I encountered without them would show up under Vista.
Vista does by default consume a lot more memory than any of the Linux distributions I tried, although I'm sure I could get this down a bit with some tweaking of services, etc.
Conclusion
I really wanted this to work easily under Linux, "easily" being the key word here. I've no doubt that with time I could have resolved all the issues I encountered, however, there is a finite amount of time you can spend on these things, after all, time is money. I was also getting tired of defending Linux to my colleagues, as they fell about laughing every time I swore at it.
Linux did seem to utilise resources better, a default installation could run more VMs due to its default low memory footprint.
It also turned out that going the Vista route did not involve buying any additional Vista licences as my company has Vista Enterprise licences under the gold partner program which means we can run a Vista host and several guests under one licence.
Additional
During my adventures on Linux I did also try VirtualBox. I've tried VirtualBox before and I have to say it's one of the easiest virtualization platforms I've come across to install and use. It supports snapshots, integrated desktop, VMs run very fast and best of all its OpenSource, i.e. free.
In spite of this there are numerous reasons (depending on your needs) for chosing VMware:
- VirtualBox does not have as yet multi monitor support.
- VirtualBox does not utilise memory as efficiently as VMware, its lazy loading does not appear to be that lazy, and it does not page share.
- VirtualBox has no DirectX support (not that important for most scenarios, but worth a mention).
At some point I may try xen...