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
1 answer

Mounting a network file system inside LXC on Ubuntu 12.10

On an Ubuntu 12.10 server, I created an Ubuntu cloud lxc container. In the /var/lib/lxc/MY_CONTAINER/config file, I uncommented the line: lxc.aa_profile = unconfined and started the container. Inside the container, I try to mount a cifs file…
3
votes
1 answer

OpenVZ has vzctl exec, what is the equivelent for lxc

I'm switching from OpenVZ to lxc. The one thing that is really bugging me is that I can't find a lxc alternative to vzctl exec. Before on OpenVZ I could do vzctl exec 1033 restart nginx. Now, all I can figure out to do is either run sshd in every…
3
votes
1 answer

Link all LXC node APT caches to the host machine's APT cache

I have a number of LXC containers (ubuntu template) which all have their own separate APT caches. /var/lib/lxc/*/rootfs/var/cache/apt/archives/ I would like to have these linked to the host machines APT cache at: /var/cache/apt/archives From what…
Adam Eberlin
  • 785
  • 7
  • 11
3
votes
1 answer

"mount error(13): Permission denied" only in LXC container for CIFS/Samba share

I have a samba share that mounts just fine under the Ubuntu 12.04 host: root:~# mount -t cifs -o credentials=/var/lib/lxc/vpn/rootfs/etc/samba/desktop.credentials //desktop/Media /media/Media But when I try to do the same mount in an LXC container,…
Ross Patterson
  • 149
  • 2
  • 8
3
votes
2 answers

fail2ban on server with LXC Containers

The issue is modprobe and iptables don't work inside an LXC Container. LXC is the userspace control package for Linux Containers, a lightweight virtual system mechanism sometimes described as “chroot on steroids”. iptables error inside the…
RoboTamer
  • 502
  • 1
  • 4
  • 17
3
votes
1 answer

SSH traffic redirect for LXC containers

I use LXC containers for ssh hosting and I would like to redirect SSH/SFTP traffic (using port 22) to the container's private IP address but on a user/IP basis. That is - one source port, many destinations. ssh ahes@server.com we have user 'ahes',…
ahes
  • 95
  • 1
  • 2
  • 10
3
votes
0 answers

User not recognized by underlying authentication

I'm running lxc on Linux Mint Debian Edition tracking Wheezy/Sid. I created a container using "lxc-create -t debian -n dev". In accordance with the Debian wiki article on LXC I have mounted the cgroups file system as /cgroup and have added…
Beau
  • 131
  • 1
  • 3
3
votes
3 answers

LXC container templates?

Is it possible to create an LXC container that you maintain only for the purpose of copying as a template? If so, how does one properly copy an LXC container?
3
votes
1 answer

With CentOS 6 and LXC, "ifconfig" is unable to see network interface (but busybox "ifconfig" works fine)

I've just started working with LXC under CentOS 6 (via the libvirt adapter). If I create an LXC container, I'm unable to see any network interfaces when using the native system tools: # ifconfig -a # The behavior is very odd; specifying an…
larsks
  • 43,623
  • 14
  • 121
  • 180
3
votes
2 answers

How to route host traffic over lxc?

Some info updated: Last login: Wed Aug 31 18:10:24 2022 root@pve:~# ip route default via 192.168.132.1 dev vmbr0 proto kernel onlink 192.168.132.0/24 dev vmbr0 proto kernel scope link src 192.168.132.4 root@pve:~# root@pve:~# ping 10.0.0.26 PING…
Ken Kin
  • 31
  • 5
3
votes
1 answer

vmalloc allocation failure when scaling LXC containers past 1350 on Proxmox 6.2

I have a server of the following spec: Dual AMD EPYC 7742, 1TB RAM, 8TB SWAP (Round-robin 8xNVME array), 144TB SSD Storage (72 drives over 10 zpools) uname -a Linux host 5.4.44-1-pve #1 SMP PVE 5.4.44-1 (Fri, 12 Jun 2020 08:18:46 +0200) x86_64…
joinsplit
  • 31
  • 4
2
votes
1 answer

libvirt-lxc container on Debian buster with user namespacing not always startable

I have a bunch of libvirt-lxc containers whose configuration I migrated from Debian jessie to a fresh Debian buster host. I re-created the rootfs’ for the containers using lxc-create -t debian -- --release buster and later remapped the uid/gid…
Jonas Schäfer
  • 325
  • 1
  • 11
2
votes
0 answers

Sending tagged traffic to lxc container while sending untagged traffic to other containers

I have a situation where I already have several bridges on my lxc host to send vlan-specific traffic to my various containers. I have one container that lives on several of the networks, and was curious if it's possible to send traffic to this one…
kolbyjack
  • 8,039
  • 2
  • 36
  • 29
2
votes
0 answers

Libvirt lxc-enter-namespace with mapped uid/gid

I'm trying to implement LXC with mapped uid/gid (user namespace) under Libvirt on CentOS 7 with full separate root mounted. Libvirt config snippet
Dima
  • 21
  • 1
2
votes
1 answer

Is lxd/lxc a suitable replacement to virtual machines (vSphere, for example) for server infrastructure?

I would like to move my servers to virtual machines. This is because it'll make it easier for me to fire up more machines and back them up in case the physical server is damaged (I'm not aware of other benefits). While I use virtual machines…
The Quantum Physicist
  • 658
  • 2
  • 11
  • 26