usermod -aG lxd $USER
lxd init
# use dir for storage backend
# create network bridge
lxc storage list
lxc remote list
# Show all the images already downloaded on the local machine
lxc image list
# show images available from "images" repository
lxc image list images:
# Search all Alma Linux images available for download
lxc image list images:alma
lxc launch ubuntu:20.04 # with random name
lxc launch almalinux/9 almaDev # almaDev is the name of the container
lxc stop $CONTAINER_NAME
lxc delete $CONTAINER_NAME
lxc list
lxc move $CONTAINER_NAME new-name # rename container to new-name
lxc exec $CONTAINER_NAME bash # login as root
lxc exec $CONTAINER_NAME su - ubuntu # login as user ubuntu
lxc config set $CONTAINER_NAME security.privileged true
lxc config set $CONTAINER_NAME security.nesting true
lxc config device add $CONTAINER_NAME $SOMENAME disk \
source="/dir_from_host" \
path="/home/user/dir_on_container"
for ipt in iptables iptables-legacy ip6tables ip6tables-legacy; do
$ipt --flush
$ipt --flush -t nat
$ipt --delete-chain
$ipt --delete-chain -t nat
$ipt -P FORWARD ACCEPT
$ipt -P INPUT ACCEPT
$ipt -P OUTPUT ACCEPT
done
systemctl reload snap.lxd.daemon