You are not logged in.

#1 2008-12-01 15:47:13

mjs483
Member
Registered: 2008-09-08
Posts: 6

KVM virtualization problems

For the past month I've been having trouble to get my virtual machines to run using the Kernel Virtualization Module (kvm). Everything had been working perfectly but after a full system upgrade about a month ago, everything stopped working. I'm starting my VM with the following command:

$ qemu-kvm -std-vga -net nic,vlan=1 -net user,vlan=1 vm.img

I get the following output:

kvm_create_phys_mem: File existsset_vram_mapping: cannot allocate memory: File exists
set_vram_mapping failed
kvm: get_dirty_pages returned -2
kvm: get_dirty_pages returned -2
kvm: get_dirty_pages returned -2
kvm: get_dirty_pages returned -2
(repeated over and over)

From the looks of http://kerneltrap.org/mailarchive/linux … /6/3520174 and http://www.mail-archive.com/kvm-commits … 00619.html it seems like this issue was found and addressed in October, but none of the system updates I've done in the last month have fixed the problem.

Does anyone have any suggestions or info about this?

Offline

#2 2008-12-04 11:58:28

attila
Member
Registered: 2006-11-14
Posts: 293

Re: KVM virtualization problems

If you see here http://www.linux-kvm.com/content/kvm-77 … erformance kvm > 76 should solves the problem. But i recognize sometimes the lines with "kvm: get_dirty_pages returned -2" too and i use kvm 78 in my own package.:(

Offline

#3 2008-12-04 12:37:55

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: KVM virtualization problems

This occurs only when using the -std-vga option or the newer -vga std option kvm>76. A workaround is to use the cirrus graphics driver, which will limit resolution and color depth, but not give errors.

As attila has already said, recompiling qemu with the kvm=78 fixed most occurrences of this issue. I've only ever seen it once with my custom package and a Windows 2000 guest OS. What guest OS are you using?

Offline

#4 2008-12-04 16:52:21

attila
Member
Registered: 2006-11-14
Posts: 293

Re: KVM virtualization problems

@iBertus The worsest option is to use "-vga vmware". smile Using cirrus works better as vga with archlinux and kde4 in a vm.

List of my vm's:

- archlinux to see what will the new kde4 brings
- opensuse to see their kde4 and to test some things for my server
- Windows XP (Media Center)
- Some other for a short view (ubuntu, centos or fedora ...)

Personally i find kvm very nice, very fast and in every vm i can see my 2 dual2core cpu's. But i use my own package with the original modul in /lib/modules/$(uname -r)/updates and it is based on the kvm.spec with the most patches from a opensuse repo. I recognized that the modul from the mainstream works for me more stable than the modul included in the kernel tree.

Offline

#5 2008-12-04 21:05:13

mjs483
Member
Registered: 2008-09-08
Posts: 6

Re: KVM virtualization problems

Ok, I think I need a better education on kvm. I had assumed that since kvm stood for 'kernel virtualization module' that it was one of the modules that comes with the linux kernel. But I see now that that is not the case. I was confused about that because I couldn't find any package called 'kvm' installed on my system.

My understanding now is that the qemu package that I have installed, has kvm compiled into it. So if I compile qemu from source and point it to the latest kvm source, I should end up with a new qemu-kvm that uses the latest kvm release correct?

Alternatively I could wait for the qemu package in the pacman repos to be updated and just not use -std-vga for now, or try another graphics driver...

Does all of that sound right? Thanks!

iBertus, by the way I'm using a WinXP guest.

Offline

#6 2008-12-04 21:12:09

mjs483
Member
Registered: 2008-09-08
Posts: 6

Re: KVM virtualization problems

Well, now according to the kvm wiki:

"The kernel component of KVM is included in mainline Linux, as of 2.6.20."

So my question is, how do I know which version of kvm was included in my kernel?

Offline

#7 2008-12-05 06:01:39

attila
Member
Registered: 2006-11-14
Posts: 293

Re: KVM virtualization problems

@mjs483 If you want to compile kvm by yourself than you should not use the latest because kvm-79 likes to have 2.6.28 (http://feedproxy.google.com/~r/Kvm-TheL … e-hot-plug). And yes, you have no kvm package because it is included inside of the qemu package.

For your WinXP guest i think it is better to stay with "-std-vga" (or "-std vga" from kvm-78 on) because i recognized by testing my own WinXP vm that it don't like the cirrus option.

If you don't have so much experience with building your own package and if you don't have installed very much inside of your WinXP vm, than perhaps it could be an option to use virtualbox because from my view it seems better supported from the arch devs and therefore it should works better out of the box.

From my view building kvm is not so easy as it sounds because i have had problems to compile kvm-78 and that is why i use the opensuse source rpm with the most of their patches. But this must not be valid for you because i'm not a dev.:)

Offline

#8 2008-12-05 15:11:23

mjs483
Member
Registered: 2008-09-08
Posts: 6

Re: KVM virtualization problems

Success!!! Now that I understand how qemu + kvm is arranged, I was able to use the Arch Build System (ABS) to compile a new qemu with kvm-78 with no trouble at all. If anyone wants to compile it for themselves, (assuming you have 'abs' installed) just:

1. Copy /var/abs/extra/qemu to your home directory (or where ever)
2. Open PKGBUILD and set the following variables:
3. Set

pkgrel=11

4. Set

_kvmver=78

5. At the very bottom replace the 3rd md5 sum with:

'54b062575aeeaa424fa0d5aa46c284a9'

6. Save and close the file and run

$ makepkg

7. After it builds install with:

$ pacman -U qemu-0.9.1-11-i686.pkg.tar.gz

Thanks for the help.

Last edited by mjs483 (2008-12-05 15:12:44)

Offline

Board footer

Powered by FluxBB