mirror of
https://codeberg.org/postscriptum/gemlog.git
synced 2026-02-18 22:12:40 +00:00
40 lines
No EOL
460 B
Text
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
|
|
``` |