Skip to content

Instantly share code, notes, and snippets.

@scottslowe
Created November 25, 2013 19:59
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save scottslowe/7647800 to your computer and use it in GitHub Desktop.
Save scottslowe/7647800 to your computer and use it in GitHub Desktop.
This snippet of libvirt XML can be used as a template when creating LXC containers that you want to run/manage via libvirt.
<domain type='lxc'>
<name>REPLACE</name>
<memory>327680</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/lib/lxc/REPLACE/rootfs'/>
<target dir='/'/>
</filesystem>
<interface type='network'>
<source network='default'/>
</interface>
<console type='pty'/>
</devices>
</domain>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment