| Summary: | running an image with kvm enabled fails if the runqemu command is used | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Laurentiu Serban <laurentiu.serban> |
| Component: | virtual machines | Assignee: | Cristian Iorga <cristian.iorga> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | alexandru.c.georgescu, alexandru.damian, poky.bs.watcher, poky.watcher, sgw |
| Version: | unspecified | ||
| Target Milestone: | 1.3 M5 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | 4b5d9da07c2b4946cf2321ce537047bd61366a6e | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Laurentiu Serban
2012-09-26 22:29:59 UTC
Hello,
This is the key:
"vhost-net requested but could not be initialized"
This is not a problem of poky, Yocto Linux or qemu.
This basically means that the user did not configure properly vhost-net driver in order to be run also under a user without administrative rights.
See this part from the guide:
Change the kvm dev ownership for non-root user
qemu is started as non-root user in poky, but /dev/kvm from some distribution remains root:root that only allow root to use KVM. To work around this, we need create a new group named kvm, and make both /dev/kvm and the non-root user belongs to it.
$ sudo addgroup --system kvm
$ sudo adduser $USER kvm
$ sudo chown root:kvm /dev/kvm
$ sudo chmod 0660 /dev/kvm
The output of "ls -l /dev/kvm" should be like this:
crw-rw----+ 1 root kvm 10, 232 2010-07-02 09:27 /dev/kvm
On a system that runs udev, you will probably need to add the following line somewhere in your udev configuration so it will automatically give the right group to the newly created device (i-e for ubuntu add a line to /etc/udev/rules.d/40-permissions.rules).
KERNEL=="kvm", GROUP="kvm"
Something similar must be done for vhost-net!!
Note
You need log out then log in the non-root user to take the effect
Some distributions have already made this, so that we can skip this step
And also:
Basically, follow the same guide as for enabling KVM on the host (step 1.), but replace kvm with vhost_net
Or course that running under sudo solves the issue.
And if someone authenticated himself/herself to run something under sudo, there a limited period of time in which the system does not ask you again for your password.
Please document all this with the ready-to-run copy-paste scripts in the Wiki page. The wiki page is not clear on what you are supposed to do. Please detect in the runqemu script when this error is triggered, and provide an informative message with a link to the wiki page. Agreed. 1. Online guide will be updated. 2. Reported error will be clarified and a link to the online guide will be provided. Regards, Cristian Patch submitted for review. Online guide has been updated and clarified. See: https://wiki.yoctoproject.org/wiki/Running_an_x86_Yocto_Linux_image_under_QEMU_KVM Fixed. Verified. Following the wiki could help me boot qemu kvm enabled. |