<div dir="ltr">Thanks Daniel for suggestion, i have made changes in my xml script.<div>I am able to set up lxc container on fedora 18</div><div>i created a container using yum</div><div><br></div><div>yum --installroot=/containers/cont1 --releasever=18 install -y httpd openssh, bridge-utils, dhclient</div>

<div><br></div><div>cont1.xml</div><div><div><domain type="lxc"></div><div>  <name>cont1</name></div><div>  <vcpu placement="static">1</vcpu></div><div>  <cputune></div>

<div>    <shares>1024</shares></div><div>    <period>1000000</period></div><div>  </cputune></div><div>  <memtune></div><div>    <hard_limit unit="M">256</hard_limit></div>

<div>    <soft_limit unit="M">32</soft_limit></div><div>    <min_guarantee unit="M">64</min_guarantee></div><div>  </memtune></div><div>  <blkiotune></div><div>    <weight>800</weight></div>

<div>  </blkiotune></div><div>  <memory unit="KiB">102400</memory></div><div>  <os></div><div>    <type>exe</type></div><div>    <init>/bin/lxc_defaultinit.sh</init></div>

<div>  </os></div><div>  <clock offset="utc"/></div><div>  <on_poweroff>destroy</on_poweroff></div><div>  <on_reboot>restart</on_reboot></div><div>  <on_crash>destroy</on_crash></div>

<div>  <devices></div><div>    <emulator>/usr/libexec/libvirt_lxc</emulator></div><div>    <filesystem accessmode="passthrough" type="mount"></div><div>      <source dir="/containers/cont1/"/></div>

<div>      <target dir="/"/></div><div>    </filesystem></div><div>    <interface type="bridge"></div><div>      <source bridge="br0"/></div><div>    </interface></div>

<div>    <console port="0" type="pty"/></div><div>  </devices></div><div></domain></div></div><div><br></div><div>Network setting at host</div><div>/etc/sysconfig/network-script/ifcfg-p2p1</div>
<div><div>TYPE="Ethernet"</div>
<div>DEVICE="p2p1"</div><div>BOOTPROTO="dhcp"</div><div>ONBOOT="yes"</div><div>BRIDGE="br0"</div><div>NM_CONTROLLED="no"</div></div><div><br></div><div>/etc/sysconfig/network-script/ifcfg-br0</div>
<div><div>DEVICE="br0"</div><div>TYPE="Bridge"</div><div>USERCTL="no"</div><div>ONBOOT="yes"</div><div>BOOTPROTO="dhcp"</div><div>NM_CONTROLLED="no"</div></div><div>
<br></div><div>Network setting at Guest<br></div><div>/containers/cont1/etc/sysconfig/network-script/ifcfg-eth0</div><div><div>TYPE="Ethernet"</div><div>DEVICE="eth0"</div><div>BOOTPROTO="static"</div>
<div>ONBOOT="yes"</div><div>GATEWAY=172.26.126.254</div><div>IPADDR=172.26.126.204</div></div><div><br>
</div><div>at host</div><div>/etc/fstab</div><div><div>tmpfs                   /dev/shm                tmpfs   defaults        0 0</div><div>devpts                  /dev/pts                devpts  defaults        0 0</div>
<div>sysfs                   /sys                    sysfs   defaults        0 0</div><div>proc                    /proc                   proc    defaults        0 0</div><div>none                   /sys/fs/cgroup           cgroup defaults       0 0</div>
</div><div><br></div><div>at guest</div><div>/containers/bin/lxc-defaultinit.sh</div><div><div>#!/bin/bash</div><div>export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/lib</div><div>export PS1="[\u@\h \W]\$ "</div>
<div>export HOME="/root"</div><div>mount -t devtmpfs none /dev</div><div>mount -t devpts none /dev/pts</div><div>mount -t tmpfs none /dev/shm</div><div><br></div><div>mount -t sysfs none /sys</div><div>/etc/init.d/network start</div>
<div>exec /bin/bash</div></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 31, 2013 at 3:03 PM, Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Jul 31, 2013 at 12:46:58PM +0530, Aarti Sawant wrote:<br>
> hello,<br>
><br>
> i am new to lxc, i have created a lxc container on fedora 19<br>
> i created a container rootfs of fedora 19 by using<br>
> yum --installroot=/containers/test1 --releasever=19 install openssh<br>
><br>
> test1.xml file for container test1<br>
> <domain type="lxc"><br>
>   <name>test1</name><br>
>   <vcpu placement="static">1</vcpu><br>
>   <cputune><br>
>     <shares>1024</shares><br>
>     <period>1000000</period><br>
>   </cputune><br>
>   <memtune><br>
>     <hard_limit unit="M">1024</hard_limit><br>
>     <soft_limit unit="M">128</soft_limit><br>
>     <min_guarantee unit="M">64</min_guarantee><br>
>   </memtune><br>
>   <blkiotune><br>
>     <weight>800</weight><br>
>   </blkiotune><br>
>   <memory unit="KiB">102400</memory><br>
>   <os><br>
>     <type>exe</type><br>
>     <init>/bin/bash</init><br>
>   </os><br>
>   <clock offset="utc"/><br>
>   <on_poweroff>destroy</on_poweroff><br>
>   <on_reboot>restart</on_reboot><br>
>   <on_crash>destroy</on_crash><br>
>   <devices><br>
>     <emulator>/usr/libexec/libvirt_lxc</emulator><br>
>     <filesystem accessmode="passthrough" type="mount"><br>
>       <source dir="/containers/test1/"/><br>
>       <target dir="/"/><br>
>     </filesystem><br>
<br>
>     <filesystem accessmode="passthrough" type="mount"><br>
>       <source dir="/containers/test1/var"/><br>
>       <target dir="/var"/><br>
>     </filesystem><br>
</div></div>....snip more <filesystem> elements...<br>
<br>
Why are you adding all these sub-mounts for /var, /dev, etc, etc?<br>
<br>
You installed the entire OS tree into /containers/test1, so it<br>
should be sufficient to just have that first <filesystem><br>
entry for '/'.  You'd only want to add extra mounts for<br>
/var, etc if the directory on the host came from somewhere<br>
outside the /containers/test1 location.<br>
<br>
NB, also libvirt sets up /dev - you shouldn't try to<br>
override it, or you'll loose access to the pre-populate<br>
device nodes, which is probably what's causing your<br>
failure.<br>
<div class="HOEnZb"><div class="h5"><br>
>     <interface type="bridge"><br>
>       <source bridge="br0"/><br>
>     </interface><br>
>     <console port="0" type="pty"/><br>
>   </devices><br>
> </domain><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">Daniel<br>
--<br>
|: <a href="http://berrange.com" target="_blank">http://berrange.com</a>      -o-    <a href="http://www.flickr.com/photos/dberrange/" target="_blank">http://www.flickr.com/photos/dberrange/</a> :|<br>
|: <a href="http://libvirt.org" target="_blank">http://libvirt.org</a>              -o-             <a href="http://virt-manager.org" target="_blank">http://virt-manager.org</a> :|<br>
|: <a href="http://autobuild.org" target="_blank">http://autobuild.org</a>       -o-         <a href="http://search.cpan.org/~danberr/" target="_blank">http://search.cpan.org/~danberr/</a> :|<br>
|: <a href="http://entangle-photo.org" target="_blank">http://entangle-photo.org</a>       -o-       <a href="http://live.gnome.org/gtk-vnc" target="_blank">http://live.gnome.org/gtk-vnc</a> :|<br>
</font></span></blockquote></div><br></div>