Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I run qemu -cpu kvm64 -snapshot -hda binary.img at a local console, the image boots and runs as I expect. However, when I log in via ssh -C -X, I see:

$ qemu -cpu kvm64 -snapshot -hda binary.img 
open /dev/kvm: Permission denied
Could not initialize KVM, will disable KVM support
qemu: pci_add_option_rom: failed to find romfile "pxe-rtl8139.bin"

(The pxe-rtl8139 message is there when run locally as well, it doesn't seem to matter.)

Why does using SSH make a difference? How can I run qemu over SSH without needing root permissions?

Both machines are Ubuntu 11.10, qemu and qemu-kvm are 0.14.1+noroms-0ubuntu6.2

share|improve this question
Your error message seems to indicate a permissions problem. Are you ssh in as the same user ? – bodhi.zazen Mar 5 '12 at 4:24
@bodhi.zazen - yep, same user. Authenticated using keys, not password. – detly Mar 5 '12 at 4:29
What are the ownership permissions on /dev/kvm and output of id – bodhi.zazen Mar 5 '12 at 4:34
/dev/kvm is owned root:kvm and id says uid=1000(jason) gid=1000(jason) groups=1000(jason),4(adm),20(dialout),24(cdrom),46(plugdev),116(lpadmin),118(adm‌​in),124(sambashare) – detly Mar 5 '12 at 4:36
Add your user to the kvm group and it should then work. – bodhi.zazen Mar 5 '12 at 4:43
up vote 4 down vote accepted

After additional information in the comments, You need to add your user to the kvm group.

share|improve this answer
Great! But why does it work for a local login? Some sort of PAM magic I'm guessing? – detly Mar 5 '12 at 4:51
I am not sure why it worked locally, did you run it with sudo ? – bodhi.zazen Mar 5 '12 at 4:57
Nope. Same as over SSH, just as my regular login. – detly Mar 5 '12 at 5:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.