Linux Containers (LXC) is a userspace interface for operating system-level virtualization features in the mainline Linux kernel, such as kernel namespaces and control groups (cgroups). These allow multiple distinct user space instances to be run on a single kernel.

learn more… | top users | synonyms

5
votes
2answers
4k views

Building unprivileged (userns) LXC container from scratch, by migrating a privileged container to be unprivileged

How can I build a privileged LXC (1.0.3) container (that part I know) and then migrate it successfully to be run unprivileged? That is, I'd like to debootstrap it myself or adjust the lxc-ubuntu ...
0
votes
1answer
784 views

SSH to Linux Container from Other Machine

I am trying to learn about Linux Containers and this is my first encounter with servers, ssh and many other things that I do not know the terms yet. I create five different containers and authorized ...
18
votes
5answers
19k views

LXC: How do I mount a folder from the host to the container?

I'm trying to mount a folder on the host to an LXC container. The host has a folder /mnt/ssd/solr_data created (this is currently on the root filesystem, but later I'll mount an SSD drive there, so I'...
2
votes
1answer
28 views

LXC container gets two IP addresses assigned to it

I'm playing around with LXC on my Arch Linux workstation as a learning experience. I'm following the guide on the LXC page on the Archwiki and setting up a static ip for the container. This is what my ...
1
vote
1answer
37 views

Set up DHCP for LXC containers

I have several lxc containers that need network access. At the moment I am manually allocating them IP addresses in the relevant config file as so: lxc.network.type = veth lxc.network.flags = up lxc....
1
vote
1answer
40 views

What is the correct way to start a container with a given command?

I want to create a set of containers for simulating network traffic. Inside each of the containers, I would like to set a different network delay. Right now I am doing it manually using this command, ...
1
vote
0answers
41 views

fail to log from my app through rsyslogd in a linux container

Running an archlinux container on an archlinux host, both using rsyslog with the same configuration file: $ cat /etc/rsyslog.conf # Minimal config $ModLoad imuxsock # provides support for local ...
0
votes
1answer
33 views

Why would a container not be bridged to the local network by default?

From my understanding on container technology (like lxc or docker), when you create a container it by default uses a "private network" like 10.0.1.x. I do not understand why you would not want it on ...
0
votes
1answer
45 views

Can I run NixOS in an LXC container?

Can I run NixOS in an LXC container? To run debian on top of debian, one would use LANG=C SUITE=jessie MIRROR=http://httpredir.debian.org/debian lxc-create -n debian8 -t debian What should one ...
1
vote
1answer
27 views

Docker container on Red Hat Linux server 5.9

Can I install Docker on Red Hat server 5.9 so I can take an image container from an installed software and move it to another server? Or should it be enough to update the Kernel up to version 3 so ...
5
votes
2answers
3k views

How to assign an additional IP/hostname to a chrooted environment?

While I can simply have e.g. sshd in a chroot environment ("chrootenv") listen to a different port than its parent ("parentenv"), it would be more convenient to have that environment have an ...
1
vote
1answer
55 views

What is the network connection speed between two containers communicating via a virtual bridge running on the same host?

Does a virtual bridge (added to /etc/network/interfaces) limit the transfer speed of data from the memory of one lxc/docker container to another? For example does the memory throughput drop to that ...
1
vote
1answer
45 views

bridge-routing and martian packets

i am experimenting with routing a bit, and now i have a problem i cannot solve by myself eth0 | | ...
6
votes
2answers
1k views

Is it possible to run a 10.04 or 12.04 or earlier LTS containerized under LXC or Docker on Trusty?

Is it possible to have a vanilla installation of Ubuntu 14.04 (Trusty) and run inside it containerized older Ubuntu versions that originally came with older kernels? For example for 12.04 I'd assume ...
7
votes
1answer
5k views

docker - how to run x desktop in a container?

I'm trying to set up my Linux machine to run multiple guest OSes, one of those being a Windows VM, and another a Linux container. The goal here is to prevent me from messing up the host system, while ...
1
vote
0answers
61 views

Weird behaviour of unprivileged LXC container

Can someone please explain this weird behaviour to me: I have an unpriviliged LXC container with firefox inside. If firefox is running on the host outside of the container, /usr/bin/firefox inside ...
2
votes
0answers
54 views

I have trouble analysing the cause of this (firefox) segfault

When executed within a minimal (unprivileged) LXC container, firefox segfaults (other graphical applications work fine). I'am unable to find the exact cause of this segfault (which is most likely due ...
1
vote
1answer
312 views

How to install graphic capabilities to CoreOs?

I would like to install CoreOs as a base on my desktop machine. Then, I could launch some containers, with eventualy a graphical environnement. So I have to add all the graphic stack: GPU drivers, ...
34
votes
1answer
22k views

Linux LXC vs FreeBSD jail

Are there any notable differences between LXC (Linux containers) and FreeBSD's jails in terms of security, stability & performance? On first look, both approaches look very similar.
0
votes
0answers
14 views

Vagrant LXC mounts small /tmp partition

I've got a vagrant box running with an ubuntu based LXC container. I had to run a script that uses /tmp to store some files temporarily. The script kept failing, having looked at what's up, it turned ...
0
votes
0answers
24 views

lxc-how to make an lxc container available on the LAN?

I have tried a lot of methods mentioned on the internet,including the debian wiki, and a lot of other sources.But they all end up either not fully completing what i want to do, or taking out the host ...
0
votes
1answer
56 views

How can I list all connections to my host, including those to LXC guests?

I tried both netstat and lsof, but it appears it's not possible to see the connections to my LXC guests. Is there a way to achieve this ... for all guests at once? Essentially what throws me off ...
0
votes
0answers
17 views

How to autostart an lxc container in a custom directory?

I want to keep my LXC containers outside of var (preferably in /srv). When my LXC container is in /var/lib/lxc, it autostarts by setting a flag in config, but when I lxc-init -P is/srv/dir`, it ...
5
votes
1answer
268 views

Subordinate GIDs/UIDs with LXC and userns for unprivileged user?

When using userns (via LXC in my case), you assign a range of subordinate GIDs and UIDs to an unprivileged user. See for resources: subuid(5), subgid(5), newuidmap(1), newgidmap(1), user_namespaces(7)....
0
votes
0answers
34 views

Disk usage for a mounted drive shows up completely between the host and a container

When comparing the disk usage for a mounted harddrive the usage is completely different when compared between the host and the container. I am running Ubuntu 14.04 on the host and in the lxc container....
4
votes
0answers
48 views

LXC: Any security difference between root and end-user owned unprivileged containers?

I intend to use LXC containers to isolate most of the network facing services. As per my understanding, I have mainly two ways to do this: Create unprivileged containers owned by root. In this case,...
0
votes
1answer
421 views

LXC Bridge not working on ubuntu 15.04

I'm trying to get lxc containers running with a bridged network connection so the container get ip addresses like the host does from a dhcp server. I red several tutorials, but I couldn't find one ...
4
votes
0answers
91 views

How to bind an lxc container to a specific bridge?

I created a specific bridge br1 and would like to bind a specific container cont1 to that bridge. I have lxc and lxd installed, if that matters (I am not sure what the difference between them really ...
1
vote
0answers
58 views

How to start a service upon an lxc container start?

I would like to start OpenVPN automatically upon the launch of its lcx container. The container runs Ubuntu 14.04.4 LTS, service openvpn start is successful (when launched from the running container) ...
0
votes
0answers
29 views

Auto-assign free static IP address from a range to a container (veth)?

In the config-file of an individual LXC container, one can specify a static IP address so the inside of the container does not need to acquire an IP by DHCP. Is there a way to automatically assign ...
2
votes
0answers
28 views

How to map a UID to another UID (!= 0) inside a user namespace?

How can one map UID 1000 to another regular UID (not root/0) inside a user namespace? EDIT: For anyone interested, https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html lists an ...
2
votes
1answer
108 views

Installing collectd hangs in debian jessie in LXD, I need help finding out why it stalls

I am trying to install collectd using apt-get install collectd in debian jessie. It always hangs at the same place, after setting up ca-certificates it will reach "Setting up collectd" and then ...
3
votes
0answers
117 views

Sharing unix sockets across unprivileged lxcontainers

I have two unprivileged containers and I'd like to share a unix socket between them. Each container has its own user on the host, complete with separate subuid and subguid mappings. I've tried ...
1
vote
0answers
60 views

Why does LXC-create returns error “sudo.conf should be 0”?

I try to create an unprivileged container and nothing works as expected. Here is my code : follows that tutorial #!/bin/bash sudo apt-get update sudo apt-get dist-upgrade sudo apt-get -y install ...
22
votes
2answers
11k views

What is the difference between Docker, LXD, and LXC [closed]

What is the difference between Docker, LXD, and LXC. Do they offer the same services or different.
0
votes
1answer
174 views

LXC ip allocation using DHCP

I'm trying to set up DHCP for my lxcontainers without using lxc-net. The reason for this decision is that I'd like to place my containers in different networks, such that they are unable to talk to ...
1
vote
0answers
29 views

Why I can not update Linux core in dockers?

When I run apt-get update && apt-get upgrade in container, the core is not starting to update. Yes, I know, containers use the kernel of host machine and can not execute some ...
3
votes
3answers
2k views

Moving LXC container's backing storage

I have a bunch of LXC containers running on a machine. All of them have their rootfs in the default location /var/lib/lxc/*/rootfs. This directory lives on a rather small partition on the host. I have ...
7
votes
3answers
5k views

How to create user cgroups with systemd

I use unprivileged lxc containers in Arch Linux. Here are the basic system infos: [chb@conventiont ~]$ uname -a Linux conventiont 3.17.4-Chb #1 SMP PREEMPT Fri Nov 28 12:39:54 UTC 2014 x86_64 GNU/...
1
vote
0answers
84 views

NFS permissions across multiple LXC VM's

I recently changed my home server setup from a basic Ubuntu Server installation running everything to a virtualised environment. I am currently running ProxMox type 1 hypervisor, with several VM's. ...
1
vote
1answer
68 views

How do I make changes to an lxc template?

I normally create containers with: lxc-create -n mycontainer -t debian However I want to bake a few items into that "debian" default template. New user with my ssh key, can sudo without a ...
4
votes
1answer
36 views

LXC: Are downloaded templates verified?

Debian 8.3, LXC 1:1.0.6-6+deb8u2 When LXC downloads the base packages for a Debian container, are the packages verified? Verifying a Debian CD involves comparing signed checksum files against the ...
2
votes
0answers
46 views

SSH/web servers in Linux containers improve security?

Scenario: A 'gateway' machine functioning as a router and firewall, connecting a small LAN to the internet. The machine also runs a webserver (hosting a simple website) and an SSH server, providing (...
2
votes
2answers
474 views

Container lockdown

I was reading about LXC vs OpenVZ and was wondering if this issue has already been solved in more recent updates: OpenVZ has done quite a good job at this, but LXC still has issues here. Even ...
2
votes
0answers
75 views

How to calculate LXC load average

How I can calculate or fetch LoadAverage from LXC container? (/proc/loadavg has load from physical server not from vm) Any ideas ?
3
votes
2answers
119 views

Is it possible to mount a device in a process' namespace after unshare()

Say I have a process with an isolated MOUNT namespace pid 1200 the process called unshare() to isolate its namespace from the parent process. I then want to mount a device only accessible outside pid ...
1
vote
2answers
69 views

Which container implementation docker is using

Docker is based on Linux containers and control groups. But I would like to know which implementation of Linux containers , docker is using? Is it using the native/default (LXC execution environment ) ...
3
votes
1answer
85 views

Setup permanent bridge for dynamic network devices from lxc container?

TL:DR How can I make a bridge permanent (survive reboot) without adding a network device to the bridge config in /etc/network/interfaces? Hi, I just started playing around with lxc on ubuntu 14.04. ...
6
votes
4answers
2k views

Can LXC be used to jail instances of an installed browser?

Is it possible to use LXC on a desktop system to confine browsers and other pieces of software that have in the past been shown to be prone to certain kinds of exploits. So what I want to achieve is ...
2
votes
2answers
53 views

Bash script to insert information after each line of block of data

I wish to write a script that would insert information from the /proc file system to a list of processes generated by top. It would be something like this: Here is the sample output that I get from ...