Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
qemu complains about missing kvm - but it's there [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
fidel
Guru
Guru


Joined: 16 Jul 2004
Posts: 399
Location: CH

PostPosted: Mon Sep 07, 2015 3:47 pm    Post subject: qemu complains about missing kvm - but it's there [SOLVED] Reply with quote

I am stuck trying to run qemu on my machine. I followed the guide on https://wiki.gentoo.org/wiki/QEMU/Linux_guest but I'm getting the following error:

Code:
"kvm" accelerator not found.
No accelerator found!


This happens, when I try the following:
Code:
qemu-system-arm -enable-kvm \
    -cpu host \
    -drive file=${HOME}/Arm.img,if=virtio \
    -netdev user,id=vmnic,hostname=arm-vm -device virtio-net,netdev=vmnic \
    -m 2G \
    -monitor stdio \
    -name "Arm VM" \
    -machine virt


The module is loaded:
Code:
$ lsmod | grep kvm
kvm_intel             136029  0
kvm                   278305  1 kvm_intel


The device exists:

Code:
$ ls -l /dev/kvm
crw-rw---- 1 root kvm 10, 232  7. Sep 10:59 /dev/kvm


I am in the kvm group:

Code:
id | grep kvm
.... 78(kvm),...


I installed qemu with the following use flags:
Code:
$ eix -I app-emulation/qemu
[I] app-emulation/qemu
     Available versions:  2.3.0-r4 2.3.0-r5 ~2.3.0-r6 ~2.3.1 ~2.4.0 **9999 {accessibility +aio alsa bluetooth +caps +curl debug +fdt +filecaps glusterfs gtk gtk2 infiniband iscsi +jpeg lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png pulseaudio python rbd sasl sdl sdl2 +seccomp selinux smartcard snappy spice ssh static static-softmmu static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net virtfs +vnc vte xattr xen xfs KERNEL="FreeBSD linux" PYTHON_TARGETS="python2_7" QEMU_SOFTMMU_TARGETS="aarch64 alpha arm cris i386 lm32 m68k microblaze microblazeel mips mips64 mips64el mipsel moxie or32 ppc ppc64 ppcemb s390x sh4 sh4eb sparc sparc64 unicore32 x86_64 xtensa xtensaeb" QEMU_USER_TARGETS="aarch64 alpha arm armeb cris i386 m68k microblaze microblazeel mips mips64 mips64el mipsel mipsn32 mipsn32el or32 ppc ppc64 ppc64abi32 s390x sh4 sh4eb sparc sparc32plus sparc64 unicore32 x86_64"}
     Installed versions:  2.3.0-r5(18:23:11 11.08.2015)(aio alsa bluetooth caps curl fdt filecaps gtk jpeg ncurses nfs nls numa opengl pin-upstream-blobs png sdl seccomp static-user threads usb uuid vhost-net vnc xattr -accessibility -debug -glusterfs -gtk2 -infiniband -iscsi -lzo -pulseaudio -python -rbd -sasl -selinux -smartcard -snappy -spice -ssh -static -static-softmmu -systemtap -tci -test -tls -usbredir -vde -virtfs -xen -xfs KERNEL="linux -FreeBSD" PYTHON_TARGETS="python2_7" QEMU_SOFTMMU_TARGETS="arm i386 m68k x86_64 -aarch64 -alpha -cris -lm32 -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -moxie -or32 -ppc -ppc64 -ppcemb -s390x -sh4 -sh4eb -sparc -sparc64 -unicore32 -xtensa -xtensaeb" QEMU_USER_TARGETS="arm armeb i386 m68k x86_64 -aarch64 -alpha -cris -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -or32 -ppc -ppc64 -ppc64abi32 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -unicore32")
     Homepage:            http://www.qemu.org http://www.linux-kvm.org
     Description:         QEMU + Kernel-based Virtual Machine userland tools


Am I missing or overseeing something? Thanks for any hint!


Last edited by fidel on Tue Sep 08, 2015 2:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
silent_Walker
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jul 2012
Posts: 100
Location: forums.gentoo.org

PostPosted: Mon Sep 07, 2015 4:06 pm    Post subject: Reply with quote

Are you running hpet? I read somewhere that KVM does not like hpet
_________________
^.^
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1100

PostPosted: Mon Sep 07, 2015 6:09 pm    Post subject: Reply with quote

Quote:
qemu-system-arm -enable-kvm
$ lsmod | grep kvm
kvm_intel 136029 0
kvm 278305 1 kvm_intel

Correct me if I'm wrong: you're trying to run ARM software in a qemu on x86 machine.

You are aware that those 2 have diferent instruction sets, aren't you? You can use KVM to mix incompatable architectures, it's purpose is to let the code run directly on hardware and only intercept certain instructions.
For pretending different hardware you need full machine emulation. Qemu can do that, but KVM won't work.
Try running qemu-system-x86_64 -enable-kvm to confirm your KVM works :roll: but it's not going to serve your purpose anyway
Back to top
View user's profile Send private message
WWWW
Tux's lil' helper
Tux's lil' helper


Joined: 30 Nov 2014
Posts: 143

PostPosted: Tue Sep 08, 2015 10:43 am    Post subject: Reply with quote

silent_Walker wrote:
Are you running hpet? I read somewhere that KVM does not like hpet


Running HPET where, in guest or host? Here host with hpet is fine with qemu. Also is this claim old or recent? Sometimes things get fixed to make it work in time.
Back to top
View user's profile Send private message
fidel
Guru
Guru


Joined: 16 Jul 2004
Posts: 399
Location: CH

PostPosted: Tue Sep 08, 2015 2:55 pm    Post subject: Reply with quote

Thanks a lot for your reply! In fact, I didn't know that! :oops:
Indeed, qemu-system-x86_64 -enable-kvm works! And the following now seems to work as well - almost:

Code:
qemu-system-arm \
-cpu cortex-m3 \
-drive file=${HOME}/arm.img,if=virtio \
-netdev user,id=vmnic,hostname=arm-vm \
-device virtio-net,netdev=vmnic \
-m 2G \
-monitor stdio \
-name "Arm VM" \
-machine smdkc210


Now I get the error
Code:
No 'PCI' bus found for device 'virtio-net-pci'


But thats another story. I will investigate and mark this as solved.

Thanks!
Back to top
View user's profile Send private message
WWWW
Tux's lil' helper
Tux's lil' helper


Joined: 30 Nov 2014
Posts: 143

PostPosted: Wed Sep 09, 2015 7:25 am    Post subject: Reply with quote

fidel wrote:


Now I get the error
Code:
No 'PCI' bus found for device 'virtio-net-pci'



Missing module most likely. There are extra modules on the host to load to help virtio stuff.
Back to top
View user's profile Send private message
fidel
Guru
Guru


Joined: 16 Jul 2004
Posts: 399
Location: CH

PostPosted: Wed Sep 09, 2015 8:04 am    Post subject: Reply with quote

Thanks, true! After loading some virtio- modules (pci, net, blk) I now get:

Code:
No 'virtio-bus' bus found for device 'virtio-net-device'


But I cannot find any such module. :(
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum