How to start an LXC LXD container in Ubuntu

115 Views Asked by At

You are probably wondering how to install lxc/lxd in ubuntu to test your new code in a container. Then how to create an image. I will show you how you do it.

1

There are 1 best solutions below

0
Koops On

Within you command line:

sudo snap install lxd

Make sure it worked:

lxd --version

View the different lxc container images ex: ubuntu:

lxc image list images:ubuntu

Create and lxc container/image:

lxc launch images:ubuntu/focal <your image name>

Access your lxc container:

lxc exec <your image name> -- sudo -i

You are all done, go crazy messing around with your ubuntu lxc container.