Bart Simons

Bart Simons


Thoughts, stories and ideas.

Bart Simons
Author

Share


Tags


.net .net core Apache C# CentOS LAMP NET Framework Pretty URLs Windows Server WireGuard WireGuard.io access log add analysis android api at the same time authentication authorization automate automation azure azurerm backup bash basics batch bootstrap build capture cheat sheet chromium chroot class cli click to close code snippet command line commands compile compiling compression containers control controller controlling convert cpu usage create credentials csv csvparser curl data dd deployment desktop detect devices disable diskpart dism distributed diy docker dom changes dotnet core drivers ease of access encryption example export file transfer files fix folders generalize getting started ghost ghost.org gui guide gunicorn gzip html html tables icewarp igd imagex import inotify install installation interactive ios iphone itunes java javascript jquery json kiosk kotlin linux live load data loading screen lock screen loopback audio lxc lxd lxml macos manage manually message messages minio mirrored mod_rewrite monitor monitoring mutationobserver mysql nexmo nginx no oobe node node.js nodejs not installing notification notifications object storage on desktop one command openssl owncloud parallels parallels tools parse perfect philips hue play port forwarding portainer.io powershell processing ps-spotify python quick raspberry pi record rip ripping rsync rtmp save save data sbapplication scraping script scripting scriptingbridge scripts security send server service sharedpreferences sms songs sonos spotify spotify api spotlight ssh stack streaming streamlink studio sudo swarm swift sync sysprep system audio systemd tables terminal tracking tutorial twilio ubiquiti ubuntu ubuntu 18.04 ui code unifi unlock unsplash source upnp uptime usb tethering wallpapers wasapi website websites webview windows windows 10 without itunes without oobe workaround xaml

LXD cheat sheet for beginners

This page contains a list of handy LXD commands for beginners to get started with LXD. Every command in this guide has been tested on an Ubuntu 16.04 machine.

Configuring a new LXD installation for the first time

sudo lxd init

This command does the following things for you:

Checking LXD version

sudo lxd --version

Listing all image servers

sudo lxc remote list

This will output a list of all currently installed image servers

Getting a list of available images from an image server

sudo lxc image list images:

This command fetches a list of all available images from the images image server. You could replace the image server with a different image server. For example, this is what you do to get a list of images from the Ubuntu Daily image server

sudo lxc image list ubuntu-daily:

Getting a filtered image list from an image server

sudo lxc image list images: arm64

This will fetch a list of ARM64 images from an image server.

sudo lxc image list images: arm64 ubuntu

This will fetch a list of ARM64 Ubuntu images from an image server.

Creating a new container

sudo lxc init images:ubuntu/yakkety/amd64 ubuntu-test-1

This command will create a new container called ubuntu-test-1 based on a Ubuntu Yakkety Yak AMD64 image. The image will be fetched from the images image server.

Starting a container

sudo lxc start ubuntu-list-1

This will start the container named ubuntu-list-1

Stopping a container

sudo lxc stop ubuntu-list-1

This will stop the container named ubuntu-list-1

Removing a container

sudo lxc delete ubuntu-list-1

You can force this command with --force if needed.

Listing all containers

sudo lxc list --format table

You can also use json instead of table.

Listing all cached images

sudo lxc image list

Removing a cached image

sudo lxc image delete 4117cf6a0442

This will delete an image with fingerprint ID 4117cf6a0442. You can obtain the fingerprint ID of an image with the sudo lxc image list command.

Executing a command on a container

sudo lxc exec ubuntu-test-1 ping 8.8.8.8

This will execute the ping executable on the ubuntu-test-1 container.

Getting shell access on a container

You can also use the previous command to execute a shell, for example bash.

Bart Simons
Author

Bart Simons

View Comments