[libvirt-users] Permission denied

Daniel P. Berrange berrange at redhat.com
Tue Jun 25 20:06:01 UTC 2013


On Tue, Jun 25, 2013 at 09:37:06PM +0200, Roland Giesler wrote:
> On Tue, Jun 25, 2013 at 7:07 PM, Daniel P. Berrange <berrange at redhat.com>wrote:
> 
> > On Tue, Jun 25, 2013 at 07:02:40PM +0200, Roland Giesler wrote:
> > > 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
> >
> > You're using 'qemu:///system' here which is a privileged instance
> > of libvirt, where the QEMU process runs as a dedicated user ID.
> >
> > >     <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>
> >
> > Here you're putting the disk in /home/roland, and I'm guessing
> > that /home/roload is mode  -rwx-------, which will prevent the
> > QEMU user ID from accessing the disk.
> >
> 
> > When using qemu:///system, it is recommended to use
> > /var/lib/libvirt/images as the disk storage location.
> >
> 
> I have done that now, but still have the same problem.
> 
> $ ls -la
> total 15899728
> drwxrwxrwx 2 root root       4096 Jun 25 21:28 .
> drwx--x--x 3 root root       4096 Jun 25 21:13 ..
> -rwxrwxrwx 1 root root    1474560 Jun 24 20:00 floppy_disk_image
> -rwxrwxrwx 1 root root 1073741824 Jun 24 20:27 WinXPPro-c21a8baf.vmem
> -rwxrwxrwx 1 root root  135507536 Jun 24 20:12 WinXPPro-c21a8baf.vmss
> -rwxrwxrwx 1 root root       8684 Jun 24 20:18 WinXPPro.nvram
> -rwxrwxrwx 1 root root 2145255424 Jun 24 20:12 WinXPPro-s001.vmdk
> -rwxrwxrwx 1 root root 2146238464 Jun 24 20:33 WinXPPro-s002.vmdk
> -rwxrwxrwx 1 root root 2146631680 Jun 24 20:25 WinXPPro-s003.vmdk
> -rwxrwxrwx 1 root root    3211264 Jun 24 20:12 WinXPPro-s004.vmdk
> -rwxrwxrwx 1 root root 2106261504 Jun 24 20:18 WinXPPro-s005.vmdk
> -rwxrwxrwx 1 root root 2146697216 Jun 24 20:00 WinXPPro-s006.vmdk
> -rwxrwxrwx 1 root root    2162688 Jun 24 20:27 WinXPPro-s007.vmdk
> -rwxrwxrwx 1 root root 2146107392 Jun 24 20:06 WinXPPro-s008.vmdk
> -rwxrwxrwx 1 root root 2099511296 Jun 24 19:58 WinXPPro-s009.vmdk
> -rwxrwxrwx 1 root root  128446464 Jun 24 20:19 WinXPPro-s010.vmdk
> -rwxrwxrwx 1 root root        857 Jun 25 15:54 WinXPPro.vmdk
> -rwxrwxrwx 1 root root          0 Jun 24 20:12 WinXPPro.vmsd
> -rwxrwxrwx 1 root root       4208 Jun 25 21:20 WinXPPro.vmx
> -rwxrwxrwx 1 root root       2932 Jun 25 15:57 WinXPPro.vmxf
> -rwxrwxrwx 1 root root        876 Jun 25 21:28 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=/var/lib/libvirt/images/WinXPPro/WinXPPro.vmdk,if=none,id=drive-ide0-0-0,format=vmdk:
> could not open disk image /var/lib/libvirt/images/WinXPPro/WinXPPro.vmdk:
> Permission denied
> 
> Changing the user and group makes no difference:
> 
> $ sudo chown libvirt-qemu:kvm *
> roland at Matt-HP:/var/lib/libvirt/images/WinXPPro$ ls -la
> total 15899728
> drwxrwxrwx 2 root         root       4096 Jun 25 21:28 .
> drwx--x--x 3 root         root       4096 Jun 25 21:13 ..
> -rwxrwxrwx 1 libvirt-qemu kvm     1474560 Jun 24 20:00 floppy_disk_image
> -rwxrwxrwx 1 libvirt-qemu kvm  1073741824 Jun 24 20:27
> WinXPPro-c21a8baf.vmem
> -rwxrwxrwx 1 libvirt-qemu kvm   135507536 Jun 24 20:12
> WinXPPro-c21a8baf.vmss
> -rwxrwxrwx 1 libvirt-qemu kvm        8684 Jun 24 20:18 WinXPPro.nvram
> -rwxrwxrwx 1 libvirt-qemu kvm  2145255424 Jun 24 20:12 WinXPPro-s001.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm  2146238464 Jun 24 20:33 WinXPPro-s002.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm  2146631680 Jun 24 20:25 WinXPPro-s003.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm     3211264 Jun 24 20:12 WinXPPro-s004.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm  2106261504 Jun 24 20:18 WinXPPro-s005.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm  2146697216 Jun 24 20:00 WinXPPro-s006.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm     2162688 Jun 24 20:27 WinXPPro-s007.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm  2146107392 Jun 24 20:06 WinXPPro-s008.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm  2099511296 Jun 24 19:58 WinXPPro-s009.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm   128446464 Jun 24 20:19 WinXPPro-s010.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm         857 Jun 25 15:54 WinXPPro.vmdk
> -rwxrwxrwx 1 libvirt-qemu kvm           0 Jun 24 20:12 WinXPPro.vmsd
> -rwxrwxrwx 1 libvirt-qemu kvm        4208 Jun 25 21:20 WinXPPro.vmx
> -rwxrwxrwx 1 libvirt-qemu kvm        2932 Jun 25 15:57 WinXPPro.vmxf
> -rwxrwxrwx 1 libvirt-qemu kvm         876 Jun 25 21:28 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=/var/lib/libvirt/images/WinXPPro/WinXPPro.vmdk,if=none,id=drive-ide0-0-0,format=vmdk:
> could not open disk image /var/lib/libvirt/images/WinXPPro/WinXPPro.vmdk:
> Permission denied


If you manually run

   qemu-system-i386 -hda /var/lib/libvirt/images/WinXPPro/WinXPPro.vmdk

does it work ?


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvirt-users mailing list