lxd is a system-wide daemon and lxd is a command line client to talk with the lxd daemon. So, you need to use the lxc command to list images in the LXD store. This page shows how to list VM images in LXD using the lxc.
How to list VM images in LXD
The syntax is:
lxc image list images:
Sample outputs:
Fig.01: Listing all VM images
lxc image list images: | more
lxc image list images: | grep -i 'debian'
lxc image list images: | grep -i 'opensuse'
Sample outputs:
Fig.02: Using the grep command to filter out images
lxc image list images: 'alpine'
lxc image list images: 'opensuse'
Fig.03: Using filters
lxc launch images:alpine/3.8/amd64 alpine-www
lxc launch images:centos/7/amd64 cenots-db
lxc launch images:opensuse/15.0/amd64 opensuse-15
lxc list
How do I get a list of Linux distros?
Run the following combination of grep command/egrep command, awk command and sed command:
lxc image list images: |\ awk -F'|' '{ print $2}' |\ sed '/^[[:space:]]*$/d' |\ awk -F'/' '{ print $1"/"$2 }' | sort | uniq | egrep -v 'more|ALIAS'
Sample outputs:
alpine/3.10 alpine/3.7 alpine/3.8 alpine/3.9 alpine/edge alt/Sisyphus alt/p8 alt/p9 apertis/17.12 apertis/18.03 apertis/18.06 apertis/18.09 apertis/18.12 centos/6 centos/7 centos/8 debian/10 debian/8 debian/9 debian/bullseye debian/sid devuan/ascii fedora/29 fedora/30 fedora/31 funtoo/1.3 gentoo/cloud kali/cloud mint/sarah mint/serena mint/sonya mint/sylvia mint/tara mint/tessa mint/tina opensuse/15.0 opensuse/15.1 opensuse/tumbleweed oracle/6 oracle/7 oracle/8 plamo/6.x ubuntu-core/16 ubuntu/14.04 ubuntu/16.04 ubuntu/18.04 ubuntu/18.10 ubuntu/disco ubuntu/eoan ubuntu/focal voidlinux/musl
Getting help on image option
Type the following command:
lxc image help
Sample outputs:
Description: Manage images In LXD containers are created from images. Those images were themselves either generated from an existing container or downloaded from an image server. When using remote images, LXD will automatically cache images for you and remove them upon expiration. The image unique identifier is the hash (sha-256) of its representation as a compressed tarball (or for split images, the concatenation of the metadata and rootfs tarballs). Images can be referenced by their full hash, shortest unique partial hash or alias name (if one is set). Usage: lxc image [command] Available Commands: alias Manage image aliases copy Copy images between servers delete Delete images edit Edit image properties export Export and download images import Import images into the image store info Show useful information about images list List images refresh Refresh images show Show image properties Global Flags: --debug Show all debug messages --force-local Force using the local unix socket -h, --help Print help --project string Override the source project -q, --quiet Don't show progress information -v, --verbose Show all information messages --version Print version number Use "lxc image [command] --help" for more information about a command.
See lxd documents here for more info.
This entry is 4 of 19 in the LXD Tutorial series. Keep reading the rest of the series:
- Install LXD container hypervisor on Ubuntu 16.04 LTS
- How to install and setup LXC (Linux Container) on Fedora Linux 26
- Set up LXD container under KVM or Xen virtual machine
- List VM images in LXD (Linux Containers)
- Upgrade LXD containers powered by Ubuntu/Debian or CentOS Linux
- Auto start LXD containers at boot time in Linux
- Command to rename LXD / LXC container
- Run commands on Linux Container (LXD) instance at provision launch time
- Use LXD (Linux containers) in a shell script to create VM when the cloud instance launches
- Move/migrate LXD VM to another host on Linux
- Fedora install and set up LXD
- CentOS 7.x install and set up LXD server
- Install LXD pure-container hypervisor on Ubuntu 18.04 LTS
- Create snapshots with lxc command for LXD
- Set up and install LXD on CentOS/RHEL 8
- Ubuntu 20.04 LTS install and set up LXD
- Full backup and restore LXD containers
- Disable firewall and NAT rules on the LXD bridge
- Delete or remove LXD container using the lxc
🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 2 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
I’m running lxc on a Centos7, and have for sometime now been trying to find a way to get ‘lxc’ – does anyone know where I can find the source.
I am sorry, but your question is not clear to me. Can you be more specific?