[libvirt-users] libvirt_lxc and sysfs

pr.G gg at sbmg.ru
Sun Jun 9 12:14:48 UTC 2013


Hello.

Is it possible to start container via libvirt_lxc without mounting /sys
inside container?

When I start container via lxc-start and do not add mount point to config, 
then /sys inside container is empty.

When I do it via virsh -c lxc:// container.xml, then 
/sys contains sysfs of the host and /sys on host becomes remounting read-only.

Am I doing something wrong or is this feature of libvirt_lxc? 

Thanks.

root at host:~# uname -a
Linux host 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux

root at host:~# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 7.0 (wheezy)"
...

root at host:~# dpkg -l | grep libvirt
ii  libvirt-bin   0.9.12-11 amd64   programs for the libvirt library
ii  libvirt0      0.9.12-11 amd64   library for interfacing with different virtualization systems


container.xml:
<domain type='lxc'>
  <name>ns1</name>
  <memory>524288</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>
    <emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
    <filesystem type='mount'>
      <source dir='/var/lxc/ns1/rootfs'/>
      <target dir='/'/>
    </filesystem>
    <interface type='bridge'>
      <source bridge='br0'/>
      <mac address='52:54:00:de:74:06'/>
    </interface>
    <console type='pty' />
  </devices>
</domain>





More information about the libvirt-users mailing list