Questions tagged [lxc]
The LXC tag is for questions relating to LinuX Containers and lightweight virtualization capabiliaties, issues, and troubleshooting.
441
questions
53
votes
1
answer
18k
views
How do I configure juju for local usage?
I'm too cheap to pay for EC2, and I don't have enough servers to set up my own openstack, how do I configure juju to use Linux Containers (LXC) on something like my laptop?
38
votes
3
answers
51k
views
What is LXC and how to get started?
I will appreciate if someone could introduce me to LXC and tell me how to get started with this technology? In which cases does it make sense to use, and in which should i stay away from it?
28
votes
3
answers
19k
views
Public IP Address for LXC container
Ok, so I want to know how to do networking on LXC containers. Not just the sort of vague information you get from the other websites, but a true beginner's guide to making them work.. Since most ...
22
votes
11
answers
37k
views
How do I get the IP address of an LXC container?
I've written a few scripts to manage LXC containers, and I can get their IP addresses via ifconfig, assuming I'm connected to the console.
I now want to connect to these containers via ssh. How do I ...
21
votes
5
answers
45k
views
Adding a shared host directory to an LXC/LXD Container
I have been experimenting with LXC/LXD on Ubuntu 14.04 and it's all working great. I just need to figure out how to get shared directories working between my host machine and a container so I can ...
20
votes
5
answers
64k
views
How do I share a directory between an LXC container and the host?
How can I share a folder between the host system (ubuntu 14.04) and an ubuntu lxc container?
I tried mounting the folder on the host:
sudo mount --bind /media/data/share /media/data/container/name/...
17
votes
4
answers
25k
views
What should i choose? LXC vs OpenVZ [closed]
As an alternative to Virtualizing several Ubuntu Servers im looking into the possibility of using containers. But I am not sure if I should go for OpenVZ or LXC. Can anyone recommend one of them, or ...
15
votes
6
answers
31k
views
Change data directory of Docker
How can I change the data directory of Docker where docker save the container (or where lxc save the container)?
I have in my server a ssd and a hard drive ant I want that the container will be save ...
15
votes
3
answers
50k
views
How do I setup an LXC guest so that it gets a dhcp address so I can access it on my network?
I setup LXC using:
lxc-create -t ubuntu -n lxcguest1
But I can't access any services running on it from my LAN, it appears to be NATed. How do I set it up so that I can access it (it probably needs ...
13
votes
1
answer
19k
views
Can't remove core18 snap
I am cleaning up my fresh Ubuntu 20.04 install and I can't seem to remove core18 snap.
$ snap list
Name Version Rev Tracking Publisher Notes
core18 20200427 1754 latest/stable ...
13
votes
2
answers
13k
views
How do I install a kernel module in an LXC guest machine?
I am attempting to install OpenStack DevStack on an LXC guest machine. One of DevStack's packages requires a new kernel module, but when I try to run modprobe on the LXC guest I get an error:
ubuntu@...
12
votes
6
answers
30k
views
How to let built-in DHCP assign a static IP to LXC container based on name, not MAC address
I know, that I can assign static IP manually, using /etc/network/interfaces.
I also know, that I can read the MAC address of the LXC container (e.g. by looking for lxc.network.hwaddr entry in /var/...
12
votes
5
answers
35k
views
How to log into lxc container?
I recently installed the 32 bit lxc container on a 64 bit Ubuntu 12.04 system.
When I run the command sudo lxc-start -n my32bitbox I am greeted with a login prompt. I
enter the default login and ...
12
votes
2
answers
36k
views
What are root and Ubuntu password in LXC ubuntu:16.04 container?
I created a Ubuntu container
lxc launch ubuntu images:ubuntu/xenial mycontainer
I can access the container using
lxc exec mycontainer bash
I found mysel logged in as root without asking any ...
11
votes
1
answer
19k
views
system does not fully support snapd: cannot mount squashfs image using "squashfs - mount failed
I'm attempting to install PowerShell on my Ubuntu instance using snap, but it generates an error:
# sudo snap install powershell --classic
error: system does not fully support snapd: cannot mount ...
10
votes
3
answers
7k
views
Is there a way to configure lxd containers with cloud config at provision time?
Specifically, with the CLI tools- not openstack.
I'm looking at what a local dev setup with lxd might look like but am coming up empty handed when it comes to configuring new containers.
Are there ...
10
votes
1
answer
18k
views
Allow loop mounting files inside LXC containers?
I'm trying to set up a MaaS server inside an LXC container.
When I import the PXE files, it needs to be able to mount loop devices.
I have set the following options in the container config file to ...
10
votes
3
answers
2k
views
How can I run a Snappy / ubuntu-core image with LXD
I would like to run Ubuntu Snappy in an LXC container.
There isn't an existing snappy image at the default https://images.linuxcontainers.org repo, but I was wondering if this is something others ...
10
votes
1
answer
8k
views
DNS works with host, but not with wget
TL;DR
I've got a strange situation where I can do DNS lookups on some hosts but not others. This seems to be related to resolv.conf having one nameserver entry pointing to my nameserver and another ...
10
votes
1
answer
1k
views
A Linux container can use an authorized_keys file outside my home directory, but ephemeral containers based on it can't. Why?
In Ubuntu 12.10, I've created an LXC of type 'ubuntu' using the lxc-create utility. I then create ephemeral containers based on this container using the lxc-start-ephemeral utility, and I need to ...
9
votes
3
answers
10k
views
How do I allow /dev/net/Tun in a LXD managed LXC container?
I am trying to get Openvpn run inside a LXD/LXC container, and redirect traffic coming to the container to the VPN.
The purpose is to replace a fully fledged VM that does exactly that (and toy with ...
9
votes
1
answer
3k
views
Snap vs system container
I have seen this: what's the main difference between Docker and Snap?
I don't quite see the difference between snap and system containers.
VM has a separate Linux kernel and used fixed host ...
9
votes
1
answer
5k
views
AppArmor denying a mount operation
How do I convince apparmor to allow this operation?
[28763.284171] type=1400 audit(1344273461.387:192): apparmor="DENIED"
operation="mount" info="failed type match" error=-13 parent=7101
profile="lxc-...
8
votes
2
answers
6k
views
lxc 3.0.2 equivalent of lxc.network.type = veth
I have reinstalled from ubuntu 16.04 to 18.04.
My lxc container config had the following line:
lxc.network.type = veth
It no longer seems to work:
lxc-ls -l DEBUG -f
lxc-ls: confile.c: ...
8
votes
3
answers
3k
views
How do I "clean up" a machine after using the local provider?
I'm doing some testing and sometimes I have issues with containers and juju. How do I clean up a machine so that I can start using the local provider "from scratch" without reinstalling?
8
votes
1
answer
6k
views
Where are lxc containers security borderlines?
My question is around the security of an LXC container.
If I am running multiple containers on my box, and give users a separate ssh access to their owned container, can any of those container hack ...
8
votes
2
answers
9k
views
How can I kill a stuck LXC container?
I have a new unprivileged LXC container that I just cannot seem to stop. lxc-stop -n dl hangs. lxc-stop -k --nolock -n dl hangs. lxc-ls hangs. lxc-attach -n dl hangs. Nothing works on this container.
...
8
votes
2
answers
1k
views
What is the workaround for LXD-nested pivileged docker (/dev/.lxc/proc/ error)?
Launching a privileged docker container in an LXD fails with this:
docker: Error response from daemon: linux runtime spec devices: lstat /dev/.lxc/proc/1482/fdinfo/12: no such file or directory.
...
8
votes
1
answer
1k
views
How can I relaunch juju daemons without stop/starting local LXC containers?
I'm using juju in local mode with LXC.
I updated juju on the host with a classical:
apt-get install juju
And had a plentyful of python errors in juju debug-log probably because juju processes ...
7
votes
2
answers
36k
views
How to fix "docker: Error response from daemon: cgroups: cannot find cgroup mount destination: unknown." on `docker run`?
I have Ubuntu 16.04.6 LTS installed.
Previously I have installed Docker from its repository as docker.io package.
Yesterday I have installed LXC with LXD and I suppose that they have some problem ...
7
votes
3
answers
35k
views
Where are the LXC container configuration files located?
I am working with LXC containers and I am attempting to setup a network configuration but I cannot locate the configuration file. Every piece of documentation or answered question has been for older ...
7
votes
3
answers
5k
views
LXC Containers & Bridge Connection
I need Step by Step Configuration to make LXC Containers in Ubuntu
right way to configure Lxc container's
right way to config cgroup
right way to config network in host & in container
...
7
votes
1
answer
3k
views
Problem setting up a user-space LXC container
Several evenings, I already try to get an LXC installation working with user-space containers. Since it's going to be a new server, I don't care (yet) too much about distribution and release, so I ...
7
votes
1
answer
3k
views
It is possible to hibernate an LXC container?
I know about lxc-freeze and lxc-unfreeze, but as I understand it, these simply pauses the container, similar to sending SIGSTOP and SIGCONT to a process. If I reboot the host, then the containers will ...
7
votes
4
answers
15k
views
Running Ubuntu Desktop in LXC/LXD on top of Ubuntu Server
Is it possible to have Ubuntu Desktop running in an LXC/LXD container on top of Ubuntu Server, displaying Ubuntu Desktop's graphical X session on the physical screen that Ubuntu Server outputs to?
...
7
votes
1
answer
4k
views
Running X/Unity inside LXC container
I have already created a number of LXC containers in my 12.04 machine. I need to run GUI applications inside them (mostly Firefox).
Is it correct to presume that it will work out of the box? If not, ...
7
votes
1
answer
5k
views
Allow a LXC container user to write as an external user to a mounted directory
Apologies for the title, the setup is actually quite simple. I have a host with a user called oli and a directory called /media/steve/incoming that oli can read-write-execute in. Within that I have a ...
7
votes
1
answer
313
views
What are the absolutely bare minimum requirements for running local juju?
I have read the documentation on running local juju with lxc. However, the dependencies in the docs seem kind of extensive for that, eg. why would it need libvirt (except for maybe the bridge nic ), ...
7
votes
3
answers
3k
views
Is it possible to run some application in the chroot or container but allow DBus interaction with host system?
I need to run old version of application in chroot (or container) and allow DBus interaction with host system. I can't install this application on host system because of serious dependency problems.
...
6
votes
1
answer
7k
views
UFW is not working in an LXC container
I've created an LXC container on Ubuntu Server 14.04.1 using the default template.
I log into it, and run the following commands:
sudo apt-get update
sudo apt-get install ufw
sudo ufw allow 22
At ...
6
votes
8
answers
5k
views
How do I get the IP address of an LXC container for automation?
How can I get the IP address of an LXC container in a format I can use in scripting?
Right now, the command lxc info <container> report that information, but in a human readable format, with a ...
6
votes
1
answer
8k
views
Port forwarding between bridged interfaces
So I have a bunch of bridge interfaces bound with my main ethernet device (em1, blame HP). These serve various LXC containers I have running on my server and easily allows me to access them from other ...
6
votes
2
answers
6k
views
Start a screen session inside LXD-managed container
I'd like to start a screen session inside an LXD-managed container so that I could detach running processes and maybe re-attach in the future when I want to check on their status.
I tried to attach ...
6
votes
1
answer
6k
views
How to install ubuntu server for lxc on a smartphone (ARM or x86, bare metal)?
As of May 2019 what are the options (if any) to install Ubuntu server on a smartphone device?
I don't need much of the smartphone functionality, I don't need desktop and touchscreen blows and ...
6
votes
1
answer
3k
views
LXC/LXD as Debian package
Installing LXD from APT installs it as a Snap package and while LXC programs are installed from a Debian package, running them tells me I need to install the LXD snap. Is there anyway to install LXC ...
6
votes
2
answers
2k
views
How do I open an existing LXD container?
I have Ubuntu 16.04 installed, xfce desktop for what it's worth. I have LXD installed, with my images and containers on my large second drive, with symbolic links to said images and containers ...
6
votes
1
answer
415
views
Libertine container sound does not work on one machine, works on another
I have two machines under my purview, A and B. B is a very old machine, I've installed apps in Libertine on it, and sounds work perfectly well. On the other hand, on machine A, sound does not work for ...
6
votes
2
answers
5k
views
Modifying sysctl values inside lxc container
I have made several linux containers using the normal userspace tools (not docker), and I have been setting up a test environment.
I want to set up two containers to try out heartbeat, which requires ...
6
votes
1
answer
741
views
juju bundle deploy in one machine in LXC?
Hi So far i have developed juju charm bundle which contains three charms.I have Two Questions (Q1) And i need to deploy juju charm bundle in one machine in LXC. i have three charms and normally when i ...
6
votes
2
answers
1k
views
Boot problems after installing package `android`. How do I fix it?
I was thinking to play with my android phone through usb, so I did an apt-get install android* on my laptop. This this broke my boot. I can not boot it normally, but if I go into recovery and then ...