[Lxc-users] network routing for containers in virtualbox guests

Marcus Osdoba marcus.osdoba at googlemail.com
Thu May 26 20:45:45 UTC 2011


Dear mailinglist,

Just to let you know, I discovered a similar issue like the one 
described here:
http://thread.gmane.org/gmane.linux.kernel.containers.lxc.general/1691/focus=1733 
<- The container's host os ran in an VMWare ESXi and wasn't able to 
contact other machines besides its own host.

With virtualbox I have the same problem:
physical machine: Windows
virtual box for windows with linux guest: Debian Squeeze
lxc-package from squeeze: container with wheezy rootfs

A) NO internet access from wheezy container:
vb networking set to bridged, the same with the bridge inside the
squeeze installation (I have setup a bridge br0 according to 
DebianWiki). After starting the container, surprisingly the dhcp-client 
picked up an offer and I spotted the mac address of the wheezy 
container's device in my physical router's menu. But the networking 
itself did NOT work. Pinging squeeze from wheezy container and vice 
versa worked - pinging the router from squeeze worked, but not from 
within the wheezy container.

B) Internet access from wheezy container possible:
Setting vb to nat'ed. Now the container connects only over one hop to 
the "virtual router" provided by vb (of course, the physical router 
doesn't interfere here). The squeeze vb-guest and the wheezy container 
on squeeze live in the same "virtual" vb-network.
But now it is not possible to access the squeeze installation nor the 
wheezy container from physical machines outside vb.

C) Speculation:
Ignoring the dhcp offer from physical router and setting the route in 
the wheezy container to the squeeze host might work. Since the squeeze 
host was always able to access internet it could act as router and 
"forward" container ip-pacakges...? Is there some "conenct over more 
than one hop"-setting for the container config?

Sorry for mixing up words like host, physical host and so on. I tried to 
use consistent labels at least in this mail.

Summary: Running a Linux in virtual box and setting up a container 
therein with veth-network does not work out of the box as expected. 
Since the container picks up a dhcp offers from "outside", one expects a 
working internet connection in the container.

Kind regards,
Ossy

P.S.: It's my first post here, so don't bite please ;-)




More information about the lxc-users mailing list