Migrating from VMware Server to KVM on Ubuntu
After being let down by VMware one too many times (this time after upgrading Ubuntu to the latest beta and finding out that kernel 2.6.30+ is not supported), I decided to move on to KVM. After all, my server has full virtualisation support in the CPU so why not put that to good use.
I’ve started off by making sure virtualisation support is enabled in the BIOS. In my case it was nowhere to be found and a quick search for the MSI KA780G (MS-7551) showed that users had varying experience finding the feature but everyone seemed to agree that a BIOS upgrade should help (most of the time). A quick ‘lshw’ showed that I indeed was using the 16.0 version of the BIOS which is more than a year old.
Next, how to flash the BIOS? I do not (like the guide from MSI suggest) have a floppy drive installed in my server nor do I have Windows installed. Luckily, updating the BIOS of the KA780G is pretty easy as it is supported by the Linux programmer ‘flashrom’:
Warning: the last command actually programs the new BIOS into your computer. Make sure you have the right BIOS for your motherboard and do not interrupt the flashing.
On a side note: The 16.4 BIOS found on the support site did nothing for my AMD 5000+ CPU, in this thread, a helpful user uploaded an unsupported version which forcefully enables Hyper-V (the file is called A7551ACI rather than A7551AMS). The download requires registration on the forums.
If you finally manage to get it working, it is found under “Advanced Processor Features” –> “SVM Support” (SVM = Hyper-V). Enable it and reboot.
On a side note: I enabled HPET also, which stands for High Precision Event Timer, an upgraded version of the old RTC timer and useful for boosting overall performance (thanks to better timing control).
After rebooting I installed “kvm” and the module “kvm-amd” loaded without a hitch. The current “lshw” output is shown below. Notice how the name of the board changed from “MS-7551” to “CI-7551”. I guess “CI” stands for “Custom Image. Also note that the capabilities list the svm feature (note: the svm feature is visible on the CPU even if the BIOS disabled it – you simply can not use it without BIOS support).
Next up, I converted the VMware disk holding my CentOS based server in two steps: first I converted the 2GB files into one large file holding the entire virtual hard drive. Next, I used “qemu-disk” to convert this VMware based format into something KVM can use:
Next up is the conversion from the VMware virtual machine description to something qemu can use. We can use the “virt-goodies” package for this:
The virtual machine is now imported into “/etc/libvirt/qemu” so it can be used by libvirt. The only thing left to do it tweak the setup a little. Start by editing the generated XML file in the VMware directory to use the new KVM disk instead and make sure to define it again (because the same name is used, you simply redefine the host): “virsh -c qemu:///system define server.xml”.
Also, you might want to tweak the VNC settings to your liking: by default it uses an available port for the localhost only. Furthermore, I switched the network interface to bridged mode so the VM will be part of the network. Do this by renaming type from “network” to “bridge” and replace “
Now all that is left is to issue “virsh start YourServer” to fire up the new virtual machine. Note that you might have some issues to solve; like setting up new drivers in your guest VM.