Skip to main content

Command Palette

Search for a command to run...

LXC/LXD commands cheat sheet

Updated
1 min read
$ sudo snap install lxd
$ lxd init
$ sudo usermod -aG user lxd



$ lxc remote list

$ lxc image list images:
$ lxc image list images: ubuntu amd64
$ lxc image info images:ubuntu/jammy
$ lxc image list local:
$ lxc image list 

$ lxc image copy images:debian/12 local: --auto-update --copy-aliases

$ lxc launch images:ubuntu/focal ubuntu
$ lxc launch images:alpine/3.16 alpine

$ lxc list 

$ lxc exec ubuntu hostname
$ lxc exec ubuntu -- hostname
$ lxc shell ubuntu
$ lxc console ubuntu # to leave press ctrl-a and let go of ctrl and press q

$ lxc file edit ubuntu/home/david/.bashrc

$ lxc start/stop/restart ubuntu

$ lxc snapshot ubuntu snap1
$ lxc snapshot ubuntu snap2

$ lxc info ubuntu
$ lxc delete ubuntu/snap1

$ lxc restore ubuntu snap2

$ lxc config set ubuntu boot.autostart 1

$ lxc config set ubuntu limits.memory 1Gb

$ lxc config set ubuntu boot.autostart.delay 30

$ lxc config show ubuntu

$ lxc config set ubuntu boot.autostart.order 2

More from this blog

Mensah David Assigbi's personal IT blog

28 posts