Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[resolved (sortof)] virt-manager - VMs won’t start anymore

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Kathar
Posts: 3
Joined: 2018-01-10 10:24

[resolved (sortof)] virt-manager - VMs won’t start anymore

#1 Post by Kathar »

Hi,

I used to have a working VM on my debian stretch. I have not run it for a few month, and now, when I am trying to run it, I am getting an error, which I am failing to correct.

I am using virt-manager, relying on qemu-kvm.

The error log is the following :
Error starting domain: internal error: process exited while connecting to monitor: 2018-01-11T16:06:58.194312Z qemu-system-x86_64: -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-3-win7/master-key.aes: Unable to read /var/lib/libvirt/qemu/domain-3-win7/master-key.aes: Failed to open file '/var/lib/libvirt/qemu/domain-3-win7/master-key.aes': Permission denied

Traceback (most recent call last):
File "/home/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/home/share/virt-manager/virtManager/asyncjob.py", line 125, in tmpcb
callback(*args, **kwargs)
File "/home/share/virt-manager/virtManager/libvirtobject.py", line 82, in newfn
ret = fn(self, *args, **kwargs)
File "/home/share/virt-manager/virtManager/domain.py", line 1505, in startup
self._backend.create()
File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1035, in create
if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error: process exited while connecting to monitor: 2018-01-11T16:06:58.194312Z qemu-system-x86_64: -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-3-win7/master-key.aes: Unable to read /var/lib/libvirt/qemu/domain-3-win7/master-key.aes: Failed to open file '/var/lib/libvirt/qemu/domain-3-win7/master-key.aes': Permission denied/var/lib/libvirt/qemu/domain-


Each time I try to re-run the VM, the number after domain in path /var/lib/libvirt/qemu/domain-3-win7/master-key.aes is incremented.
Directories /var/lib/libvirt/qemu/domain-* do not exist.

user/group libvirt-qemu has write access to /var/lib/libvirt/qemu, so it should be able to create the relevant directory when needed.
$ ls -lHd /var/lib/libvirt/qemu
drwxrwx--- 8 libvirt-qemu libvirt-qemu 4096 janv. 11 17:09 /var/lib/libvirt/qemu

$ dpkg -l libvirt0 libvirt-daemon python-libvirt virt-manager qemu-kvm
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=======================-================-================-====================================================
ii libvirt-daemon 3.0.0-4+deb9u1 amd64 Virtualization daemon
ii libvirt0 3.0.0-4+deb9u1 amd64 library for interfacing with different virtualizatio
ii python-libvirt 3.0.0-2 amd64 libvirt Python bindings
ii qemu-kvm 1:2.8+dfsg-6+deb amd64 QEMU Full virtualization on x86 hardware
ii virt-manager 1:1.4.3-1 all desktop application for managing virtual machines


Not much more information in /var/log/libvirt/qemu/win7.log :
2018-01-11 16:11:41.370+0000: starting up libvirt version: 3.0.0, package: 4+deb9u1 (Guido Günther <agx@sigxcpu.org> Mon, 16 Oct 2017 22:48:55 +0200), qemu version: 2.10.1(Debian 1:2.10.0+dfsg-2), hostname: valerian
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin QEMU_AUDIO_DRV=spice /usr/bin/qemu-system-x86_64 -name guest=win7,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-6-win7/master-key.aes -machine pc-i440fx-2.1,accel=kvm,usb=off,dump-guest-core=off -cpu SandyBridge,vme=on,dtes64=on,vmx=on,erms=on,xtpr=on,smep=on,pcid=on,est=on,monitor=on,smx=on,tm=on,acpi=on,osxsave=on,ht=on,pdcm=on,fsgsbase=on,f16c=on,ds=on,invtsc=on,tm2=on,ss=on,pbe=on,ds_cpl=on,rdrand=on -m 8192 -realtime mlock=off -smp 2,maxcpus=3,sockets=3,cores=1,threads=1 -uuid 151e670f-d42f-40c4-a425-0ba3b4a830c2 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-6-win7/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/var/lib/libvirt/images/mentor-win7.qcow2,format=qcow2,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x8,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive if=none,id=drive-ide0-0-1,readonly=on -device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=27 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:1d:9b:5f,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -spice port=5900,addr=127.0.0.1,disable-ticketing,seamless-migration=on -k en-us -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=2 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=3 -chardev spicevmc,id=charredir2,name=usbredir -device usb-redir,chardev=charredir2,id=redir2,bus=usb.0,port=4 -chardev spicevmc,id=charredir3,name=usbredir -device usb-redir,chardev=charredir3,id=redir3,bus=usb.0,port=5 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on
2018-01-11T16:11:41.391271Z qemu-system-x86_64: -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-6-win7/master-key.aes: Unable to read /var/lib/libvirt/qemu/domain-6-win7/master-key.aes: Failed to open file '/var/lib/libvirt/qemu/domain-6-win7/master-key.aes': Permission denied
2018-01-11 16:11:41.505+0000: shutting down, reason=failed


I have tried to create a new VM, but am having the same error.

Does anybody knows about this master-key.aes, and either how to disable it or have it created ?

Thank you for your help…
Last edited by Kathar on 2018-01-18 12:57, edited 1 time in total.

Kathar
Posts: 3
Joined: 2018-01-10 10:24

Re: virt-manager - VMs won’t start anymore

#2 Post by Kathar »

Hi again,

My virt-manager is still not working…

This is very annoying, I need to run my windows VM for work…

I tried removing all qemu, libvirt, virt-manager packages, backup and remove all configuration files (from /etc/libvirt and /var/lib/libvirt), and re-install virt-manager again.

I still cannot create a clean new VM.
Unable to complete install: 'internal error: process exited while connecting to monitor: pci.0,addr=0x4.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x4 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x4.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x4.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/home/libvirt/images/caljenkins-test.qcow2,format=qcow2,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/domain-2-debian8/org.qemu.guest_agent.0,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -chardev spicevmc,id=charchannel1,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redha'


What do I need to do to get back to a clean state ?!? Is virt-manager broken on the latest debian stable ?!?

Please help !

Kathar
Posts: 3
Joined: 2018-01-10 10:24

Re: virt-manager - VMs won’t start anymore

#3 Post by Kathar »

Ok, strangely, things got working again, but I am not sure what I did to make them work.

I know I got to a point where I was getting permission errors on access to kvm module.
I did a modprobe -r kvm_intel kvm && modprobe kvm_intel kvm, and now I can create VMs again, and I was even able to restore my backed up VMs…
I hope this persists across a reboot, we’ll see…

VM_Coder
Posts: 1
Joined: 2019-08-30 10:15

Re: [resolved (sortof)] virt-manager - VMs won’t start anymo

#4 Post by VM_Coder »

Hello, just in case someone is running into a similar problem:

I did mess around with the disk images in the "/var/lib/libvirt/images" pool and wanted to chown the dir and its content away from root to my local user_xyz:group_xyz.
BUT: I did as an error chown "/var/lib/libvirt/" instead of the "/var/lib/libvirt/images" ...

This as a result disabled the "libvirt-qemu" user to read and write from and to "/var/lib/libvirt/qemu/" causing exctly this descriped error:
error: internal error: process exited while connecting to monitor: 2019-08-30T10:54:01.156430Z qemu-system-x86_64: -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-69-win7_v3_41_02/master-key.aes: Unable to read /var/lib/libvirt/qemu/domain-69-win7_v3_41_02/master-key.aes: Failed to open file “/var/lib/libvirt/qemu/domain-69-win7_v3_41_02/master-key.aes”: Permission denied
I was unable to start any VM!

To resolve the problem I had to set back user:group of "/var/lib/libvirt/qemu/" to original by:

Code: Select all

$> sudo chown -R  libvirt-qemu:kvm /var/lib/libvirt/qemu/
This did solved the problems in my case

CwF
Global Moderator
Global Moderator
Posts: 2638
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: [resolved (sortof)] virt-manager - VMs won’t start anymo

#5 Post by CwF »

I say wrong approach...
Enable the user as a member of groups;
kvm libvirt libvirt-qemu

Post Reply