6

I'm using Linux Mint Debian Edition (Up. 8) when tryng to start a virtual machine from libvirt (either from commandline or using virt-manager to local qemu-kvm) I get this error when I use an image that is not loaded in the default datastore:

if I copy the same image (in this example an .iso file) to the /var/lib/libvirt/images folder it works.

I've tried to chown and chmod it to every possible owner and mode but it just won't work.

SELinux is not in place in this distro so I don't know where's the point, in logs I can see just permission denied and I'm quite stuck.

Impossibile completare l'installazione: 'internal error: process exited while connecting to monitor: qemu-system-x86_64: -drive file=/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso: Could not open '/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso': Permission denied
'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 96, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 1949, in do_install
    guest.start_install(False, meter=meter)
  File "/usr/lib/pymodules/python2.7/virtinst/Guest.py", line 1249, in start_install
    noboot)
  File "/usr/lib/pymodules/python2.7/virtinst/Guest.py", line 1317, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 2897, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error: process exited while connecting to monitor: qemu-system-x86_64: -drive file=/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso: Could not open '/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso': Permission denied

any clues?

  • Can the user qemu access the directory /home/penzo/Scaricati/? – Hauke Laging May 5 '14 at 10:27
  • apparently it was so 694M -rwxrwxr-x 1 libvirt-qemu libvirt-qemu 694M mag 5 11:30 elementaryos-stable-amd64.20130810.iso – penzoiders May 5 '14 at 10:37
  • I realized that I am using an encrypted home so maybe that woul have caused the issue, and also I tried to move to an external hard drive this file and have it read from kvm... no luck. but then I found the way to make it work: I have to define the mountpoint in /etc/fstab. once the storage is correctly mounted trough fstab the permissions work. Using a path that was mounted trough the nemo filemanager GUI in /media/[UUID]/path when using an encrypted home will override the perimissions to that path. – penzoiders May 5 '14 at 10:40
  • 1
    The ls -l output for the file does not say anything about the directory access unless you have run the command as user qemu (which you don't mention, though). – Hauke Laging May 5 '14 at 10:48
  • 1
    @HaukeLaging you're right, sorry. By the way i was looking at file level and it was a directory issue. thanks for spotting this out. – penzoiders May 5 '14 at 11:00
6

The user libvirt-qemu must be capable of accessing the directory /home/penzo/Scaricati/, not just the file within.

  • 1
    In the end I figured out thanks to @HuakeLaging suggestion about folders: anyway a little different for LMDE: the user or group that need to have access to files and folders for the images is libvirt-qemu another thing is that you can't have qemu-kvm to read contents of encrypted homes subfolders (also if the permissions are set right), and if you use another drive to host your images this cannot be mounted in the userspace (eg: trough nemo GUI) but must have a mountpoint set in /etc/fstab in order to have the access permissions applied in the right way. – penzoiders May 5 '14 at 13:32
  • @penzoiders I don't believe that there is a general encryption problem. That must have to do with the kind of encryption, probably FUSE-based. – Hauke Laging May 5 '14 at 13:47

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.