How to administer LXC Containers

LXC (Linux Containers) is an OS-level virtualization technology that allows the creation and running of multiple isolated Linux virtual environments (VE) on a single control host. These isolation levels or containers can be used to either sandbox specific applications, or to emulate an entirely new host. LXC uses Linux’s cgroups functionality, which was introduced in version 2.6.24 to allow the host CPU to better partition memory allocation into isolation levels called namespaces.
– Note that a VE is distinct from a virtual machine (VM)

Start container
There are two possibilities to start a container:
either on the GUI or on the command line
1)Start Container
——#pct start 100
Stop container
Stopping a container can be done in a similar way as starting a container.

2)Stop Container
—– #pct stop 100

3)To list container on LXC
——root@pve:/# pct list

4)Add network configuration via the GUI
Add network configuration based on the original settings
LXCs uses virtual network adapter which are bridged to the physical interface of your host. This works very similar to the way veth devices work in OpenVZ.
In Proxmox VE 3.x the configuration of each container using a veth device had to be done inside the container. In Proxmox VE 4.x you can do this directly from the host.

For each container: Select the container by clicking on it
Go to the Network tab
Click Add device
On the veth device panel, add a device with the parameters:
ID: net0
name eth0
put your IP address and the corresponding netmask in the following format
Add network configuration via the CLI
pct set 101 -net0 name=eth0,bridge=vmbr0,ip=192.1xx.xx.144/24,
pct set 102 -net0 name=eth0,bridge=vmbr0,,gw=192.xx.15.x

Note: This can also be done traditionally using any of the text editor.

auto eth0
iface eth0 inet static

5)How to enter a container
#pct enter 100

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x