<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.6000.16809" name=GENERATOR>
<STYLE>@font-face {
        font-family: 宋体;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: @宋体;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; layout-grid: 15.6pt; }
P.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
LI.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
DIV.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-WEIGHT: normal; COLOR: windowtext; FONT-STYLE: normal; FONT-FAMILY: Verdana; TEXT-DECORATION: none; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
UNKNOWN {
        FONT-SIZE: 10pt
}
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>
</HEAD>
<BODY style="FONT-SIZE: 10pt; MARGIN: 10px; FONT-FAMILY: verdana">
<DIV><FONT face=Verdana color=#000080 size=2>Hi,All</FONT></DIV>
<DIV><FONT color=#000080></FONT> </DIV>
<DIV><FONT color=#000080>I've solve this problem by doing a </FONT></DIV>
<DIV>chcon --reference=/var/lib/libvirt/images /vm </DIV>
<DIV> </DIV>
<DIV>this solve selinux block kvm from accessing disk image outside of 
/var/lib/libvirt/images</DIV>
<DIV><FONT face=Verdana color=#000080 size=2></FONT> </DIV>
<DIV><FONT color=#000080>Thanks</FONT></DIV>
<DIV><FONT face=Verdana color=#000080 size=2></FONT> </DIV>
<DIV><FONT face=Verdana color=#c0c0c0 size=2>2009-12-09 </FONT></DIV><FONT 
face=Verdana color=#000080 size=2>
<HR style="WIDTH: 100px" align=left color=#b5c4df SIZE=1>
</FONT>
<DIV><FONT face=Verdana color=#c0c0c0 size=2><SPAN>rewing</SPAN> </FONT></DIV>
<HR color=#b5c4df SIZE=1>

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