[libvirt-users] Permission denied

Roland Giesler roland at giesler.za.net
Tue Jun 25 17:02:40 UTC 2013


System:
$ cat /etc/issue
Ubuntu 12.10 \n \l

$ uname -a
Linux Matt-HP 3.5.0-34-generic #55-Ubuntu SMP Thu Jun 6 20:20:19 UTC 2013
i686 i686 i686 GNU/Linux


I have a converted VMWare virtual machine which I converted by using:

$ vmware2libvirt -f ./WinXPPro.vmx > WinXPPro.xml
$ virsh -c qemu:///system define WinXPPro.xml

After various efforts to start the machine, I changed some of the setting
(as advised by the error messages I got).  My changes were:

<domain type='kvm'> to <domain type='qemu'>
and
<emulator>/usr/bin/kvm</emulator> to
<emulator>/usr/bin/qemu-system-i386</emulator>
and
whatever it was before (i guess type 'raw') to <driver name='qemu'
type='vmdk'/>

Now "virsh edit WinXPPro" gives me:

<domain type='qemu'>
  <name>WinXPPro</name>
  <uuid>8f83332d-d1c7-4ca9-a171-48823aeb30a8</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='i686' machine='pc-1.2'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-i386</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='vmdk'/>
      <source file='/home/roland/WinXPPro/WinXPPro.vmdk'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x2'/>
    </controller>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='00:0c:29:1e:37:c4'/>
      <source network='default'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04'
function='0x0'/>
    </memballoon>
  </devices>
</domain>

When I got the "permission denied" error, I found advice to change the user
to libvirt-qemu and the group to kvm.  Both exist on my system.

$ ls -la
total 15899728
drwxrwxr-x  2 roland       roland       4096 Jun 25 16:05 .
drwxr-xr-x 92 roland       roland       4096 Jun 25 18:15 ..
-rw-------  1 libvirt-qemu kvm       1474560 Jun 24 20:00 floppy_disk_image
-rw------x  1 libvirt-qemu kvm    1073741824 Jun 24 20:27
WinXPPro-c21a8baf.vmem
-rw------x  1 libvirt-qemu kvm     135507536 Jun 24 20:12
WinXPPro-c21a8baf.vmss
-rw----r-x  1 libvirt-qemu kvm          8684 Jun 24 20:18 WinXPPro.nvram
-rw----r-x  1 libvirt-qemu kvm    2145255424 Jun 24 20:12 WinXPPro-s001.vmdk
-rw----r-x  1 libvirt-qemu kvm    2146238464 Jun 24 20:33 WinXPPro-s002.vmdk
-rw----r-x  1 libvirt-qemu kvm    2146631680 Jun 24 20:25 WinXPPro-s003.vmdk
-rw----r-x  1 libvirt-qemu kvm       3211264 Jun 24 20:12 WinXPPro-s004.vmdk
-rw----r-x  1 libvirt-qemu kvm    2106261504 Jun 24 20:18 WinXPPro-s005.vmdk
-rw----r-x  1 libvirt-qemu kvm    2146697216 Jun 24 20:00 WinXPPro-s006.vmdk
-rw----r-x  1 libvirt-qemu kvm       2162688 Jun 24 20:27 WinXPPro-s007.vmdk
-rw----r-x  1 libvirt-qemu kvm    2146107392 Jun 24 20:06 WinXPPro-s008.vmdk
-rw----r-x  1 libvirt-qemu kvm    2099511296 Jun 24 19:58 WinXPPro-s009.vmdk
-rw-rw-r-x  1 libvirt-qemu kvm     128446464 Jun 24 20:19 WinXPPro-s010.vmdk
-rw----r-x  1 libvirt-qemu kvm           857 Jun 25 15:54 WinXPPro.vmdk
-rw-r--r-x  1 libvirt-qemu kvm             0 Jun 24 20:12 WinXPPro.vmsd
-rwxr-xr-x  1 libvirt-qemu kvm          4209 Jun 25 15:56 WinXPPro.vmx
-rw-r--r-x  1 libvirt-qemu kvm          2932 Jun 25 15:57 WinXPPro.vmxf
-rw-rw-r-x  1 libvirt-qemu kvm           852 Jun 25 16:05 WinXPPro.xml

$ virsh start WinXPPro
error: Failed to start domain WinXPPro
error: internal error process exited while connecting to monitor:
qemu-system-i386: -drive
file=/home/roland/WinXPPro/WinXPPro.vmdk,if=none,id=drive-ide0-0-0,format=vmdk:
could not open disk image /home/roland/WinXPPro/WinXPPro.vmdk: Permission
denied

However, despite not using "sudo" and running the command as me, the
WinXPPro.vmdk file is now owned by root, so I get the complaint that the
file cannot be accessed.  If I sudo the command, it gives me the exact same
result.

$ ls -la
total 15899728
drwxrwxr-x  2 roland       roland       4096 Jun 25 16:05 .
drwxr-xr-x 92 roland       roland       4096 Jun 25 18:15 ..
-rw-------  1 libvirt-qemu kvm       1474560 Jun 24 20:00 floppy_disk_image
-rw------x  1 libvirt-qemu kvm    1073741824 Jun 24 20:27
WinXPPro-c21a8baf.vmem
-rw------x  1 libvirt-qemu kvm     135507536 Jun 24 20:12
WinXPPro-c21a8baf.vmss
-rw----r-x  1 libvirt-qemu kvm          8684 Jun 24 20:18 WinXPPro.nvram
-rw----r-x  1 libvirt-qemu kvm    2145255424 Jun 24 20:12 WinXPPro-s001.vmdk
-rw----r-x  1 libvirt-qemu kvm    2146238464 Jun 24 20:33 WinXPPro-s002.vmdk
-rw----r-x  1 libvirt-qemu kvm    2146631680 Jun 24 20:25 WinXPPro-s003.vmdk
-rw----r-x  1 libvirt-qemu kvm       3211264 Jun 24 20:12 WinXPPro-s004.vmdk
-rw----r-x  1 libvirt-qemu kvm    2106261504 Jun 24 20:18 WinXPPro-s005.vmdk
-rw----r-x  1 libvirt-qemu kvm    2146697216 Jun 24 20:00 WinXPPro-s006.vmdk
-rw----r-x  1 libvirt-qemu kvm       2162688 Jun 24 20:27 WinXPPro-s007.vmdk
-rw----r-x  1 libvirt-qemu kvm    2146107392 Jun 24 20:06 WinXPPro-s008.vmdk
-rw----r-x  1 libvirt-qemu kvm    2099511296 Jun 24 19:58 WinXPPro-s009.vmdk
-rw-rw-r-x  1 libvirt-qemu kvm     128446464 Jun 24 20:19 WinXPPro-s010.vmdk
-rw----r-x  1 root         root          857 Jun 25 15:54 WinXPPro.vmdk
-rw-r--r-x  1 libvirt-qemu kvm             0 Jun 24 20:12 WinXPPro.vmsd
-rwxr-xr-x  1 libvirt-qemu kvm          4209 Jun 25 15:56 WinXPPro.vmx
-rw-r--r-x  1 libvirt-qemu kvm          2932 Jun 25 15:57 WinXPPro.vmxf
-rw-rw-r-x  1 libvirt-qemu kvm           852 Jun 25 16:05 WinXPPro.xml
roland at Matt-HP:~/WinXPPro$

What is going on here?

Roland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20130625/1dd07095/attachment.htm>


More information about the libvirt-users mailing list