Shell script to setup an LXD (Linux Containers) VM lab for testing purpose

in Categories Automation & Management, Networking, Virtualization last updated June 20, 2018

A sample shell script to build an LXD (Linux Containers) VM lab on Ubuntu Linux 16.04 LTS server.

How do I use this script?

First install and setup LXD server as described here on Ubuntu 16.04 or above (see How to Setup LXD on Fedora Linux 28) :
$ sudo apt-get install lxd
## config your storage like zfs and bridge setup
$ sudo lxd init

Edit and customize script variable. Once done, run it as follows:
$ ./lxd-vm-lab
Sample outputs:

Fig.01: script output
Fig.01: script output

That is all. It will take some time to download all images from the remote server.

Share this on: