Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
LXC script to initiate build of CloudStack LXC systemvm
# tested on Ubuntu 14.04
#set -x
sudo lxc-create --template=debian --name=systemvm -- --release=wheezy
sudo lxc-start -n systemvm -d
sleep 2
ip=$(sudo lxc-info -n systemvm -i | awk '{print $2}')
#start provisioning using ssh
ruby provision.rb $ip -u root -p root
# tar up the rootfs to create an lxc template
sudo lxc-stop -n systemvm
mkdir -p /tmp/lxc-systemvm
# Compress container's rootfs
sudo tar --numeric-owner -czf /tmp/lxc-systemvm/systemvm-rootfs.tar.gz /var/lib/lxc/systemvm/rootfs/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.