qemu fails to recognize full virtualization

Bug #1387881 reported by Adam Stokes
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Invalid
Undecided
Unassigned
linux (Ubuntu)
Invalid
High
Unassigned
qemu (Ubuntu)
Invalid
Undecided
Unassigned
virtinst (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

System:

14.04
qemu - 2.0.0+dfsg-2ubuntu1.6
virtinst 0.600.4-3ubuntu2

Command:

virt-install --name juju-bootstrap --ram=2048 --vcpus=1 --hvm \
--virt-type=kvm --pxe --boot network,hd --os-variant=ubuntutrusty \
--graphics vnc --noautoconsole --os-type=linux --accelerate \
--disk=/var/lib/libvirt/images/juju-bootstrap.qcow2,bus=virtio,format=qcow2,cache=none,sparse=true,size=20 \
--network=bridge=br0,model=virtio

Error:

ERROR Host does not support virtualization type 'hvm'

Diagnostics:

$ sudo kvm -vnc :1 -monitor stdio
[sudo] password for cscloud:
QEMU 2.0.0 monitor - type 'help' for more information
(qemu) KVM internal error. Suberror: 1
emulation failure
EAX=00000000 EBX=40010000 ECX=00000030 EDX=00000cfd
ESI=00000000 EDI=00000000 EBP=00000000 ESP=00006fcc
EIP=0fedb30c EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00409300 DPL=0 DS [-WA]
CS =0008 00000000 ffffffff 00c09a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00409200 DPL=0 DS [-W-]
DS =0010 00000000 ffffffff 00409300 DPL=0 DS [-WA]
FS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
GS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT= 000f6688 00000037
IDT= 000f66c6 00000000
CR0=60000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000000
Code=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
info kvm
kvm support: enabled
(qemu)

> lsmod|grep kvm
kvm_intel 143109 0
kvm 451552 1 kvm_intel

$ dmesg|grep -i kvm
[ 5.722167] kvm: Nested Virtualization enabled
[ 5.722190] kvm: Nested Paging enabled

---

I haven't been able to get much out of libvirt as the kvm instance never starts.

Changed in linux (Ubuntu):
importance: Undecided → High
tags: added: kernel-da-key trusty
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1387881

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Did this issue occur in a previous version of Ubuntu, or is this a new issue?

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v3.18 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc2-utopic/

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Also please show the results of:

dpkg -l | grep qemu

Does a reboot or a 'rmmod kvm_intel kvm; modprobe kvm kvm_intel' fix it?

You said earlier (in irc) that 'sudo apt-get install qemu-kvm' fixes it. Is that still the case?

Revision history for this message
Adam Stokes (adam-stokes) wrote :

So adding qemu-kvm fixed the issue with running nested KVM. I think though the problem still exists on a non nested environment.

I'll get with the user who encountered this and see if I can get some more logs.

Thanks

Revision history for this message
Adam Stokes (adam-stokes) wrote :

David,

Could you attach the collection of:

apport-collect 1387881

Also the output of:

dpkg -l |grep qemu

On the affected NUCs if the problem still persists?

Thanks,
Adam

tags: added: kernel-unable-to-test-upstream
Revision history for this message
David Britton (dpb) wrote : apport information

AlsaVersion: Advanced Linux Sound Architecture Driver Version k3.13.0-39-generic.
AplayDevices: Error: [Errno 2] No such file or directory
ApportVersion: 2.14.1-0ubuntu3.5
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', '/dev/snd/controlC0', '/dev/snd/hwC0D3', '/dev/snd/pcmC0D3p', '/dev/snd/pcmC0D7p', '/dev/snd/pcmC0D8p', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
Card0.Amixer.info: Error: [Errno 2] No such file or directory
Card0.Amixer.values: Error: [Errno 2] No such file or directory
DistroRelease: Ubuntu 14.04
IwConfig: Error: [Errno 2] No such file or directory
Package: qemu
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.13.0-39-generic root=UUID=381042f5-3108-4ecb-98ca-6251eb8cf10d ro
ProcVersionSignature: Ubuntu 3.13.0-39.66-generic 3.13.11.8
RelatedPackageVersions:
 linux-restricted-modules-3.13.0-39-generic N/A
 linux-backports-modules-3.13.0-39-generic N/A
 linux-firmware 1.127.7
RfKill: Error: [Errno 2] No such file or directory
Tags: trusty uec-images
Uname: Linux 3.13.0-39-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

_MarkForUpload: True
dmi.bios.date: 04/25/2013
dmi.bios.vendor: Intel Corp.
dmi.bios.version: RKPPT10H.86A.0017.2013.0425.1251
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: D53427RKE
dmi.board.vendor: Intel Corporation
dmi.board.version: G87971-403
dmi.chassis.type: 3
dmi.modalias: dmi:bvnIntelCorp.:bvrRKPPT10H.86A.0017.2013.0425.1251:bd04/25/2013:svn:pn:pvr:rvnIntelCorporation:rnD53427RKE:rvrG87971-403:cvn:ct3:cvr:

tags: added: apport-collected uec-images
Revision history for this message
David Britton (dpb) wrote : AlsaDevices.txt

apport information

Revision history for this message
David Britton (dpb) wrote : BootDmesg.txt

apport information

Revision history for this message
David Britton (dpb) wrote : CRDA.txt

apport information

Revision history for this message
David Britton (dpb) wrote : Card0.Codecs.codec.3.txt

apport information

Revision history for this message
David Britton (dpb) wrote : CurrentDmesg.txt

apport information

Revision history for this message
David Britton (dpb) wrote : Lspci.txt

apport information

Revision history for this message
David Britton (dpb) wrote : Lsusb.txt

apport information

Revision history for this message
David Britton (dpb) wrote : PciMultimedia.txt

apport information

Revision history for this message
David Britton (dpb) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
David Britton (dpb) wrote : ProcInterrupts.txt

apport information

Revision history for this message
David Britton (dpb) wrote : ProcModules.txt

apport information

Revision history for this message
David Britton (dpb) wrote : UdevDb.txt

apport information

Revision history for this message
David Britton (dpb) wrote : UdevLog.txt

apport information

Revision history for this message
David Britton (dpb) wrote : WifiSyslog.txt

apport information

Revision history for this message
David Britton (dpb) wrote :

dpkg -l |grep qemu:

ii qemu-utils 2.0.0+dfsg-2ubuntu1.6 amd64 QEMU utilities

Revision history for this message
Chris J Arges (arges) wrote :

This is a package dependency issue and not a kernel issue. Once davidpbritton installed 'qemu-kvm' he was able to install using virt-install just fine.

So overall either the packages davidpbritton was installing weren't sufficient to use qemu with KVM, or we have a dependency problem in the Ubuntu packaging.

Changed in linux (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
David Britton (dpb) wrote :

apt history.log for packages installed on top of base system. Note that only the last entry was done by me, the others were done in preparation of the image:

http://paste.ubuntu.com/8761810/

Basically, I booted a curtain installed maas node with an amd64 trusty image from maas. Logged in, ran

apt-get install virtinst

then:

root@kepler:~# virt-install --name juju-bootstrap --ram=2048 --vcpus=1 --hvm --virt-type=kvm --pxe --boot network,hd --os-variant=ubuntutrusty --graphics vnc --noautoconsole --os-type=linux --accelerate --nodisks
ERROR Host does not support virtualization type 'hvm'

Revision history for this message
Chris J Arges (arges) wrote :

So I'm not completely sure virtinst should depend on qemu-kvm, since we assume one can use it without --virt-type=kvm, so my thoughts would be you should install additional package as necessary to use qemu w/ KVM. I'll let hallyn comment as well.

Revision history for this message
Adam Stokes (adam-stokes) wrote :

I just added qemu-kvm as a dependency for the openstack installer. It is probably correct in assuming that virtinst shouldn't depend on qemu-kvm since you can do paravirtualized.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1387881] Re: qemu fails to recognize full virtualization

I don't think however that we can claim this is notabug. Based on the
Description, the kvm modules appears to be loaded and enabled, per kvm-ok
output. You shouldn't be getting the

KVM internal error. Suberror: 1
emulation failure

that you're getting, and it's not clear to me what part of installing
qemu-kvm is fixing it.

Can you only get this on one particular host (i.e. hardware type)? Is
there anything in syslog? Which packages (dpkg -l | grep qemu) are
actually installed? Does a reboot (without installing new packages)
fix the problem?

Revision history for this message
Chris J Arges (arges) wrote :

I can reproduce this in a VM:
1) boot a clean cloud images (uvt-kvm create lp1387881)
2) apt-get install virtinst
3) sudo virt-install --name juju-bootstrap --ram=2048 --vcpus=1 --hvm --virt-type=kvm --pxe --boot network,hd --os-variant=ubuntutrusty --graphics vnc --noautoconsole --os-type=linux --accelerate --nodisks -d

You'll get the following:

$ sudo virt-install --name juju-bootstrap --ram=2048 --vcpus=1 --hvm --virt-type=kvm --pxe --boot network,hd --os-variant=ubuntutrusty --graphics vnc --noautoconsole --os-type=linux --accelerate --nodisks -d
[Wed, 05 Nov 2014 16:23:29 virt-install 3297] DEBUG (cli:227) Launched with command line:
/usr/bin/virt-install --name juju-bootstrap --ram=2048 --vcpus=1 --hvm --virt-type=kvm --pxe --boot network,hd --os-variant=ubuntutrusty --graphics vnc --noautoconsole --os-type=linux --accelerate --nodisks -d
[Wed, 05 Nov 2014 16:23:29 virt-install 3297] DEBUG (cli:332) Requesting libvirt URI default
[Wed, 05 Nov 2014 16:23:29 virt-install 3297] DEBUG (cli:334) Received libvirt URI qemu:///system
[Wed, 05 Nov 2014 16:23:29 virt-install 3297] DEBUG (virt-install:258) Requesting virt method 'hvm', hv type 'kvm'.
[Wed, 05 Nov 2014 16:23:29 virt-install 3297] ERROR (cli:445) Host does not support virtualization type 'hvm'
[Wed, 05 Nov 2014 16:23:29 virt-install 3297] DEBUG (cli:448)
Traceback (most recent call last):
  File "/usr/bin/virt-install", line 273, in get_virt_type
    machine=options.machine)
  File "/usr/lib/python2.7/dist-packages/virtinst/CapabilitiesParser.py", line 736, in guest_lookup
    {'virttype' : osstr, 'arch' : archstr})
ValueError: Host does not support virtualization type 'hvm'

Revision history for this message
Chris J Arges (arges) wrote :

Answers to some of your questions:

Can you only get this on one particular host (i.e. hardware type)?
- No as I can repro in KVM

-Is there anything in syslog?
- Nothing relevant

Which packages (dpkg -l | grep qemu)
ii qemu-utils 2.0.0+dfsg-2ubuntu1.6 amd64 QEMU utilities

Does a reboot (without installing new packages) fix the problem?
- No

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Chris,

thanks, but what you are showing is, I thought we had agreed, not a bug.
Installing virtinst does not automatically install qemu-system, as indeed
it should not since you may want to use it with xen only.

what I am interested in is whether you can reproduce the actual kvm error
which is shown in the Description, i.e. the

KVM internal error. Suberror: 1
emulation failure

If not, then I'm tempted to close this bug as invalid.

Revision history for this message
Iggy (iggy-theiggy) wrote :

Nested on Intel should be much improved in newer kernel versions (especially with regard to nested ept as the original report seems to indicate is in use.

So if the original emulation failure is reproducible, I'd suggest testing on a newer kernel.

Revision history for this message
Chris J Arges (arges) wrote :

@Serge
Gotcha, I misinterpreted your statement. Yes we are in agreement.

@dpb:
Have you had any further failures after installing qemu-kvm?

Revision history for this message
David Britton (dpb) wrote :

@arges -- installation of qemu-kvm has fixed the problem.

Changed in qemu (Ubuntu):
status: New → Invalid
Changed in qemu:
status: New → Invalid
Changed in virtinst (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.