User Tools

Site Tools


lxd:install

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
lxd:install [2018/10/04 15:37]
adyxax
lxd:install [2020/04/14 12:31] (current)
adyxax
Line 1: Line 1:
 ====== Install a LXD server ====== ====== Install a LXD server ======
- +~~REDIRECT>https://newwiki.adyxax.org/docs/gentoo/lxd/~~
-===== Gentoo ===== +
- +
-<code> +
-touch /​etc{/​subuid,/​subgid} +
-usermod --add-subuids 1000000-1065535 root +
-usermod --add-subgids 1000000-1065535 root +
-/​etc/​init.d/​lxd start +
-rc-update add lxd default +
-</​code>​ +
- +
-<​code>​ +
-myth /etc/init.d # lxd init +
-Would you like to use LXD clustering? (yes/no) [default=no]: +
-Do you want to configure a new storage pool? (yes/no) [default=yes]:​ +
-Name of the new storage pool [default=default]:​ +
-Would you like to connect to a MAAS server? (yes/no) [default=no]:​ +
-Would you like to create a new local network bridge? (yes/no) [default=yes]:​ no +
-Would you like to configure LXD to use an existing bridge or host interface? (yes/no) [default=no]:​ yes +
-Name of the existing bridge or host interface: lxdbr0 +
-Would you like LXD to be available over the network? (yes/no) [default=no]:​ yes +
-Address to bind LXD to (not including port) [default=all]:​ 10.1.0.247 +
-Port to bind LXD to [default=8443]:​ +
-Trust password for new clients: +
-Again: +
-Invalid input, try again. +
- +
-Trust password for new clients: +
-Again: +
-Would you like stale cached images to be updated automatically?​ (yes/no) [default=yes] +
-Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:​ +
-</code> +
- +
-===== Installation using snapd ===== +
- +
-==== Centos7 ==== +
- +
-First we install snap : +
-<​code>​ +
-yum install yum-plugin-copr epel-release +
-yum copr enable ngompa/​snapcore-el7 +
-yum install snapd +
-systemctl enable --now snapd.socket +
-</​code>​ +
- +
-Then we need to activate kernel features necessary for lxc by adding the following to ''/​etc/​default/​grub''​ in GRUB_CMDLINE_LINUX : +
-<​code>​ +
-user_namespace.enable=1 namespace.unpriv_enable=1 user.max_user_namespaces=3883 +
-</​code>​ +
- +
-Then we rebuild grub.conf, set a required sysctl and reboot : +
-<​code>​ +
-grub2-mkconfig >/​boot/​grub2/​grub.cfg +
-echo "​user.max_user_namespaces=3883"​ > /​etc/​sysctl.d/​99-userns.conf +
-reboot +
-</​code>​ +
- +
-After rebooting we can install and test lxd +
-<​code>​ +
-snap install lxd +
-lxd init  # don't create network or storage here +
-lxc network create lxdbr0 ipv4.address=172.16.3.1/24 ipv6.address=none ipv4.nat=false ipv4.dhcp=false ipv4.firewall=false ipv6.dhcp=false ipv6.firewall=false +
-lxc network attach-profile lxdbr0 default +
-lxc storage create local dir +
-lxc profile device add default root disk path=/ pool=local +
-lxc launch images:​alpine/​3.8 test +
-</​code>​ +
- +
-==== Ubuntu ==== +
- +
-Snapd is installed and enabled by default, as are the kernel features required to run lxc, so we just run : +
-<​code>​ +
-snap install lxd +
-lxd init  # don't create network or storage here +
-lxc network create lxdbr0 ipv4.address=172.16.3.1/​24 ipv6.address=none ipv4.nat=false +
-lxc network attach-profile lxdbr0 default +
-lxc storage create local dir +
-lxc profile device add default root disk path=/ pool=local +
-lxc launch images:​alpine/​3.8 test +
-</​code>​+
lxd/install.txt · Last modified: 2020/04/14 12:31 by adyxax