Questions tagged [lxc]

LXC is an operating system-level virtualization method for running multiple isolated Linux systems (containers) on a single control host. It is sometimes referred to as “chroot on steroids”.

LXC provides operating system-level virtualization not via a full blown virtual machine, but rather provides a virtual environment that has its own process and network space. LXC relies on the Linux kernel cgroups functionality that became available in version 2.6.29 and is now available in all further kernel distibutions.

Cgroups was developed as part of LXC. It also relies on other kinds of namespace-isolation functionality, which were developed and integrated into the mainline Linux kernel.

LXC is similar to other OS-level virtualization technologies on Linux such as OpenVZ and Linux-VServer, as well as those on other operating systems such as FreeBSD jails. LXC Containers can define various cpu limits, memory limits etc. (In short all parameters that can be set via CGROUPS) to prevent any one container from interfering with all other containers running on the same LXC host.

LXC uses the linux bridge-utils commands to create local VLANs, and attach containers and physical interfaces to them. With containers the physical overhead (ram, swap space, one kernel per VM, plus hypervisor) that is present in virtualization methods is reduced. With containers, one kernel and one virtual memory space is shared between all the containers running on that host.

For a comparison of other Operating System virtualization techniques, see this link

591 questions
9
votes
3 answers

docker attach vs lxc-attach

UPDATE: Docker 0.9.0 use libcontainer now, diverting from LXC see: Attaching process to Docker libcontainer container I'm running an istance of elasticsearch: docker run -d -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch Checking the process it…
Luca G. Soave
  • 12,271
  • 12
  • 58
  • 109
9
votes
4 answers

What are the typical uses cases for LXC versus VM?

I am trying to make up my mind on when an LXC container can be a better choice than using a full VM. Do you have any precise uses cases in mind that can bring some arguments in one way or another? Are LXC more "PaaS" oriented, to run applications…
MorganK
  • 101
  • 1
  • 1
  • 3
8
votes
1 answer

Is it possible to read messages passed over stdout from within a Docker container? (without `docker logs`)

Motivation: To run a basic health-check on a docker container by counting that a certain number of messages flow across stdout over a certain time horizon Immediate goal: From within a shell started by docker exec, read data that is being piped to…
JacobWuzHere
  • 863
  • 7
  • 11
8
votes
3 answers

Change lxc container directory

Can I change the directory where lxc containers are initialized and kept? Now they are created under /var/cache/lxc, and I would like to have them in another directory, on another partition where I have more space. Changint the mounting point of the…
Dumitru
  • 771
  • 2
  • 12
  • 23
8
votes
1 answer

every time when i start a container with docker it gets a different IP

How do I fix a static IP for a container ? First I start a container and inspect it, it says "NetworkSettings": { "IPAddress": "XX.XX.206.98", "IPPrefixLen": 27, "Gateway": "XX.XX.206.105", "Bridge": "public", "PortMapping":…
user3204937
  • 91
  • 1
  • 3
8
votes
1 answer

advantages VM's have over lightweight containers (docker)

I have the following quote from docker's latest release note - Like all major IaaS implementations, Openstack relies heavily on virtual machines. Although there will always be a case for VMs in certain applications, we believe lightweight…
murtaza52
  • 46,887
  • 28
  • 84
  • 120
7
votes
1 answer

How is docker useful for non webapp applications (e.g. Python scripts)? What is the advantage of using it over LXC/LXD?

I am trying to understand how docker is useful outside of the webapp space. If for example someone wants to run a python script which downloads global weather data every 12 hours, why would they use docker? What is the advantage of using docker to…
Greg
  • 8,175
  • 16
  • 72
  • 125
7
votes
1 answer

How to start an LXC container inside a Docker container

How do I start a LXC container inside of a docker container - end to end - with shared networking? Ideally I'd like to do this with Debian or Ubuntu. Some problems I found when trying to do this: lxc-net doesn't start when installed into a Docker…
Jonathan
  • 5,027
  • 39
  • 48
7
votes
2 answers

Efficiently using multiple docker containers in a single host

I have a physical server running Nginx, MySQL and serving my PHP website. The server has Multi-Core processor with 16 GB of RAM. This server can handle certain amount of web traffic. Now instead of this single server, if I run multiple docker…
7
votes
1 answer

Setting absolute limits on CPU for Docker containers

I'm trying to set absolute limits on Docker container CPU usage. The CPU shares concept (docker run -c ) is relative, but I would like to say something like "let this container use at most 20ms of CPU time every 100ms. The closest answer I…
Hamy
  • 20,662
  • 15
  • 74
  • 102
7
votes
2 answers

what will be impacted for compiling code in different kernel in docker?

Can I trust the builds in docker container for redhat6.4 in Ubuntu 14.04 host for c/c++ source codes ? or any limitation I need to consider ? We are trying to use docker to serve different OS platform to compile the source codes, since technology in…
Larry Cai
  • 55,923
  • 34
  • 110
  • 156
7
votes
5 answers

How to use Docker (or Linux Containers) for Network Emulation?

Edit: As of March 2019, although I have not tested it, I believe Docker now has the ability to do real network emulation. Edit: As of May 2015, SocketPlane (see website and repo) has joined the Docker team and they're in the process of integrating…
jpillora
  • 5,194
  • 2
  • 44
  • 56
7
votes
1 answer

Distributed Systems NSQ topology pattern on Docker containers

Is it possible to replicate "NSQ realtime distributed messaging platform" described in the last example of "Topology Patterns" with Docker? Does anybody have a dockerfile or image example?
Luca G. Soave
  • 12,271
  • 12
  • 58
  • 109
7
votes
2 answers

Assigning IP address to docker containers?

I'm new to Docker. Is it possible to assign an IP address (from a DHCP server) to Docker containers running on a host or VM? If yes, can someone point me in the correct direction. If no, is it a fundamental limitation of the container approach or…
Soumya Simanta
  • 11,523
  • 24
  • 106
  • 161
6
votes
1 answer

LXC exec bash ssh-agent forwarding

I have an Ubuntu server. I have configure ssh-agent forwarding to it. The server runs a few lxc containers. When I "lxc exec container bash", the ssh-agent isn't forwarded to the lxc bash. How can I forward ssh-agent to lxc containers bash ?
Laurent
  • 1,048
  • 11
  • 23