Virtualization on OSX
I'm about to go on the road again and I've been getting my laptop updated to make sure I can function without internet access. For me that means that I need a linux environment. I've been using Parallels for this because it was the only option when I first got my macbook, and I'm not terribly impressed with its ability to run linux virtual machines.
First I have to say that my preferred usage for vms is to disable as much graphical UI as possible and login using the terminal; I want to avoid any excess resource usage because I'm on a laptop and I want better battery life.
Here's my gripe list:
- poweroff spins the cpus up to 100% or more utilization and doesn't actually power the machine off.
The reason? ACPI is only supported for vista guests. I'm rather bemused by this statement, because the whole point of ACPI is to virtualize certain types of hardware access--it should not be targeted to a particular OS. - Parallels Tools requires X to run.
You can manually run the daemon but it spins the CPU trying to open the display. This means that you can't get time synchronization with the host unless you want to load your CPU - Shared folder performance sucks
Mounting the host filesystem over NFS is faster, but kernel panics OSX (the latter is probably an OSX bug)
Outside of these issues, it's not bad though. I'm rather disappointed about the level of Linux support from Parallels--I had all the same problems a year ago and nothing seems to have changed. It's clear that their priority is in making the Windows VM experience nice and integrated, and that's their perogative.I've also tried VMWare Fusion, both the current stable and the beta versions; here's my gripe list:
- lvm and vmware fusion appear to not like each other.
Sometimes on reboot the vm filesystem is corrupt, especially the rpm database, and the image needs to be tossed and reinstalled without lvm. This is problematic because the default install for centos is lvm based. - vmware fusion freezes and can't be killed, can't be restarted.
The resolution is a reboot of the laptop, which isn't reliable--powercycling is required.
I like vmware (I've been using it for many years), but it's not a happy camper on my laptop; I've uninstalled it.I've also tried VitualBox, and it's pretty good, but not perfect; gripes:
- Only supports NAT networking, with no locally visible IP/network.
This means that I can't ssh into individual machines by IP and have to set up port forwarding to get into them from my terminal. - Setting up port fowarding requires 3 long and tedious command invocations for each port
Some positives for VirtualBox:
- ACPI support appears to be very complete
The GUI even allows you to distinguish between an ACPI power off request and yanking out the power cord - SATA controller emulation
This is faster than IDE/ATA emulation, which is all that Parallels offers. VMWare offers SCSI as an option, but that's a non-starter for me currently. - You can run VirtualBox vms completely headless and optionally export the console display using Remote Desktop
- It's free to download and run
I'm sticking with Parallels for the time being; I think that VirtualBox might become my favourite once they've beefed up the networking support on OSX.I'll leave you with a couple of performance tips that should apply to any virtualization software:
- Use fixed size virtual disks in preference to dynamically expanding disks. This will improve filesystem performance
- Linux kernels by default have a high timer frequency that can torture the emulation and cause it have higher CPU load.
If it makes sense for your vm, you can rebuild the kernel to use a lower frequency.
If you're using centos, grab one of these pre-compiled kernels and reboot.
This resulted in a drop from 30% CPU utilization when idle to 7% for me in Parallels, and a less significant drop in VirtualBox.