Questions tagged [lxc]

LXC short for (Linux Containers) LXC is an operating system-level virtualization method for running multiple isolated Linux systems (containers) on a single control host. LXC is the userspace control package for Linux Containers, a lightweight virtual system mechanism sometimes described 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 newer kernel versions. 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

420 questions
3
votes
2 answers

How do I change default MTU for lxdbr0 for containers created using LXD?

I'm running Linux containers created by LXD on Ubuntu 14.04.05. I have a lxdbr0 interface setup, but its default MTU is 1500. How do I update it?
bits
  • 131
  • 4
3
votes
2 answers

How to build a custom LXD image from install ISO

I have an operating system installation ISO. My goal is to run the second operating system on top of the kernel of Ubuntu host running LXD. I cannot find any base image for the said operating system. Is it possible for me to build a custom lxc image…
John Mayer
  • 31
  • 1
  • 1
  • 3
3
votes
0 answers

Libvirt LXC leaked processes

I'm trying to run several lxc containers on an ubuntu 16.04 server. (libvirt version is 1.3.1). The nature of my team's use of these containers means that they are constantly booting and then being destroyed, and we manage this lifecycle using the…
SwampDragons
  • 111
  • 1
  • 5
3
votes
1 answer

How to publish an LXC image to a private server

I have set up a development environment in a container that I want to share with co-workers. I set up a server and configured it with lxc remote add the_server_name 192.168.1.99 --public, being that the server name and IP. What is the correct on my…
3
votes
2 answers

Amazon EC2/VPC LXC Bridge not working

On an AWS EC2 instance I like to host LXC containers as kind of virtual servers. I created a bridge (br0) containing only eth0 and gave it the private ip of my VPCs subnet. I reconfigured LXC not to use lxcbr0 as bridge, but my br0 device. When I…
devnull
  • 193
  • 5
3
votes
1 answer

Why LXC requires restart?

LXC documentation says: Just before you create your first container, you probably should logout and login again, or even reboot your machine to make sure that your user is placed in the right cgroups. Can somebody explain why this is required to…
Jacek L.
  • 131
  • 2
3
votes
3 answers

How to shrink the disk of a LXC container on Proxmox 4?

I would like to shrink the main disk of a LXC container on a Proxmox VE 4.2, from 30GB to 20GB for instance. Shrinking seems not to be supported yet : $ pct resize rootfs 20G unable to shrink disk size Any ideas on how to accomplish this ?
marc
  • 143
  • 1
  • 1
  • 3
3
votes
2 answers

LXD 2.0 on Debian 8.4

I'm running Debian 8.4 and would like to set-up recently released LXD 2.0. Is this feasible, or should I stick with LXC? It seems all focus is on using LXD with Ubuntu.
Jay
  • 199
  • 1
  • 9
3
votes
2 answers

Where are network namespaces in lxc / lxd?

I am trying to understand namespaces in the context of lxd / lxc. I have two containers which respective eth0 is bridged to br1 and br2 on the host. This is done via a Virtual Ethernet interfaces root@srv:~# ip link (...) 5: br1:…
WoJ
  • 3,607
  • 9
  • 49
  • 79
3
votes
1 answer

CGroups memory limit not working

I am trying to limit memory usage for a LXC container using CGroups, but I can't limit the memory. # lxc-cgroup -n maxdaniel981 memory.limit_in_bytes 134217728 lxc_container: failed to assign '134217728' value to 'memory.limit_in_bytes' for…
maxdaniel98
  • 103
  • 2
  • 11
3
votes
3 answers

How to make lxd containers accessible to the LAN

If I use Virtualbox to spin up a VM, I can select "bridged" as the network adapter type and this results in the guest/virtual NIC being connected to my physical LAN and hence getting a LAN IP from my router (via DHCP). I want to achieve this same…
pleasedesktop
  • 201
  • 1
  • 4
  • 9
3
votes
0 answers

LXC bridge with several IP addresses

While trying to setup a small server with LXC containers, I encountered a problem: I want to assign 4 different IP addresses: 1 address for the host and 3 addresses in a different net for the containers. Setting up 4 IP addresses using virtual…
user2092982
  • 31
  • 1
  • 1
  • 7
3
votes
3 answers

How to use Ansible to manage remote lxc containers?

How can I use Ansible to execute tasks on lxc containers on a remote server? We use Ansible to deploy our code on several servers (physical and virtual machines). Until now, every instance had a public ip address and a running ssh server, so…
Thibault J
  • 131
  • 1
  • 5
3
votes
1 answer

Add a second disk image to a LXC container in Proxmox 4

My LXC containers in Proxmox 4 have a root filesystem stored on the host as a RAW disk image stored in : /var/lib/vz/images//vm--disk-1.raw This folder on the host computer is from an ext4 partition : /dev/mapper/pve-data on…
3
votes
1 answer

Bash shell script executing out of order when passed over stdin to LXC container

I am passing the following simple shell script to bash on an LXC container: apt-get update apt-get install postgresql -y sudo -u postgres psql -c 'create database dvdrental;' The actual command I'm using to run it is: cat sample.sh | lxc-attach -n…
Soviero
  • 4,366
  • 8
  • 36
  • 60