LXC Usage

Basic Usage

Create a new container

lxc-create -n CONTAINER -t debian

Note

always use FQDN as container name since by default the capability to set hostname is dropped.

Start an existing container (in foreground)

lxc-start -n CONTAINER

Start an existing container (in background)

lxc-start -n CONTAINER -d

Attach console to in background started container

lxc-console -n CONTAINER

Shutdown an existing container

lxc-stop -n CONTAINER

Kill an existing container

lxc-kill -n CONTAINER

or

lxc-stop -n CONTAINER -k

Delete an existing container

lxc-destroy -n CONTAINER

List existing containers on the system

lxc-list

and

lxc-ls --fancy