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.

0
votes
0answers
18 views

Lxc static private IPV4 for each container

I have installed LXC on my Debian 9.9 host machine. I want to create a script that could be used from my appliacation to manage containers to assign a single static IPv4 to my container so I can NAT ...
0
votes
0answers
15 views

Hosting LXC Linux containers in Azure

We have a number of LXC Linux containers running on a linux host in data center. I was asked to explore feasibility of moving these containers to Azure as part of cloud migration strategy, but I am ...
1
vote
1answer
10 views

How to cleanup network interfaces after an LXC container crashes on startup

Today I modified an LXC container to add an extra "bind mount", but forgot to create the mount directory in the container root filesystem. As a result the container startup failed, and left the ...
1
vote
1answer
20 views

Creating a private image in LXD

I am confused because the command to create an image from a snapshot is called lxd publish. Does it create a publicly available image? How can I create a private image. I want an image with ssh keys, ...
2
votes
0answers
66 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 /...
2
votes
1answer
81 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
70 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
19 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
17 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
20 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
25 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
41 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
40 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
45 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
128 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
90 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
54 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
319 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
61 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
75 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
174 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
171 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
24 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
172 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
116 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
518 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
111 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
78 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
167 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
1answer
80 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
436 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
104 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
283 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
338 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
85 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
6k 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
52 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 ...
2
votes
3answers
4k views

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

I've set up a new Debian 9 (stretch) LXC container on a machine running Proxmox VE, and installed the cifs-utils package. I quickly tested the connection to the SMB server by running smbclient //192....
0
votes
0answers
195 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
2k 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
560 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
265 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
500 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
77 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
484 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
136 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
328 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
197 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
594 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
252 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 ...