Monday, September 26, 2011

qemu-kvm: balloon driver

Qemu-kvm has a really neat feature called memory ballooning. This feature allows you to change the memory for your virtual guest doing runtime. Usually this feature is enabled by default, but the virtual guest also has to support this (By default my gentoo initi-script also turns it on). To make it work on the guest side you only have to enable the following feature in the kernel config (guest kernel):

CONFIG_VIRTIO_BALLOON=y (Virtualization -> Virtio balloon driver)


There are even drivers for Windows which are available here: Link
After turning on you can connect to the qemu monitor via netcat or telnet. Too see the actual memory of the guest you only have to type:

(qemu) info balloon


The syntax for increasing or decreasing the memory is:

(qemu) balloon 1024


This command will change the memory allocation to the specified amount in MB. Looking at the above example it would be 1024MB.

3 comments:

  1. Be careful when using the ballooning driver on Windows - I had major trouble with Win2k8R2 crashing randomly when having the ballooning driver installed - I didn't even change the memory allocation.

    This was ~6 months ago, maybe it's a little more stable now.

    ReplyDelete
  2. @ eliasp
    thx for the info, i never tried it out on windows but now you made me curious. I'll gonna take a lock how the state for windows is now.;)

    ReplyDelete
  3. Hi Here is an awesome balloons app. I wish these will work for you and you will get the best thing.
    the balloons memory | valentine love puzzle

    ReplyDelete