LXD LXC Notes
Creating a privileged container
- Create a container with privileged security (allows USER ID mapping to HOST)
lxc launch images:ubuntu/18.04 myContainer --config security.privileged=true
- Install updates
lxc exec myContainer -- apt update
lxc exec myContainer -- apt dist-upgrade
- Install openssh-server
lxc exec myContainer -- apt install openssh-server
- Change username and groupname from ubuntu:ubuntu to wayne:wayne
lxc exec myContainer -- usermod -l wayne ubuntu
lxc exec myContainer -- usermod -d /home/wayne -m wayne
lxc exec myContainer -- groupmod --new-name wayne ubuntu
- Add PASSWORD to account
lxc exec myContainer -- passwd wayne
- Add storage from host
The following line adds COMMODORE:/media/data to the myContainer’s /mnt/data
lxc config device add myContainer data disk source=/media/data path=/mnt/data
Publish a container:
lxc publish myContainer --alias newContainerNameHere
Sources:
Ubuntu LXD
Ubuntu LXC
LXC Cheat Sheet
Dual NICs
Multiple Networks
LXC Security
How to backup and restore LXD containers
How to view the files of your LXD container from the host
How to manage storage volumes
How to manage storage pools
How to manage storage volumes : Resize Volume
About storage pools, volumes and buckets