gemlog/public/en/lxc-usage-examples.gmi
2025-09-11 12:43:12 +03:00

40 lines
No EOL
460 B
Text

# LXC usage examples
## Install
``` bash
apt install apparmor apparmor-utils debootstrap lxc-templates lxc
```
## Create new container
``` bash
lxc-create -t debian -n NAME
```
* optionally, set custom location: `-P /path/to/lxc` (default: `/var/lib/lxc`)
## Run
### Foreground (debug)
``` bash
lxc-start -n NAME -F
```
### Background
``` bash
lxc-start -n NAME -d
```
## Login
``` bash
lxc-attach -n NAME
```
## Stop
``` bash
lxc-stop -n NAME
```