Ubuntu 14.04 KVM - error: internal error: process exited while connecting to monitor: qemu-system-x86_64
Ubuntu 14.04 KVM - error: internal error: process exited while connecting to monitor: qemu-system-x86_64
https://askubuntu.com/questions/566218/ubuntu-14-04-kvm-error-internal-error-process-exited-while-connecting-to-mon
Asked 10 years, 11 months ago Modified 1 year, 3 months ago Viewed 61k times 6
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?
virtualizationkvm-virtualizationmigration
Share Improve this question Follow edited Feb 19, 2021 at 6:33 Zanna’s user avatar Zanna♦ 72.6k6060 gold badges227227 silver badges331331 bronze badges asked Dec 28, 2014 at 11:37 Programster’s user avatar Programster 6,0692020 gold badges6666 silver badges9494 bronze badges Add a comment 4 Answers Sorted by: 6
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. Share Improve this answer Follow edited May 25, 2018 at 9:01 Community’s user avatar CommunityBot 1 answered Dec 28, 2014 at 17:11 Programster’s user avatar Programster 6,0692020 gold badges6666 silver badges9494 bronze badges
Similar problem solved after adding these lines. Then run sudo virt-manager without any reboot its work. –
EsmaeelE
Commented Mar 8, 2020 at 3:04
Add a comment 5
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 Share Improve this answer Follow answered Aug 3, 2017 at 12:50 Lukas’s user avatar Lukas 5111 silver badge22 bronze badges Add a comment 0
Running QEMU with root privileges is not advised, as from version 6.0.0 it would not strip the Linux capabilities.
| In my case it was AppArmor. I wanted to add an SSDT file for a battery to the VM. There are some folders which AppArmor allows access to, and others (like /home/something) are just not allowed. /var/lib/libvirt/images/ is one of the allowed folders. Although i placed my file there, it was still not allowed by AppArmor policy (as can be seen with sudo cat /var/log/kern.log | grep -C 10 apparmor | grep -C 10 qemu). What worked was adding /var/lib/libvirt/images/SSDT1.dat rk in /etc/apparmor.d/libvirt/TEMPLATE.qemu like this: |
#
This profile is for the domain whose UUID matches this file.
#
#include <tunables/global>
profile LIBVIRT_TEMPLATE flags=(attach_disconnected) { #include <abstractions/libvirt-qemu> /var/lib/libvirt/images/SSDT1.dat rk, }
Share Improve this answer Follow answered Nov 17, 2020 at 13:20 Lyubomir’s user avatar Lyubomir 19111 silver badge99 bronze badges Add a comment 0
I have recently come across this error again. This time on a relatively new Ubuntu 24.04 reinstall. It has happened to me multiple times in the past with multiple distributions. This time, I got it when moving an SSD storage device from an AMD CPU server to an Intel CPU server. Note that ubuntu, was initially installed on the intel CPU server and was only moved due to an emergency.
More precisely, I got “error: internal error: process exited while connecting to monitor”, whenever creating or starting libvirt virtual machines with both virsh or virt-manager.
The fix was, reinstalling the libvirt-related packages that I had originally installed. I used the following commands without requiring a reboot:
apt install –reinstall qemu-kvm libvirt-daemon-system libvirt-daemon virtinst bridge-utils libosinfo-bin systemctl restart libvirtd
Note: the last few 2-3 in the above line are related to libvirt, but likely are not related to the error Note: the “apt” command printed “selecting ‘qemu-system-x86’ instead of ‘qemu-kvm’”