LXC container config – The quick way to setup
Trying to do LXC container config in Ubuntu? We can help you.
LXC containers are Linux containers which mainly create an environment as close as possible to a standard Linux installation without the need for a separate kernel.
Here at Bobcares, we often receive LXC container config requests as a part of our Server Management Services.
Today, let’s see how our Support Engineers install and configure an LXC for our customers.
How we install the LXC container?
Let’s walk through the steps our Support Engineers follow to install LXC containers in Ubuntu.
1. Initially, we update the base system by running the command,
apt-get update -y
2. LXC is available by default in Ubuntu servers. However, we can install it by running the command
apt-get install lxc lxc-templates -y
3. Then we can check the LXC using the command
Creating an LXC container and starting it
After its successful installation, we further move to create LXC containers.
1. LXC comes with built-in templates. We can list them out using the command
2. Now, we can create the container using the command
lxc-create -n new-container -t ubuntu
3. We then start the container by running the command
lxc-start -n new-container -d
Installing LXC web panel
We can create, start, stop, clone, delete and restart Linux container from the web browser using the LXC web panel.
We download and install the web panel automatically by running the command,
wget https://lxc-webpanel.github.io/tools/install.sh -O - | bash
Here is the screenshot of the web panel,
LXC container-related errors
Recently, one of our customers approached with a container problem. He was trying to create an unprivileged container but ran into errors.
lxc-create 20160914131052.735 INFO lxc_container - lxccontainer.c:container_destroy:2403 - Destroyed directory for game_container lxc-create 20160914131052.735 ERROR lxc_create_ui - tools/lxc_create.c:main:318 - Error creating container game_container
Our Support Engineers started troubleshooting the error and found that the LXC container config error was due to the SSL. The CA certificate verification was failing which was causing problems with the LXC containers.
We finally fixed the problem with the SSL. And then, the customer was able to create the container.
[Need any assistance with the LXC installation? – We’ll help you]
In short, we can start a Linux container without using a separate kernel through LXC. Today, we saw how our Support Engineers install and configure the LXC container and fix related errors.