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
0
votes
0 answers

Spinning up a container per a user login

Relatively new to containers. Looking to spin up a new Kali container on SSH login with X11 forwarding on user login via ssh - is this possible? objective is to not force users to install their own Kali VM saw dockersh is archived and hasn’t been…
Mike
  • 179
  • 1
  • 1
  • 10
0
votes
1 answer

How to determine the cgroup of a device and give it to a lxc container

I'm new to lxc and cgroups. I'm trying to isolate an app, and building it's container with LXC. So far I'm able to give it some resources such as /dev/tty0 or /dev/fb0. That's fine, however I'm struggling to find how the number of the /proc/*/…
YCN-
  • 203
  • 2
  • 12
0
votes
0 answers

Command lvcreate throwing an invalid flag error?

I'm working on a group project that involves having to use the command lvcreate. When trying to run lvcreate with certain flags, this error message appears (the flags passed in are in the error message): Error: Error Creating LVM LV for new image:…
mparfan
  • 9
  • 1
0
votes
1 answer

LXD / Container / Apache2 / Iptables - Unable to load external sources in website

I have a container setup with LXD running several wordpress webpages (apache2) All is working fine. I added portforwarding by: lxc config device add CONTAINER lxd_proxy_port80 proxy listen=tcp:0.0.0.0:80 connect=tcp:INTERNALIP:80 …and same for port…
Flo
  • 1
  • 1
0
votes
1 answer

Access to USB Ethernet adapter in LXC

I've created a LXC container in Ubuntu 18.04. Physically, there is an USB to Ethernet adapter connected on the host machine. After starting the LXC container, how to access the USB ethernet adapter? Are there configurations for LXC to do? The info…
Rui Huang
  • 382
  • 1
  • 5
  • 18
0
votes
1 answer

Device node in LXC is not accessible when connected via SSH

I have a problem where a physical hardware device passed through to an LXC container cannot be read from or written to when I am connected via SSH. The device node of my physical hardware device looks like this: myuser@myhost:~$ ls -la…
carlfriedrich
  • 2,919
  • 1
  • 15
  • 29
0
votes
1 answer

Not able to execute lxd lxc commands as sudo

Installed juju using following command on Ubuntu 19.04 sudo snap install juju --classic This installed lxd as well. When I try to invoke "sudo lxd -h" or "sudo lxc list" or "sudo juju bootstrap" I get following error message sudo: juju: command…
0
votes
1 answer

Vagrant LXC boxes for download?

I have created a Vagrantfile which uses LXC provider more or less as follows Vagrant.configure("2") do |config| config.vm.box = "fgrehm/trusty64-lxc" config.vm.provider :lxc do |lxc| lxc.customize 'cgroup.memory.limit_in_bytes', '1024M' …
onknows
  • 6,151
  • 12
  • 65
  • 109
0
votes
2 answers

Integrate a Load Balancer IP given by OVH with a Nginx Ingress Controller on a k8s cluster

I have a Load Balancer IP provided by OVH that I want to use with Nginx Ingress Controller but on a on-premises cluster. There are several guide s to do that using OVH Managed Kubernetes but it is not possible for me since I already a cluster. I…
Ferdi777
  • 317
  • 4
  • 14
0
votes
1 answer

Popen with PIPE stdout doesn't exit untill Enter is pressed

When I start a Popen with PIPE stdout, the process doesn't exit untill I press Enter (Windows OS, tested with multiple python and lxc versions) e.g.: import subprocess as sp cmd = ['lxc', 'exec', 'remote:container', '--', 'echo', '1'] with…
Bob
  • 5,809
  • 5
  • 36
  • 53
0
votes
1 answer

How to use lxc exc to issue multiple commands as specific user

My goal is to execute two commands in a specific folder as ubuntu from outside of it's lxc container. I've tried a couple of things but I figured this example is the closest I have to working. If I run root@host$ lxc exec my-containter -- sudo…
fei0x
  • 4,259
  • 4
  • 17
  • 37
0
votes
0 answers

How to redirect http and ssh to other vms based on subdomain?

I have several subdomains: server1.domain.com ----> VM1 server2.domain.com ----> VM2 server3.domain.com ----> VM3 I would like to use traefik in order to create a transparent proxy so that when a HTTP request arrives on the server where…
0
votes
1 answer

Proxy Protocol with NGinx, LXD/LXC and Kong

I have a web app sitting in an Linux Container, The LXD version is LXD 3.13 Web traffic comes in on the host vm (Ubuntu 16.04) and is pushed into the LXC using NGinx, nginx is version 1.10.3 Inside the container I have Kong receiving the traffic,…
fei0x
  • 4,259
  • 4
  • 17
  • 37
0
votes
0 answers

Proxmox, LXC: problems Kubernetes setup

I am trying to get my single node Kubernetes cluster running inside an LXC container. I am running a container with Debian-9.0-standard_9.7-1_amd64 image and docker. (For the setup of docker I followed:…
kevingoos
  • 3,785
  • 4
  • 36
  • 63
0
votes
1 answer

Cannot create or touch file inside LXC container

Hi I have some problems with my LXC containers. If I run .sh script one, it does not create file in container, but the path exists. Sometimes, when I execute script several times, its working, i don`t know why. Result: mkstemp: No such file or…
Kamil P.
  • 11
  • 2