Correctly using libvirt to mount /dev/pts and /dev in an lxc application container

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We would like to mount /dev and /dev/pts correctly using the libvirt xml
config file instead of doing a bind mount in a container init script we use.

Currently the container config is:

<domain type='lxc'>
  <name>CentOS_57</name>
  <uuid>ff5d3c04-49e6-a3cc-0a14-ff13625eca3c</uuid>
  <memory>262144</memory>
  <currentMemory>262144</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686'>exe</type>
    <init>/bin/lxc-progs</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/libvirt_lxc</emulator>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='//home'/>
      <target dir='/home'/>
    </filesystem>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/archive/centos57-root'/>
      <target dir='/'/>
    </filesystem>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='//archive'/>
      <target dir='/archive'/>
    </filesystem>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
  </devices>
</domain>


The /bin/lxc-progs file is:

#!/bin/sh

service rsyslog start
service sssd start
service sshd start
mount -t devtmpfs none /dev
mount -t devpts none /dev/pts
mount -t tmpfs none /dev/shm
exec /bin/sh

Basically how do we remove the above mount points in the lxc init
process and use libvirt to control the mounts instead?

Any help would be appreciated.  Thank you.

-- 
David W. Jablonski
Systems Administrator
INOC
608.204.0202
608.663.4555
djablonski@xxxxxxxx
www.inoc.com

*** DELIVERING UPTIME ***


[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux