<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
LINE-HEIGHT: 1.5; FONT-FAMILY: ËÎÌå; COLOR: #000000; FONT-SIZE: 10.5pt
}
</STYLE>
<META name=GENERATOR content="MSHTML 8.00.6001.23415"></HEAD>
<BODY style="MARGIN: 10px">
<DIV style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">Hi
Friends,</DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"> </DIV>
<DIV style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">I am
investigate lxc now, and I hope to configure a physical NIC(network) into a
linux container, as the template "lxc-phys.conf" which in downloaded package,
but I got a error "lxc-execute: failed to move 'eth2' to the container : Invalid
argument" when I executed command by "lxc-execute", could anyone help me
for this?</DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"> </DIV>
<DIV style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">The OS is
CentOS6.3 on my PC, there is a NIC "eth2" plugged on it, and I create a
configuration file "./lxc.cfg" for starting physical NIC/network in LXC,
but it complain following error message.</DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"> </DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold">#
PC platform</DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">[root@DEV_1_A
brtest]# uname -a<BR>Linux DEV_1_A 2.6.32-358.6.2.el6.centos.plus.x86_64 #1 SMP
Thu May 16 17:43:34 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux</DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"> </DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold">#
NIC "eth2" on my PC</DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">[root@DEV_1_A
brtest]# ifconfig eth2<BR>eth2 Link
encap:Ethernet HWaddr 00:1B:21:D1:B5:51
<BR> inet6 addr:
fe80::21b:21ff:fed1:b551/64
Scope:Link<BR> UP
BROADCAST RUNNING MULTICAST MTU:1500
Metric:1<BR> RX
packets:22781478 errors:0 dropped:0 overruns:0
frame:0<BR> TX
packets:11388043 errors:0 dropped:0 overruns:0
carrier:0<BR> collisions:0
txqueuelen:1000 <BR> RX
bytes:34468071848 (32.1 GiB) TX bytes:751688768 (716.8
MiB)<BR>
Memory:fb400000-fb420000 </DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"> </DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold">#
./lxc.cfg </DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">lxc.utsname =
brtest<BR>lxc.pts = 1024</DIV>
<DIV> </DIV>
<DIV style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"># When
using LXC with apparmor, uncomment the next line to run
unconfined:<BR>#lxc.aa_profile = unconfined</DIV>
<DIV> </DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">lxc.network.type
= phys<BR>lxc.network.flags = up<BR>lxc.network.link = eth2<BR>lxc.network.name
= eth2<BR>lxc.network.hwaddr = 00:1B:21:D1:B5:51<BR>lxc.network.ipv4 =
10.16.1.2/24<BR>lxc.network.ipv4.gateway = 10.16.1.1</DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"> </DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt; FONT-WEIGHT: bold">#
Error when start lxc</DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">[root@DEV_1_A
brtest]# lxc-create -n brtest -f ./lxc.cfg <BR>'brtest' created<BR>[root@DEV_1_A
brtest]# lxc-execute -n brtest -f ./lxc.cfg /bin/bash<BR><SPAN
style="FONT-WEIGHT: bold">lxc-execute: failed to move 'eth2' to the container :
Invalid argument</SPAN><BR><SPAN style="FONT-WEIGHT: bold">lxc-execute: failed
to create the configured network</SPAN><BR><SPAN
style="FONT-WEIGHT: bold">lxc-execute: failed to spawn 'brtest'</SPAN></DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"> </DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"> </DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"> </DIV>
<DIV style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">Thanks
and Regards,</DIV>
<DIV
style="FONT-STYLE: normal; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">Haifeng</DIV>
<DIV style="FONT-FAMILY: Calibri"><FONT
style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt" size=1
face=""></FONT> </DIV></BODY></HTML>