Hello,
I am starting the system container without "/" directory So that it can
share the host /bin /sbin /lib and /lib64 and i have sepeartely mounted
/var, /etc and /usr directory for the container
Below is xml file
<domain type='lxc'>
<name>test6</name>
<memory>102400</memory>
<os>
<type>exe</type>
<init>/sbin/init</init>
</os>
<vcpu>1</vcpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<console type='pty'/>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lxc/test6/etc'/>
<target dir='/etc'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lxc/test6/var'/>
<target dir='/var'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lxc/test6/usr'/>
<target dir='/usr'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/pg_data/'/>
<target dir='/pg_data'/>
</filesystem>
<filesystem type='ram' accessmode='passthrough'>
<source usage='0' units='KiB'/>
<target dir='/dev/shm'/>
</filesystem>
<interface type='bridge'>
<source bridge='br0' />
</interface>
</devices>
</domain>
when i start the container it get start , but when i try to access console
it get stuck
virsh # list
Id Name State
----------------------------------------------------
18238 test4 running
20435 test6 running
virsh #
virsh # start test6
Domain test6 started
virsh # console test6
Connected to domain test6
Escape character is ^]
But when i mount the "/" in xml it works, i have also share host
/bin,/sbin, /lib and /lib64.
<domain type='lxc'>
<name>test4</name>
<memory>102400</memory>
<os>
<type>exe</type>
<init>/sbin/init</init>
</os>
<vcpu>1</vcpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<console type='pty'/>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lxc/test4/'/>
<target dir='/'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/bin'/>
<target dir='/bin'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/sbin'/>
<target dir='/sbin'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lib'/>
<target dir='/lib'/>
</filesystem>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/lib64'/>
<target dir='/lib64'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/pg_data/'/>
<target dir='/pg_data'/>
</filesystem>
<filesystem type='ram' accessmode='passthrough'>
<source usage='0' units='KiB'/>
<target dir='/dev/shm'/>
</filesystem>
<interface type='bridge'>
<source bridge='br0' />
</interface>
</devices>
</domain>
as i am new , can anyone explain me why my test6 container get stuck?
And in system container if we need to share host filesystem y we need to
mount them explicitly?
Thanks,
Aarti Sawant
NTTDATA OSS Center Pune