4

I am trying to migrate a KVM guest from one Ubuntu 14.04 host to another by following the steps outlined here.

I now have the "state" file, xml configuration, and qcow2 img file in a single folder on the new host, and made sure to update the xml configuration to point to the new location of the qcow2 image file.

When I try to run virsh create [guest-id].xml I get the following error message:

error: internal error: process exited while connecting to monitor: qemu-system-x86_64: -drive file=/media/stuart/storage2/kvm/dns.technostu.com/dns.technostu.com.img,if=none,id=drive-virtio-disk0,format=raw: could not open disk image /media/stuart/storage2/kvm/dns.technostu.com/dns.technostu.com.img: Could not open '/media/stuart/storage2/kvm/dns.technostu.com/dns.technostu.com.img': Permission denied

Debugging and Attempted workarounds

  • I have already added myself to the libvirtd group and re-logged in.
  • I made sure the filepaths were correct
  • I changed the ownership of the .img file to myself, but after running the command with and without sudo, the ownership of the file keeps changing to root:root with permissions -rwxr-xr-x
  • I tried running $ sudo apt-get install apparmor-profiles apparmor-utils $ sudo aa-complain /usr/lib/libvirt/virt-aa-helper From this post, but that hasn't worked.
  • I tried changing the emulator in the xml file as specified here.

What do I need to do in order to "import" the guest on the new host on Ubuntu 14.04?

2

I had a similar problem.

Adding my user to the kvm group

sudo usermod -a -G kvm username

Then I made sure that /dev/kvm is owned by root and group kvm

Afterwards I changed the ownership of my existing VM (converted from VirtualBox) to username:kvm

Finally I set group=kvm user=username in my qemu.conf This fixed it for me

1

Turning the computer off and on again (I hadn't rebooted since installing kvm) changed the error message to:

error: internal error: process exited while connecting to monitor: qemu-system-x86_64

When Googling that error, I found this post which recommended adding the following to

user = "root"
group = "root"

to the /etc/libvirt/qemu.conf file. Be sure to include the quotes.

After another reboot, I was able to run virsh create [guest-id].xml successfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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