Hi,All

I've solve this problem by doing a 
chcon --reference=/var/lib/libvirt/images /vm 

this solve selinux block kvm from accessing disk image outside of 
/var/lib/libvirt/images

Thanks

2009-12-09 



rewing 



发件人: centos-virt-request 
发送时间: 2009-12-09  00:57:19 
收件人: centos-virt 
抄送: 
主题: CentOS-virt Digest, Vol 28, Issue 9 
 
Send CentOS-virt mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.centos.org/mailman/listinfo/centos-virt
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of CentOS-virt digest..."
Today's Topics:
   1. virt-install failed while install windows2003 guest (rewing)
   2. Re: virt-install failed while install windows2003 guest
      (Markus Falb)
   3. Re: virt-install failed while install windows2003 guest
      (Tait Clarridge)
----------------------------------------------------------------------
Message: 1
Date: Tue, 8 Dec 2009 16:58:56 +0800
From: "rewing" <[email protected]>
Subject: [CentOS-virt] virt-install failed while install windows2003
guest
To: "centos-virt" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
Here's the procedure:
# qemu-img -f qcow2 /vm/win2k3.img 8G
# virt-install --connect qemu:///system -n win2k3 -r 512 --vcpus=1 -c 
/home/temp/win2003sp2ins.iso -f /vm/win2k3.img -s 4
--network=bridge:br0 --mac=00:ff:ff:ff:58:58 --noautoconsole --vnc 
--os-type=windows --os-variant=win2k3 --hvm --accelerate
And I get error as below:
Starting install...
internal error unable to start guest: qemu: could not open disk image 
/vm/win2k3.img
Domain installation may not have been
 successful.  If it was, you can restart your domain
 by running 'virsh start win2k3'; otherwise, please
 restart your installation.
ERROR    internal error unable to start guest: qemu: could not open disk image 
/vm/win2k3.img
Traceback (most recent call last):
  File "/usr/sbin/virt-install", line 861, in ?
    main()
  File "/usr/sbin/virt-install", line 759, in main
    start_time, guest.start_install)
  File "/usr/sbin/virt-install", line 814, in do_install
    dom = install_func(conscb, progresscb, wait=(not wait))
  File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 541, in 
start_install
    return self._do_install(consolecb, meter, removeOld, wait)
  File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 633, in 
_do_install
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib64/python2.4/site-packages/libvirt.py", line 974, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', 
conn=self)
libvirtError: internal error unable to start guest: qemu: could not open disk 
image /vm/win2k3.img
any idea?
2009-12-08 
rewing 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://lists.centos.org/pipermail/centos-virt/attachments/20091208/55c24500/attachment-0001.html
 
------------------------------
Message: 2
Date: Tue, 8 Dec 2009 12:41:34 +0100
From: Markus Falb <[email protected]>
Subject: Re: [CentOS-virt] virt-install failed while install
windows2003 guest
To: Discussion about the virtualization on CentOS
<[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
On 8 Dec 2009, at 09:58, rewing wrote:
> libvirtError: internal error unable to start guest: qemu: could not  
> open disk image /vm/win2k3.img
Do you have selinux enabled ? As far as I know the location for images  
is restricted to /var/lib/libvirt/images by default.
-- 
Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://lists.centos.org/pipermail/centos-virt/attachments/20091208/ac8640d6/attachment-0001.html
 
------------------------------
Message: 3
Date: Tue, 08 Dec 2009 09:11:02 -0500
From: Tait Clarridge <[email protected]>
Subject: Re: [CentOS-virt] virt-install failed while install
windows2003 guest
To: Discussion about the virtualization on CentOS
<[email protected]>
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
On Tue, 2009-12-08 at 12:41 +0100, Markus Falb wrote:
> 
> On 8 Dec 2009, at 09:58, rewing wrote:
> > libvirtError: internal error unable to start guest: qemu: could not open 
> > disk image /vm/win2k3.img
> 
> 
> Do you have selinux enabled ? As far as I know the location for images
> is restricted to /var/lib/libvirt/images by default.
> 
> -- 
Or does the actual disk image exist at /vm/win2k3.img with r/w access to
whoever is running the virt-install command?
Does the /vm directory exist and does the user have permissions to
access it?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : 
http://lists.centos.org/pipermail/centos-virt/attachments/20091208/79487930/attachment-0001.bin
 
------------------------------
_______________________________________________
CentOS-virt mailing list
[email protected]
http://lists.centos.org/mailman/listinfo/centos-virt
End of CentOS-virt Digest, Vol 28, Issue 9
******************************************
_______________________________________________
CentOS-virt mailing list
[email protected]
http://lists.centos.org/mailman/listinfo/centos-virt

Reply via email to