Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

[ubuntu] LXC commands hang

$
0
0
I am trying to work with LXC to set up containers for web servers. I'm running into two problems which I suspect are linked. The first is that LXC commands often hang. For example, if I run

sudo lxc-create -n Server -t ubuntu -d
sudo lxc-start -n Server

This creates a container, called Server, which I can connect to. So far, so good. However, if I stop the container and then try to start it again

sudo lxc-stop -n Server
sudo lxc-start -n Server -d

The lxc-start command hangs. The container does not appear to be running and the lxc-start command does not return. I am unable to connect to the container using lxc-console. In fact, any lxc- commands will hang if I run them at this point. I have found if I reboot the machine and run lxc-start again it will usually run the container properly, until I try to stop the container or change its configuration.

I'm running Ubuntu 12.04 (both 32-bit and 64-bit). I have tried using LXC on two different machines, both run into the same problem where containers hang until the machine is rebooted.

I have two questions:
1. How can I work around the containers hanging when I try to stop/restart them?
2. What is the easiest way to set up Bridged networking to a container. I've read several tutorials and all of them are really vague on this point. It seems there are a lot of configuration files which alter how containers handle networking and I'm not sure which one (or which ones) would provide the easiest path to bridged networking.


Edit: I have figured out a few things. The first is that if I don't make any configuration changes to LXC on the host, the hang-up doesn't happen. Or at least it hasn't happened again so far. As long as I do all of my configuration within the container it seems to be okay and the LXC container runs. The second thing is the LXC container was trying to use a IPv6 address. My network is exclusively IPv4. Once I forced LXC to use a IPv4 address I was able to connect.

Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>