Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [lxc]

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. Note: the 3 letters "lxc" command is part of LXD, not LXC. Please use the LXD tag if your question is about LXD rather than only about LXC.

2
votes
0answers
35 views

Restrictions on pivot_root to switch root filesystem

This question is a follow up to the question I asked on how LXC setups up its root mount point. For a container named testcontainer, LXC uses bind mount to mount /var/lib/lxc/testcontainer/rootfs to /...
1
vote
1answer
52 views

How does LXC setup its root mount point?

I am trying to experiment with mount namespace in Ubuntu. So far I can create an empty mount namespace using the following: # mkdir test # unshare --mount # mount none test -t tmpfs # cd test # ...
-1
votes
1answer
32 views

How to route between two bridge interfaces?

So I have a total of two bridges. One has the 10.0.0.1/24 subnet (br0), and the other has the 10.1.0.1/8 subnet (br1). I want to setup an NGINX reverse proxy that would run on a container connected ...
1
vote
1answer
10 views

Execute command with LXC on remote host

I know I can use lxc exec remote:container -- command to execute commands on containers living on remote servers. But, is it possible to execute a command on the remote host instead: lxc exec remote -...
0
votes
0answers
12 views

LXC import storage

lxc storage seems exclusively about creation and deletion. For example, if I try to use create with btrfs and the device already has an existing btrfs filesystem on it, I get an error percolating up ...
0
votes
1answer
15 views

Is it possible to set the IP address when launching a container?

I’m looking for examples how to create/launch a container with a predefined ipv4.address? Is that even possible? I've tried with lxc launch image name --config 'eth0.ipv4.address=10.0.2.2' Though ...
0
votes
0answers
21 views

Container: lxc-execute fails to start with libcap read error

When using lxc 2.0.6 version to start unpriviliged container with lxc-execute in embedded linux.Container is failed to start. We have enabled lxc.cap.keep in lxc configuration. init.lxc.static is ...
0
votes
0answers
27 views

How do I make public on the physical network a local virtual bridge

I'm using Ubuntu (Bionic, 18.04) both on remote servers and on my laptop. In wide scope, I am trying to provide direct network access to VM, currently it works via NAT (with port forwarding). libvirt ...
1
vote
0answers
35 views

Copying files out of LXC container without starting it

Is there a way to copy files out of an LXC container without starting it? The context for this is that I'm using Crostini on my ChromeOS device. Crostini is a VM that allows you to run LXC containers ...
1
vote
1answer
37 views

Unable to delete directory, imutable flag is not set, not mounted

So i have this directory that causes a lot of problems when trying to delete lxd via snap. The directory in question is /var/snap/lxd/common/lxd/storage-pools/default/. If I try to delete it with sudo ...
0
votes
0answers
59 views

How to set up working uid/gid allocations for LXC/LXD/Vagrant?

What I've tried: $ vagrant up --no-provision Bringing machine 'default' up with 'lxd' provider... ==> default: Machine has not been created yet, starting... ==> default: The host machine does ...
4
votes
1answer
61 views

How do I find all interfaces that have been configured in Linux, including those of containers?

I know that you can display interfaces by doing ip a show. That only displays the interfaces that the host can see, but virtual interfaces configured by containers don't appear in this list. I've ...
0
votes
2answers
28 views

How to trust self-signed LXD daemon TLS certificate in Vagrant?

Following up from another question I've got the LXD daemon running and working: $ curl --insecure https://127.0.0.1:8443 {"type":"sync","status":"Success","status_code":200,"operation":"","error_code"...
1
vote
1answer
138 views

How do I configure unprivileged Linux containers?

I'm trying to set up unprivileged LXC containers and failing at every turn. I think I've followed every relevant step of the guide: Normal users are allowed to create unprivileged containers: $ ...
1
vote
1answer
36 views

Expose mount from LXC to host

I am working with a proprietary POSIX client to mount a network directory. The packages provided by the vendor are horrible (e.g., post-install that does ln -sf /usr/bin/fusermount?!), so I'm trying ...
0
votes
0answers
49 views

how to ssh into a lxc-container

I need a user that connects to my host with ssh, which is forwarded into a lxc-container. My solution is: Match User monitoring ChrootDirectory /data/foreign_projects/monitoring ForceCommand lxc-...
0
votes
2answers
91 views

How to implement iptables on lxc-container?

I installed lxc-container (fedora 29 amd64) on my ubuntu 18.04 system. The linux container had no firewall command line tools. Therefore I installed iptables into my container and it installed ...
2
votes
2answers
110 views

Container with network interface but host without, how to expose eth0 to container

I am building a system with a read-only rootfs. This rootfs is shared between the host and created containers. The host cannot have any network related service or file and that means I cannot bridge ...
0
votes
0answers
16 views

How do I do I connect a block device to a privileged lxc container at start?

I'm looking to install RADOS osds in privileged lxc containers and I'm having trouble setting up the block devices. I need /dev/sdb, etc. to be connected at container start, before the RADOS osd ...
0
votes
0answers
125 views

lxc container has internet access, how to access internet from host

I have a requirement that networking has to be managed by lxc container, so the Ethernet interface(eth0, which is the source of internet) is assigned to container. I am able to ping "8.8.8.8" from ...
0
votes
1answer
80 views

Source NAT rule for LXC containers

I've just noticed that MASQUERADE iptables rule added by lxc has ! -d part: iptables -t nat -A POSTROUTING -s 10.0.3.0/24 ! -d 10.0.3.0/24 -j MASQUERADE My guess is that -s 10.0.3.0/24 -d 10.0.3.0/...
1
vote
1answer
290 views

How to route traffic from br0 to tun0 when tun0 is not the default route of the system

I have a bridge network br0 that has the IP 10.0.0.1/24, I have a client connected with the IP 10.0.0.2 to it. I also have a VPN connection (tun0) that has an IP assigned by an DHCP, so it's IP may ...
0
votes
0answers
68 views

Cannot start lxc container as non-root user

When I try to start a container it fails: # lxc-start -n mycont4 --logpriority debug --logfile /tmp/basta.log -F lxc-start: cgroups/cgfs.c: lxc_cgroupfs_create: 909 Could not set clone_children to 1 ...
0
votes
0answers
60 views

How can I install xfce4 without a local X server?

I'm looking to get the xfce desktop environment running on a (remote) server - specifically, inside a Debian LXC container. The server itself is headless, and the environment will only ever be ...
1
vote
0answers
130 views

How to manage users and passwords in LXC containers?

Example Container created (no matter if Ubuntu or Debian, the problem is the same) and running. New non-privileged user created inside the container (# useradd -m newUser -p newPass108). It is ...
0
votes
0answers
55 views

How can I debug lxc-create config file?

I use lxc-create -n Test -f t -t busybox to create a lxc-container on Archlinux, just get an error Error creating container Test nothing else. The template lxc-busybox comes from the lxc package ...
1
vote
2answers
305 views

How to run ntpd as a server only, without adjusting local machine time, under LXC

I have a need to point devices to sync their clocks to my CentOS-7 server running inside LXC. On the server I'm trying to use ntpd from ntp package, but open to other products. This question is about ...
3
votes
1answer
82 views

LXC: systemd fails after the 19th container

I am running LXC on Archlinux. I have a combination of Arch, Fedora, Centos, Debian, and Ubuntu LXC containers, each based on systemd. If I try to open more than 19 LXC containers, the 20th ...
2
votes
1answer
240 views

LXC container network speed issue

I am running openstack on LXC container and i found inside my LXC container network is very slow but from host its very fast HOST [root@ostack-infra-01 ~]# time wget http://mirror.cc.columbia.edu/...
0
votes
1answer
254 views

Why could a call to `getaddrinfo()` fail with `EAI_SYSTEM` and errno set to `EBUSY` (“Device or resource busy”)?

I'm seeing this error when running apt update in containers, if that is useful information. apt spits out: System error resolving 'archive.ubuntu.com:80' - getaddrinfo (16: Device or resource busy) ...
1
vote
0answers
81 views

Ansible: failed to ping a linux container

Continuig with my ansible learning, I already fixed how to Ansible: How to parse an inventory source but now I ran into a new problem. He executes the following 2 commands (but im not sure if he does ...
1
vote
2answers
4k views

Ansible: How to parse an inventory source

I'm following an Ansible tutorial I got from Packt, I reached this part where I've created 3 Ubuntu containers (lxc) and got them up and running. I'm also able to login to each of them. I've ...
0
votes
0answers
49 views

LXC is messing up the DHCP requests of my LAN

First of all I have to say Im not familiar with LXC. The developer team setup LXC on a server. There are a bunch of containers there and everything works well. There is also an internal bridge with ...
0
votes
3answers
3k views

Why do I get ”mount error(1): Operation not permitted“ on ”mount.cifs“ in a Proxmox LXC container?

I've set up a new Debian 9 (stretch) LXC container on a machine running Proxmox, and installed the cifs-utils package. I quickly tested the connection to the SMB server by running smbclient //192.168....
0
votes
0answers
172 views

Recover deleted container or snapshop from ZFS

I am using LXD to manage Linux containers, and deleted a running container using lxd delete --force test. LXD is using a ZFS pool. The container was snapshoted periodically, is it possible to recover ...
0
votes
0answers
190 views

Getting a predictable IP in LXC guest running Ubuntu bionic

I have two (unprivileged) LXC guests running Ubuntu xenial and Ubuntu bionic both installed and configured in the same way (at least I thought so). The xenial guest works as expected always gets the ...
1
vote
1answer
1k views

Internet access from LXC containers in proxmox 5.1 on VirtualBox

I've installed a Proxmox VE 5.1 on a VirtualBox in macOS (10.12). The guess OS, Debian Strech (Proxmox is built on debian), has 2 "physical" network interfaces (configured from VirtualBox), Host-Only ...
0
votes
0answers
511 views

NFS mount on LXC container

I have been testing NFS mounts on LXC containers and they work mostly ok after you have modified App-Armour settings on the host. Problems arise when the LXC containers are moved or host-node restarts....
0
votes
0answers
252 views

Automatic startup network interface in LXC container

I have a fedora 27 LXC container inside a proxmox VE 5.1 The network config is working fine, I've added a Linux Bridge using the subnet 172.27.1.0/24 and the container is "connected" to the network. ...
0
votes
2answers
456 views

Format a raw image to XFS in Proxmox VE

I have a system with Proxmox VE 5.1 and a LXC container with Fedora 27. The container has 2 disk (raw format), the rootfs and an additional mount point, both of them are in ext4, I want to format to ...
0
votes
1answer
66 views

Why can some container ping an interface of the host which is not inside same lan?

I have a lxc-container with eth0 and ip 172.17.0.2/16. The host has a bridge br0 with 172.17.0.1/16. Both can ping each other. Further the host has a vpn wg0 and ip 172.16.0.1/16. If I ping from ...
1
vote
0answers
457 views

Assigning an ipv4 address to (LXD) linux containers

I've got a home server running with a bunch of linux containers and they're all getting their ip addresses assigned automatically via dhcp on my router. I'd like to be able to assign ip addresses ...
1
vote
1answer
131 views

ip address “@” (at) in output

I'm having hard time reading the output of ip a command. Normally it prints something like this: 3: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP ...
0
votes
0answers
283 views

lxc_container: Permission denied

I have unprivileged LXC's setup on my server, when trying to start one of my LXC's I get this error: lxc@web3:/sys/fs/cgroup$ lxc-start -n brainfever WARN: could not reopen tty: Permission denied ...
0
votes
0answers
182 views

Allow unprivileged LXC container to shutdown the host

I am running a KVM-QEMU VM inside an unprivileged LXC container. The customer requested that when a user shuts down the VM, the entire host shuts down. I am using a libvirt hook to shutdown the LXC ...
3
votes
0answers
543 views

“su: must be run from a terminal” with lxc

I am trying to understand the following error and the solution I connect to the lxc container with the following command #lxc exec cont-01 -- sudo --login --user ubuntu and after login in on the ...
0
votes
1answer
235 views

How do I compare mlocate.db to what exists now?

I ran rm -rf on /var/cache/lxc, not realizing it was full of symlinks. I've lost a bunch of files, including most of /dev. I have a mlocate.db from 16 hours ago. How do I compare the list of files ...
0
votes
1answer
248 views

Missing cgroup hierarchy in LXC container

Armed with this LXD configuration: raw.lxc: |- lxc.mount.auto = cgroup:mixed A 4.x kernel, and no AppArmor. I should see the cgroup hierarchy in my guest os under /sys/fs/cgroup right? Instead, I ...
1
vote
0answers
414 views

LXC does not stop, Failed to connect to bus

I just created a new LXC with the following command: lxc-create -n ${NAME} -t download I choosed debian, stretch and amd64 as characteristics. I'm using the LXC in unprivileged mode with UID/GID ...
0
votes
2answers
1k views

High IO on KVM/LXC host will hang server but not on guest (Proxmox/Debian)

I have problem for past several months which was progressively getting worse and now I'm in state that if I try to do almost any intensive IO operation on my visualization host (Proxmox ve 5.1-41) ...