report on using kvm for virtualization on linux

by Martin Monperrus
I use kvm for running Windows XP on Linux and I am very happy :-) For me, it is the first fully satisfying virtualization experience.

First KVM is extremely fast, from the viewpoint of the virtual system (i.e. response times under Windows are very short), and from the viewpoint of the time required to switch between the virtual system (Windows) and the host system (Linux).

Second, KVM is easy to install, the required Linux kernel modules (kvm and kvm_intel) are available by default on most distributions. No need for compiling them :-)
Also, the packages are available by default on most distributions ($ apt-get install kvm)

Also, it's really easy to share files between the host system (Linux) and the virtual system (Windows) thanks to the virtual FAT disk feature of QEMU. No cumbersome Samba requirement, no difficult network configuration :-)

$ kvm -hda WinXP.img -std-vga -hdb fat:rw:/home/martin/Desktop/

Last but not least, KVM is free and open-source!

Tips


RAM Increase the RAM of the virtual machine, e.g. to 512MB: kvm -m 512 ...

High resolution Use the option -std-vga to enable high resolutions !

Mouse grabbing If you want to disable mouse grabbing, you can enable the embedded VNC server + tricks:

   $ kvm -k de -usbdevice tablet -vnc :2 -hda WinXP.qcow2 (you may change the keyboard layout option :-)
   $ vncviewer localhost:5902

Copy'n'paste if you want to enable copy-paste between Linux and Windows, use rdesktop:

# 1. enable rdesktop in windows

# 2. set up a port redirection in KVM for remote desktop
#  note that remote desktop is activated only when you are logged in: autologin has to be activated
# to shut down Windows with Remote Desktop see : http://blogs.msdn.com/oldnewthing/archive/2006/10/20/849575.aspx
# (you can also keep the built-in vnc server to shut dow)
$ kvm -k de -redir tcp:3389::3389 -nographic  -hda /home/martin-no-backup/WinXP.qcow2

# 3. use rdesktop
$ rdesktop -k de localhost

Competitors


I tried other virtualization solutions. None of them satisfies all the points above.
Tagged as: