Archive for : March, 2018

LXD Setup

#apt-get install lxd
root@madmax:~# lxd init
error: You have existing containers or images. lxd init requires an empty LXD.

Listing containers
#lxc list
root@madmax:~# lxc list
+———-+———+———————-+——+————+———–+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+———-+———+———————-+——+————+———–+
| c1-u1604 | RUNNING | 10.200.105.36 (eth0) | | PERSISTENT | 0 |
+———-+———+———————-+——+————+———–+

Stop the container and delete it.
#lxc stop ; lxc delete

Initial LXD Setup

root@madmax:~# lxd init
Do you want to configure a new storage pool (yes/no) [default=yes]? yes
Name of the storage backend to use (dir or zfs) [default=zfs]: dir
Would you like LXD to be available over the network (yes/no) [default=no]? no
Do you want to configure the LXD bridge (yes/no) [default=yes]? yes
Warning: Stopping lxd.service, but it can still be activated by:
lxd.socket
LXD has been successfully configured.

Listing LXD Containers

root@madmax:~# lxc list
+——+——-+——+——+——+———–+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+——+——-+——+——+——+———–+

Creating new Containers

root@madmax:~# lxc launch ubuntu:16.04 template-ubuntu-1604
Creating template-ubuntu-1604
Retrieving image: rootfs: 35% (1.89MB/s)
Starting template-ubuntu-1604