I have an Ubuntu 14.04.1 LTS server that's running LXC containers. The containers run Ubuntu 14.04.1 too. Network config of host is pretty standard, static IP, ISP's DNSes (IP1/IP2) plus google's :

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#iface eth0 inet dhcp

iface eth0 inet static
dns-nameservers <IP1> <IP2>

No firewalls used on the system.

Now, inside the containers, apt-get works intermittently. After restarting the host and starting the containers, it works fine. But after 'a while' (I haven't measured it) apt-get starts failing:

# apt-get update
Ign http://security.ubuntu.com trusty-security InRelease
Ign http://security.ubuntu.com trusty-security Release.gpg
Ign http://security.ubuntu.com trusty-security Release
Ign http://archive.ubuntu.com trusty InRelease


W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-i386/Packages  404  Not Found [IP: 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/multiverse/binary-i386/Packages  404  Not Found [IP: 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.

The sources lists are default. Tried replacing them but made no difference. This happens to all containers. Nothing is changed when restarted. The strange thing is they can ping both IPs and hosts (so DNS probably works ok. Tried pinging google.com, ubuntu.com, archive.ubuntu.com, security.ubuntu.com, always success).

Container network config:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Regarding LXC config, I use the default for ubuntu, veth device and an lxcbr0 bridge for all containers. I'm very new to LXC so bear with me if I screwed up somewhere...

Any ideas are helpful. Let me know if more info is needed, I'll update the description :)

Thanks for your time

PS: I've already tried the standard "apt-get fails" remedies like this one with no success.

  • I'm having a similar problem, but I'm not using static IPs. I tried purging LXC and the containers, and starting over, but that failed too. Feb 23, 2015 at 2:41
  • I'm still experiencing the problem... I keep updating the host OS, hoping it's some bug that will be fixed but no go. Someone helped me troubleshoot it a bit on ubuntuforums (ubuntuforums.org/showthread.php?t=2264832) but we couldn't solve it, and responses stopped so I'm back to square 1. :( let us know if you find a solution, and I'll do the same.
    – Chris
    Feb 23, 2015 at 8:09
  • I fixed my issue today by purging the dnsmasq package from my system and just letting LXC handle everything. Feb 23, 2015 at 22:31
  • This is very good! Well done. Unfortunately, I don't have dnsmasq installed neither on the host or the containers, so it does not apply to me :( I'll keep looking/waiting. But, was your problem identical to mine? If yes I may need to re-check the dns settings on my containers.
    – Chris
    Feb 24, 2015 at 9:02
  • My problem was almost exactly what you stated, except that I wasn't using static IPs. Evidently, dnsmasq was messing with the bridge settings, and I somehow had some extra bridges that weren't attached to anything. Once dnsmasq was purged, I restarted the networking services, and it was golden. Feb 24, 2015 at 19:54

1 Answer 1


After a little more Google Surfing (because now I'm really curious about your problem!), I found This Post, describing a similar issue in which the accepted solution was to remove or comment out the gateway lines from the host config, leaving the guest configs on DHCP.

Also, verify your subnet settings because that's messed me up before (on Windows, mind you, but still...)

  • So, I've been trying to test this for a few days now, and I always end up getting locked out of my server. The machine loses connectivity without the gateway directive.. So unfortunately that doesn't solve my issue :(
    – Chris
    Feb 28, 2015 at 20:06
  • Hmmmm. Does the containers need to be on static IP? Is there a reason they can't just be auto-assigned via DHCP? Mar 2, 2015 at 2:31
  • Oh I don't use static IPs, just static IP on the host. The clients are not set, but they seem to get the same IPs every time. It still is strange that the containers can ping security.ubuntu.com but apt-get can't see/use it. New data: rebooted the host 24h ago, and started a container 12h ago. Still everything works (apt-get in containers). Let me observe when the problem appears...
    – Chris
    Mar 2, 2015 at 8:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .