From c0152730351d0f1393e0e7cb075424ced9c250b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jochum?= Date: Tue, 7 Jul 2015 02:45:09 +0200 Subject: [PATCH] Add an lxd intro. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: René Jochum --- content/post/lxd-getting-started.md | 55 +++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 content/post/lxd-getting-started.md diff --git a/content/post/lxd-getting-started.md b/content/post/lxd-getting-started.md new file mode 100644 index 0000000..be427c4 --- /dev/null +++ b/content/post/lxd-getting-started.md @@ -0,0 +1,55 @@ +--- +date: 2015-07-07T13:00:00+01:00 +title: LXD getting started +author: pcdummy +tags: + - HOWTO + - Ubuntu + - BTRFS + - lxc + - lxd +--- +This is what i do to install and configure lxd. + +Install **lxd**: + + sudo apt-add-repository -y ppa:ubuntu-lxc/stable + sudo apt-get update + sudo apt-get install lxd + +Give root one subuid and subgid: + + sudo usermod --add-subuids 1000000-165536 root + sudo usermod --add-subgids 1000000-165536 root + +OR give root 99 subuid's/subgid's: + + for i in {100..199}; do sudo usermod --add-subuids ${i}00000-${i}65536 root; sudo usermod --add-subgids ${i}00000-${i}65536 root; done # This takes a while + +Restart **lxd**: + + sudo service lxd restart + +Set the remote authentication password: + + lxc config set core.trust_password <your-password-here> + +Change the default profile network interface: + + lxc profile edit default # Change lxcbr0 to your value. + +Create an image: + + lxd-images import lxc ubuntu trusty amd64 --alias trusty64 --alias ubuntu/trusty/amd64 + +Create the container "trusty64" from the image "ubuntu/trusty/amd64" you just made: + + lxc launch ubuntu/trusty/amd64 trusty64 + +Show the log if the above failed: + + lxc info trusty64 --show-log + +Usefull Links: +- [LXD README.md](https://github.com/lxc/lxd#machine-setup) +- [LXD CMD specs](https://github.com/lxc/lxd/blob/master/specs/command-line-user-experience.md)