Skip to content

Instantly share code, notes, and snippets.

@swettk
Forked from badsyntax/provision.sh
Created December 21, 2015 19:12
Show Gist options
  • Save swettk/ece8c15f5fde7ae63ad3 to your computer and use it in GitHub Desktop.
Save swettk/ece8c15f5fde7ae63ad3 to your computer and use it in GitHub Desktop.
Running lxc with zfs backing store, in Ubuntu 14.04, within a virtualbox virtual machine
#!/usr/bin/env bash
# ubuntu/trusty64
apt-get update
apt-get install software-properties-common -y
apt-add-repository ppa:ubuntu-lxc/daily
add-apt-repository ppa:zfs-native/stable
add-apt-repository ppa:nginx/stable -y
apt-get update
apt-get install lxc ubuntu-zfs nginx -y
echo "Creating zfs disk..."
dd if=/dev/zero of=/root/zfsdisk1.img bs=1024 count=10485760 # 10gb
zpool create lxc /root/zfsdisk1.img
zpool set listsnapshots=on lxc
echo "Setting up lxc..."
rmdir /var/lib/lxc
ln -s /lxc /var/lib/
lxc-create -t ubuntu -n ubuntu -B zfs
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment