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@Matt-HP:~/WinXPPro$
What is going on here?
Roland
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.xmlYou'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. If you really want to use /home/roland, then make sure it has go+x permission bit set. 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 :|
On Tue, Jun 25, 2013 at 7:07 PM, Daniel P. Berrange <berrange@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@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 Any other ideas or suggestion to get this to work? regards Roland