How to create unprivileged LXC container on Ubuntu Linux 14.04 LTS

‮l.www‬autturi.com
How to create unprivileged LXC container on Ubuntu Linux 14.04 LTS

To create an unprivileged Linux Containers (LXC) container on Ubuntu Linux 14.04 LTS, you can follow these steps:

  1. Install the lxc package, which provides the tools needed to manage LXC containers:
sudo apt-get update
sudo apt-get install lxc
  1. Create a user and group for the unprivileged container. For example:
sudo addgroup --system lxc
sudo adduser --system --ingroup lxc lxc

This will create the lxc user and group, which will be used to run the unprivileged container.

  1. Create the container using the lxc-create command. Replace container with the desired name for the container:
sudo lxc-create -n container -t download -- --dist ubuntu --release trusty --arch amd64

This will create a new container called container using the Ubuntu 14.04 LTS (Trusty Tahr) release.

  1. To start the container, use the lxc-start command:
sudo lxc-start -n container
  1. To access the container, you can use the lxc-attach command:
sudo lxc-attach -n container

This will open a console session in the container.

Created Time:2017-10-28 21:39:01  Author:lautturi