LXD LXC
(Lex-cee, Lex-dee)
What is LXD/LXC?
LXC, short for Linux Containers. To understand LXD you first have to understand LXC.
LXC is a solution for virtualising 'software' at the operating system level within the Linux Kernel. Traditionally we would have had a physical machine to run a single Operating System on it. One way to go over this limitation is to use 'virtualisation' to spin up multiple operating systems (virtual machines aka "VM's") on a server. Virtualisation is good but it takes up system resources. It also needs the CPU to handle virtualisation,VTx for Intel, and AMD V for AMD. Different types of hypervisors such as KVM, HyperV, VMWare, Virtual Box and XEN can be used to spin up and manage these VM's. The lightweight solution to these VM's is 'Linux Containerisation' whereby


If running Ubuntu 18.04, LXC/D are installed by default - otherwise just install

The LXD daemon by default is loaded but not started (inactive)

$ getent group simpsons
simpsons:x:742:homer,marge,bart,lisa,maggie
The fields, separated by :
, are—
Group name (simpsons)
Encrypted password (not normally used) - x
Numerical group ID - 742
Comma-separated list of members - homer , marge, bart, lisa.maggie
If you are running services that require you, as a user, to run commands in elevated mode.ts better sometimes to just add the user in the to the same group as the service
mike@vm1:~$ sudo getent group lxd
lxd:x:108:ubuntu
sudo usermod -aG lxd mike
mike@vm1:~$ sudo getent group lxd
lxd:x:108:ubuntu,mike
To start up a new instance :

From the above, one of the questions was :"Would you like stale cached images to be updated etc" What this means is that LXD will check the image repository for new updates of the image. We can check what current images are available

If we want to install Debian on this container we can check what images we currently have using and we can see we dont have anything installed as of yet.

So we run
ubuntu@vm1:~$ lxc image list images:debian | more
or
ubuntu@vm1:~$ lxc image list images: | more

Last updated
Was this helpful?