You are not logged in.

#1 2013-03-07 15:09:01

netawater
Member
Registered: 2008-08-01
Posts: 36

[SOLVED]KVM error for Intel CPU

KVM: entry failed, hardware error 0x80000021

If you're running a guest on an Intel machine without unrestricted mode
support, the failure can be most likely due to the guest entering an invalid
state for Intel VT. For example, the guest maybe running in big real mode
which is not supported on less recent Intel processors.

It is OK for WinXP/Linux guest run at text, but it failed after entering graphic mode. How to resolve this problem, thansk very much

Name           : qemu
Version        : 1.4.0-2

uname -a
Linux myserver 3.7.10-1-ARCH #1 SMP PREEMPT Thu Feb 28 09:59:14 CET 2013 i686 GNU/Linux

cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 14
model name      : Intel(R) Core(TM) Duo CPU      U2500  @ 1.20GHz
stepping        : 12
microcode       : 0x54
cpu MHz         : 1197.091
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon bts aperfmperf pni monitor vmx est tm2 xtpr pdcm dtherm
bogomips        : 2395.93
clflush size    : 64
cache_alignment : 64
address sizes   : 32 bits physical, 32 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 14
model name      : Intel(R) Core(TM) Duo CPU      U2500  @ 1.20GHz
stepping        : 12
microcode       : 0x54
cpu MHz         : 1197.091
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon bts aperfmperf pni monitor vmx est tm2 xtpr pdcm dtherm
bogomips        : 2395.93
clflush size    : 64
cache_alignment : 64
address sizes   : 32 bits physical, 32 bits virtual
power management

Last edited by netawater (2013-08-07 00:55:06)

Offline

#2 2013-03-12 15:05:23

netawater
Member
Registered: 2008-08-01
Posts: 36

Re: [SOLVED]KVM error for Intel CPU

Do others meet this problem?

Offline

#3 2013-03-13 14:15:23

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,848

Re: [SOLVED]KVM error for Intel CPU

what is the output of lscpu on your system ?

Has it worked in the past ?

what command are you using to start kvm  ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2013-03-18 05:24:16

netawater
Member
Registered: 2008-08-01
Posts: 36

Re: [SOLVED]KVM error for Intel CPU

Lone_Wolf wrote:

what is the output of lscpu on your system ?

Has it worked in the past ?

what command are you using to start kvm  ?

Sorry for reply later, thanks very much!

Architecture:          i686
CPU op-mode(s):        32-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 14
Stepping:              12
CPU MHz:               1196.967
BogoMIPS:              2394.68
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              2048K

It worked ago.

 /usr/bin/qemu-system-i386 -name NewWinXP -S -M pc-i440fx-1.4 -enable-kvm -m 1024 -smp 1,socke
ts=1,cores=1,threads=1 -uuid b1e25e7e-7a2a-eded-13da-994512cc8898 -no-user-config -nodefaults
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/NewWinXP.monitor,server,nowait -mon
chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-shutdown -device piix3-usb
-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/usr/local/virtimages/WinXP.img,if=none,id=dri
ve-ide0-0-0,format=qcow2 -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,boot
index=1 -drive file=/usr/local/virtimages/Tools.img,if=none,id=drive-ide0-0-1,format=qcow2 -de
vice ide-hd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -netdev tap,fd=23,id=hostnet0 -d
evice rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:ff:8c:ee,bus=pci.0,addr=0x3 -chardev pty,id
=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -v
nc 127.0.0.1:0 -k en-us -vga std -device ES1370,id=sound0,bus=pci.0,addr=0x4 -device virtio-ba
lloon-pci,id=balloon0,bus=pci.0,addr=0x5

Last edited by netawater (2013-03-19 14:57:39)

Offline

#5 2013-03-18 05:58:23

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED]KVM error for Intel CPU

Please use code tags when pasting to the boards:
https://wiki.archlinux.org/index.php/Fo … s_and_Code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2013-03-19 14:58:11

netawater
Member
Registered: 2008-08-01
Posts: 36

Re: [SOLVED]KVM error for Intel CPU

Sorry, I have update my post, please check it.

jasonwryan wrote:

Please use code tags when pasting to the boards:
https://wiki.archlinux.org/index.php/Fo … s_and_Code

Offline

#7 2013-03-19 22:04:49

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,848

Re: [SOLVED]KVM error for Intel CPU

with code tags that post looks  a lot better, netawater.

The lscpu output shows that virtualization is enabled four your system (didn't really doubt that, but wanted to be sure).
Trying to break down your qemu start command to make clearer which options you use :
(You can use multiple-line commands by ending each line with a / )

 /usr/bin/qemu-system-i386 /
-name NewWinXP /
-S /
-M pc-i440fx-1.4 /
-enable-kvm /
-m 1024 /
-smp 1,sockets=1,cores=1,threads=1 /
-uuid b1e25e7e-7a2a-eded-13da-994512cc8898 /
-no-user-config /
-nodefaults /
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/NewWinXP.monitor,server,nowait /
-mon chardev=charmonitor,id=monitor,mode=control /
-rtc base=localtime /
-no-shutdown /
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 /
-drive file=/usr/local/virtimages/WinXP.img,if=none,id=drive-ide0-0-0,format=qcow2 /
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 /
-drive file=/usr/local/virtimages/Tools.img,if=none,id=drive-ide0-0-1,format=qcow2 /
-device ide-hd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 /
-netdev tap,fd=23,id=hostnet0 /
-device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:ff:8c:ee,bus=pci.0,addr=0x3 /
-chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 /
-device usb-tablet,id=input0 /
-vnc 127.0.0.1:0 /
-k en-us /
-vga std /
-device ES1370,id=sound0,bus=pci.0,addr=0x4 /
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

Apart from the fact you use a very specific set of hardware for the VM, i don't see anything special.
A search with duckduckgo lead me to this german blog : virtualisierung-mit-kvm-und-virtuelle-netzwerke-mit-vde .
(section KVM Hardware Error).

The error the blog poster got looks very similar to yours, and was solved by applying a special parameter to the kvm_intel kernel module.

try loading the module with

modprobe kvm_intel emulate_invalid_guest_state=0

and test if that solves the problem.
(it's probably best to rmmod the kvm_intel module before giving the above command)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2013-03-20 15:06:19

netawater
Member
Registered: 2008-08-01
Posts: 36

Re: [SOLVED]KVM error for Intel CPU

modprobe kvm_intel emulate_invalid_guest_state=0

thanks, I have tried, it is worse, the vm paused immediately after boot.
but I found another thread about kvm issue like me:
http://www.spinics.net/lists/kvm/msg87621.html
and the bug report is
https://bugzilla.kernel.org/show_bug.cgi?id=50921
Does it mean I must update my kernel?

$ uname -a
Linux myserver 3.7.10-1-ARCH #1 SMP PREEMPT Thu Feb 28 09:59:14 CET 2013 i686 GNU/Linux

Offline

#9 2013-03-20 21:45:32

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,848

Re: [SOLVED]KVM error for Intel CPU

the fix is present in kernel 3.9 , and afaik there's no arch package yet for that version.

You can try to build it yourself using abs, or wait until 3.9.x becomes avaialble for arch (most likely it will be in testing repo once it's been released).

Other alternatives :
- install the lts kernel and check if the VM runs with that kernel as host.
- this error appears to be related to intel cpus as host, if you got access to an AMD based system, try running the VM on that one.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#10 2013-06-13 14:58:00

netawater
Member
Registered: 2008-08-01
Posts: 36

Re: [SOLVED]KVM error for Intel CPU

thanks, 3.9.5 is final released, I have update by pacman -Syu

[root@myserver plato]# uname -a
Linux myserver 3.9.5-1-ARCH #1 SMP PREEMPT Sat Jun 8 10:10:57 CEST 2013 i686 GNU/Linux

but kvm still failed, although there is no error message. the

2013-06-13 14:48:24.165+0000: starting up                                                            
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin QEMU_AUDIO_DRV=none /usr/bin/qemu-sy\
stem-i386 -name Test -S -machine pc-i440fx-1.4,accel=kvm,usb=off -cpu coreduo,+pdcm,+xtpr,+tm2,+est,\
+vmx,+pbe,+tm,+ht,+ss,+acpi,+ds -m 1024 -smp 1,sockets=1,cores=1,threads=1 -uuid 735f9bd7-b22f-0be3-\
98ab-fac3d3f4f3e7 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/q\
emu/Test.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-sh\
utdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/home/plato/windows/setup/CD\
linux_mini-0.9.5.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw -device ide-cd,bus=ide.1,unit=\
0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1 -netdev tap,fd=23,id=hostnet0 -device rtl8139,netdev=\
hostnet0,id=net0,mac=52:54:00:37:fd:3c,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-se\
rial,chardev=charserial0,id=serial0 -vnc 127.0.0.1:0 -k en-us -vga std -device ES1370,id=sound0,bus=\
pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5                             
char device redirected to /dev/pts/6 (label charserial0)                                             
qemu: terminating on signal 15 from pid 318                                                          
2013-06-13 14:50:56.850+0000: shutting down

The text mode is OK, but it is black for graphic mode. if I use virtual machine without KVM, it is OK, but very slow.

thanks again.

Offline

#11 2013-06-15 02:15:59

netawater
Member
Registered: 2008-08-01
Posts: 36

Re: [SOLVED]KVM error for Intel CPU

could somebody help me, thanks!

Offline

#12 2013-06-15 02:56:36

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]KVM error for Intel CPU

It is really not cool to bump threads like that.

But have you tried seeing if there is a bios update for your machine?  Sometimes buggy firmware can make features non-functional even though they are enabled.  For example, until recently, the aes-ni on my machine was borked.  But it was totally fixed as of about two months ago.

Offline

#13 2013-06-15 09:12:33

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,848

Re: [SOLVED]KVM error for Intel CPU

netawater, checking for a bios update as WonderWoofy suggest is a good idea.

apart from that i suggest you try starting a VM with more generic settings to try to determine where the problem is.
(maybe even create a fresh VM to test)

a command similar to this :

qemu-system-x86_64 \
-machine type=pc,accel=kvm \
-cpu host \
-boot order=c  \
-drive file=~/Virtual_Machines/arch-test/arch-test,if=virtio \
-net bridge,br=br0 -net nic,model=virtio \
-soundhw es1370 \
-vga std \
-m 2048

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#14 2013-06-15 15:01:34

netawater
Member
Registered: 2008-08-01
Posts: 36

Re: [SOLVED]KVM error for Intel CPU

thanks, I will try to find a latest firmware for my bios.

Offline

#15 2013-08-06 14:25:40

netawater
Member
Registered: 2008-08-01
Posts: 36

Re: [SOLVED]KVM error for Intel CPU

after updating kernel to 3.10.2-1, it is OK when I switch to two core of CPU, if use one, it is very slow!

Offline

Board footer

Powered by FluxBB