Skip to content

Instantly share code, notes, and snippets.

@jcassette
Created February 4, 2024 14:56
Show Gist options
  • Select an option

  • Save jcassette/71506988fadcd3a39c4a3b7e15f29c1a to your computer and use it in GitHub Desktop.

Select an option

Save jcassette/71506988fadcd3a39c4a3b7e15f29c1a to your computer and use it in GitHub Desktop.
TrueNAS SCALE LXC
#!/bin/sh
set -e
chmod +x /usr/bin/apt*
chmod +x /usr/bin/dpkg
apt install lxc
cat >> /etc/lxc/default.conf << EOF
lxc.net.0.type = macvlan
lxc.net.0.link = enp4s0
lxc.net.0.flags = up
EOF
zfs create tank/lxc
cat >> /etc/lxc/lxc.conf << EOF
lxc.lxcpath = /mnt/tank/lxc
EOF
echo "Done. You may execute these commands:"
echo " sudo lxc-create -n foo -t debian -- --release stable"
echo " sudo lxc-start foo"
echo " sudo lxc-attach foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment