<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
text-indent:21.0pt;
font-size:10.5pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
/* Page Definitions */
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:661808973;
mso-list-type:hybrid;
mso-list-template-ids:-1861325586 -68098718 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:39.0pt;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-text:"%2\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:63.0pt;
text-indent:-21.0pt;}
@list l1
{mso-list-id:1290866008;
mso-list-type:hybrid;
mso-list-template-ids:-1810612024 -183881210 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:39.0pt;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple" style="text-justify-trim:punctuation">
<div class="Section1">
<p class="MsoNormal"><span lang="EN-US">Hi</span><span style="font-family:宋体">,</span><span lang="EN-US">all</span><span style="font-family:宋体">:</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> the problem came out when selinux was enforced in targeted+MCS<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> I start lxc through virsh</span><span style="font-family:宋体">——“</span><span lang="EN-US">virsh -c lxc:/// start instance-00004bd6</span><span style="font-family:宋体">”</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:-18.0pt;
mso-list:l0 level1 lfo1">
<![if !supportLists]><span lang="EN-US" style="color:#1F497D"><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US" style="color:#1F497D">When selinux is Permissive</span><span style="font-family:宋体;color:#1F497D">,</span><span lang="EN-US" style="color:#1F497D">lxc start is ok<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:42.0pt"><span lang="EN-US" style="color:#1F497D">The result of “Ps auxZ” is</span><span style="font-family:
宋体;color:#1F497D">:</span><span lang="EN-US" style="color:#1F497D"><o:p></o:p></span></p>
<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="margin-left:42.0pt;border-collapse:collapse;border:none">
<tbody>
<tr>
<td width="851" valign="top" style="width:638.0pt;border:solid black 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:virtd_lxc_t:s0-s0:c0.c1023 root 19218 0.0 0.0 47624 1244 ? Ss 15:26 0:00 /usr/libexec/libvirt_lxc --name<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 19219 0.3 0.0 19276 1532 ? Ss 15:26 0:00 /sbin/init<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 19406 0.0 0.0 177444 1332 ? Sl 15:26 0:00 /sbin/rsyslogd -i /var/run/sysl<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 19420 0.0 0.0 64120 1144 ? Ss 15:26 0:00 /usr/sbin/sshd<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 19427 0.0 0.0 22136 956 ? Ss 15:26 0:00 xinetd -stayalive -pidfile /var<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 19434 0.0 0.0 64316 832 ? Ss 15:26 0:00 /usr/sbin/saslauthd -m /var/run<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 19435 0.0 0.0 64316 600 ? S 15:26 0:00 /usr/sbin/saslauthd -m /var/run<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 19450 0.0 0.0 82388 2392 ? Ss 15:26 0:00 sendmail: rejecting new message<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 51 19459 0.0 0.0 78116 2016 ? Ss 15:26 0:00 sendmail: Queue runner@01:00:00<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 19467 0.0 0.0 175528 3672 ? Ss 15:26 0:00 /usr/sbin/httpd<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 48 19470 0.0 0.0 175528 2204 ? S 15:26 0:00 /usr/sbin/httpd<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 19475 0.0 0.0 117212 1348 ? Ss 15:26 0:00 crond<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 19491 0.0 0.0 4108 600 pts/0 Ss+ 15:26 0:00 /sbin/mingetty /dev/tty1<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-left:42.0pt"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:42.0pt"><span lang="EN-US" style="color:#1F497D">We can get into the lxc through “ssh”<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:42.0pt"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:-18.0pt;
mso-list:l0 level1 lfo1">
<![if !supportLists]><span lang="EN-US" style="color:#1F497D"><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US" style="color:#1F497D">When selinux is Enforcing</span><span style="font-family:宋体;color:#1F497D">,</span><span lang="EN-US" style="color:#1F497D">lxc start bad<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:42.0pt"><span lang="EN-US" style="color:#1F497D">Th result of “ps auxZ” is:<o:p></o:p></span></p>
<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="margin-left:42.0pt;border-collapse:collapse;border:none">
<tbody>
<tr>
<td width="803" valign="top" style="width:602.6pt;border:solid black 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:virtd_lxc_t:s0-s0:c0.c1023 root 20624 0.0 0.0 47624 1244 ? Ss 15:29 0:00 /usr/libexec/libvirt_lxc --name<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">system_u:system_r:svirt_lxc_net_t:s0:c192,c392 root 20625 0.0 0.0 17172 1036 pts/0 Ss+ 15:29 0:00 /sbin/init<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-left:42.0pt"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> Only /sbin/init process started,
<b>no else.</b> This is the real problem<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> There is avc error messages in dmesg</span><span style="font-family:宋体;color:#1F497D">、</span><span lang="EN-US" style="color:#1F497D">/var/log/messages</span><span style="font-family:宋体;color:#1F497D">、</span><span lang="EN-US" style="color:
#1F497D">/var/log/secure,
and the same with selinux is Permissive<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:42.0pt"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> Can anybody give some hints?<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:42.0pt"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:0cm"><span lang="EN-US" style="color:#1F497D">Here are some system information:<o:p></o:p></span></p>
<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="margin-left:39.0pt;border-collapse:collapse;border:none">
<tbody>
<tr>
<td width="295" valign="top" style="width:221.4pt;border:solid black 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoListParagraph" style="text-indent:0cm"><span lang="EN-US" style="color:#1F497D">Kernel version<o:p></o:p></span></p>
</td>
<td width="295" valign="top" style="width:221.4pt;border:solid black 1.0pt;
border-left:none;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoListParagraph" style="text-indent:0cm"><span lang="EN-US" style="color:#1F497D">3.3.4<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="295" valign="top" style="width:221.4pt;border:solid black 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoListParagraph" style="text-indent:0cm"><span lang="EN-US" style="color:#1F497D">Libvirt version<o:p></o:p></span></p>
</td>
<td width="295" valign="top" style="width:221.4pt;border-top:none;border-left:
none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoListParagraph" style="text-indent:0cm"><span lang="EN-US" style="color:#1F497D">0.9.13<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="295" valign="top" style="width:221.4pt;border:solid black 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoListParagraph" style="text-indent:0cm"><span lang="EN-US" style="color:#1F497D">Lxc guest image<o:p></o:p></span></p>
</td>
<td width="295" valign="top" style="width:221.4pt;border-top:none;border-left:
none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoListParagraph" style="text-indent:0cm"><span lang="EN-US" style="color:#1F497D">Centos 6.3<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:0cm"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:0cm"><span lang="EN-US" style="color:#1F497D">Lxc xml info is:<o:p></o:p></span></p>
<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="margin-left:39.0pt;border-collapse:collapse;border:none">
<tbody>
<tr>
<td width="590" valign="top" style="width:442.8pt;border:solid black 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"><!--<o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D">WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
<o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D">OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:<o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> virsh edit instance-00004bd6<o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D">or other application using the libvirt API.<o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D">--><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"><domain type='lxc'><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <name>instance-00004bd6</name><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <uuid>96eada0e-7ea0-4865-8271-3565811c8eb0</uuid><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <memory unit='KiB'>524288</memory><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <currentMemory unit='KiB'>524288</currentMemory><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <vcpu placement='static'>1</vcpu><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <os><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <type arch='x86_64'>exe</type><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <init>/sbin/init</init><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <cmdline>console=ttyS0</cmdline><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> </os><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <clock offset='utc'/><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <on_poweroff>destroy</on_poweroff><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <on_reboot>restart</on_reboot><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <on_crash>destroy</on_crash><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <devices><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <emulator>/usr/libexec/libvirt_lxc</emulator><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <filesystem type='mount' accessmode='passthrough'><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <source dir='/home/stack/nova_state/instances/instance-00004bd6/rootfs'/><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <target dir='/'/><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> </filesystem><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <interface type='bridge'><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <mac address='fa:16:3e:09:00:a2'/><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <source bridge='br100'/><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <filterref filter='nova-instance-instance-00004bd6-fa163e0900a2'><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <parameter name='DHCPSERVER' value='10.0.0.1'/><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <parameter name='IP' value='10.0.0.11'/><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <parameter name='PROJMASK' value='255.255.254.0'/><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <parameter name='PROJNET' value='10.0.0.0'/><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> </filterref><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> </interface><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <console type='pty'><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <target type='lxc' port='0'/><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> </console><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> </devices><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <seclabel type='static' model='selinux' relabel='yes'><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> <label>system_u:system_r:svirt_lxc_net_t:s0:c192,c392</label><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"> </seclabel><o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:0cm"><span lang="EN-US" style="color:#1F497D"></domain><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:0cm"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Best Regard<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Huangchaochang<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>