You are not logged in.

#1 2007-07-25 02:14:27

RobF
Member
Registered: 2006-10-10
Posts: 157

Can't get kvm and qemu-kvm to work with 2.6.22 (Intel Core Duo T2300)

I upgraded my plain vanilla kernel26 to 2.6.22.1-3 and installed the newly updated packages qemu 0.9.0-4 and kqemu 1.3.0pre11-10.  The new kernel also installs the package kvm-modules which includes kvm, kvm-intel and kvm-amd.

I'm running a Dell Inspiron 6400 laptop with the Intel Core Duo processor which according to 'hwinfo --cpu' is a Model: 6.14.8 "Genuine Intel(R) CPU  T2300  @ 1.66GHz".  According to the Intel website, the T2300 supports Intel's Virtualization Technology (VT) whereas their T2300E does not.  If my machine had the T2300E rather than the T2300, I'd think 'hwinfo' would have made that distinction.

I've also created a group 'kvm' and included myself and root as members of that group.

I can load the kvm module fine, i.e.

# lsmod | grep kvm
kvm                    58160  0

but I can't load kvm-intel

# modprobe kvm-intel
FATAL: Error inserting kvm_intel (/lib/modules/2.6.22-ARCH/kernel/drivers/kvm/kvm-intel.ko): Operation not supported

With full kvm support missing in the kernel, qemu-kvm cannot use kvm and it reverts to running without full virtualization:

$ qemu-kvm -cdrom puppy-2.17-seamonkey-fulldrivers.iso -hda qemulinux.img -m 256 -boot d
open /dev/kvm: No such file or directory
Could not initialize KVM, will disable KVM support

How can I fix this?

Offline

#2 2007-07-25 03:04:33

slubman
Member
From: Grenoble (France)
Registered: 2004-08-04
Posts: 86
Website

Re: Can't get kvm and qemu-kvm to work with 2.6.22 (Intel Core Duo T2300)

Hi.

Check 2 things:
1°/ Does this command output something : cat /proc/cpuinfo | grep vmx
2°/ Isn't the virtualisation technologie disabled in the bios ?

Offline

#3 2007-07-25 05:52:50

RobF
Member
Registered: 2006-10-10
Posts: 157

Re: Can't get kvm and qemu-kvm to work with 2.6.22 (Intel Core Duo T2300)

slubman wrote:

Check 2 things:
1°/ Does this command output something : cat /proc/cpuinfo | grep vmx
2°/ Isn't the virtualisation technologie disabled in the bios ?

You are right: the virtualization technology (VT) has to be switched on or off in the BIOS (in Dell it's in the "POST Behavior" section), and the default was OFF.  So, I switched it on, and I then was able to load the kvm-intel module. 

NOTE: Although the module is generally referred to as kvm-intel (e.g. in /lib/modules/2.6.22-ARCH/kernel/drivers/kvm/ it's designated kvm-intel.ko), when you want to load it you have to run # modprobe kvm_intel.  Running # modprobe kvm-intel won't load it.  I have yet to see by which name I have to put it in the MODULES line in /etc/rc.conf to autoload it at boot time.

With VT enabled in the BIOS and the appropriate kvm modules loaded, I still wasn't able to run qemu-kvm as an ordinary user (got the error: "open /dev/kvm: Permission denied"), in spite of the fact that I'd set myself up as a member of the group 'kvm'.

When I ran qemu-kvm as root (going to root via 'sux') the whole thing finally worked (i.e. the title bar of the guest OS window said "QEMU/KVM") but it didn't work very well: of five different Linux live CD ISO images tested, three quickly died with a core dump.  Where it worked (e.g. with Puppy and MCN-Live-Delft) the distros ran quite fast, almost at native speed, and certainly faster than in Qemu with kqemu.

I.e. I obviously still have some configuring left to do.  Any suggestions?

I wonder whether the problem has to do with the fact that I'm running most of these ISO images off an external USB HDD.

You also asked about the output of this:

$ cat /proc/cpuinfo | grep vmx
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc pni monitor vmx est tm2 xtpr
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc pni monitor vmx est tm2 xtpr

Last edited by RobF (2007-07-25 06:14:32)

Offline

#4 2007-07-25 09:20:16

slubman
Member
From: Grenoble (France)
Registered: 2004-08-04
Posts: 86
Website

Re: Can't get kvm and qemu-kvm to work with 2.6.22 (Intel Core Duo T2300)

The problem with kvm rights is described in this bug report [http://bugs.archlinux.org/task/7662] with also a PKGBUILD.

But you don't have to rebuild the whole qemu package, simply (as root):

wget -O /etc/udev/rules.d/65-kvm.rules 'http://git.kernel.org/?p=linux/kernel/git/avi/kvm-userspace.git;a=blob_plain;f=scripts/65-kvm.rules;hb=86e8eba8f8349d2e02e3b0ae0ce7c1993f4352fb'
modprobe -r kvm-intel kvm
modprobe kvm-intel

Now /dev/kvm should have good rights:

# ls -l /dev/kvm
crw-rw---- 1 root kvm 10, 232 jui 25 11:16 /dev/kvm

One done, add your user to kvm group:

usermod -a -G kvm your_login

Offline

#5 2007-07-25 16:51:40

RobF
Member
Registered: 2006-10-10
Posts: 157

Re: Can't get kvm and qemu-kvm to work with 2.6.22 (Intel Core Duo T2300)

slubman, thanks for your competent help.  I followed your prescriptions, and that fixed the permissions problem.

However, I still have major problems with running OS images reliably in qemu-kvm.

I'd used qemu 0.9.0-1 with kernel 2.6.18 and with kqemu compiled for that kernel extensively up until recently, mostly running ISO images of Linux live CD's.  This worked very well for close to 20 different live CD's; only 2 or 3 would balk and not run.  kqemu provided significant acceleration and the images ran reasonably fast, perhaps at half of native speed.

Then I upgraded to kernel 2.6.21 with qemu still at v.0.9.0-1 and the kqemu package for kernel 2.6.21.  In this setup, kqemu provided hardly any acceleration over qemu alone, most images ran painfully slowly and many of them hung somewhere in the boot process, typically quite early or at the latest when X was about to be started.

The same holds for the current kernel 2.6.22.  In qemu + kqemu these images don't run very fast, and in most cases they don't even boot fully.  In qemu-kvm most of these images fail to boot, too.  Those that do boot to the desktop, typically run quite fast, almost at native speed.

Is there some way of correcting this fickleness of qemu (either with kvm or kqemu), running under kernel 2.6.22.1-3?  This is the vanilla kernel26.

E.g. could this be related to the fact that the tickless kernel feature was introduced in the 2.6.21 kernel?  I.e. it appears that I can't configure '/dev/rtc' anymore to have a 1024 Hz timer.  /dev/rtc doesn't exist anymore with this kernel.  Would it help to add "nohz=off" to the kernel command line (i.e. by adding the line 'append="nohz=off"' to the Arch entry in my LILO)?

Offline

Board footer

Powered by FluxBB