libvirt
environment variables
"init" 會獲得以下 variables
LIBVIRT_LXC_NAME
LIBVIRT_LXC_UUID
LIBVIRT_LXC_CMDLINE
virsh --connect lxc:/// define v1.xml
virsh --connect lxc:/// start vm1
virsh --connect lxc:/// console vm1
virsh --connect lxc:/// undefine vm1
XML:
<domain type='lxc'>
<name>vm1</name>
<memory>32768</memory>
<os>
<type>exe</type>
<init>/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/libexec/libvirt_lxc</emulator>
<filesystem type='mount'>
<source dir='/opt/vm-1-root'/>
<target dir='/'/>
</filesystem>
<interface type='network'>
<source network='default'/>
</interface>
<console type='pty' />
</devices>
</domain>