[Lxc-users] Bridged network interface inside Virtualbox VM

Luis M. Ibarra mibarra at hacom.com.pe
Thu Sep 26 23:01:05 UTC 2013


On 09/26/2013 05:37 PM, Sean Carolan wrote:
> I feel like I'm so close to getting this working...maybe one of you can help?
>
> Here's the scenario:
>
> I have a virtualbox host running CentOS 6.4 x86_64.  It's got libvirt
> installed and an lxc guest on it.  The guest setup went fine, and I
> can even ssh into the guest from the host. The guest successfully gets
> a DHCP address and has a correct routing table.  The guest can also
> ping the host, but it can't ping the router or reach the internet.
>
> Here's the command I used to create the guest:
>
> virt-install --connect lxc:/// --name testbox --ram 512 --vcpu 1
> --filesystem /containers/testbox/,/ --network bridge:br0
> --noautoconsole
>
> And the bridge info on the host:
>
> [root at opscodelxc ~]# brctl show
> bridge name bridge id STP enabled interfaces
> br0 8000.08002711b9b0 no eth1
> veth0
> virbr0 8000.525400906d8d yes virbr0-nic
>
> ifconfig info for br0 and eth1 on the host:
>
> [root at opscodelxc ~]# ifconfig eth1
> eth1      Link encap:Ethernet  HWaddr 08:00:27:11:B9:B0
>            inet6 addr: fe80::a00:27ff:fe11:b9b0/64 Scope:Link
>            UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
>             ...
>
> [root at opscodelxc ~]# ifconfig br0
> br0       Link encap:Ethernet  HWaddr 08:00:27:11:B9:B0
>            inet addr:192.168.0.72  Bcast:192.168.0.255  Mask:255.255.255.0
>            UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
>            ...
>
> Has anyone gotten bridged networking to function from an lxc guest,
> inside of a virtualbox VM?
>
> I don't have the luxury of using LXC natively because I'm on a Mac.
> So I have to run it from within a Linux VM.
>
> If you know how to fix this I'd be so happy.
>
> thanks
>
> Sean
Short answer, you can't.... as far as I tested =)


Ok, but let me help you maybe we can resolve this, because I'm facing 
the same situation. In my case I've been using host only to get 
internet, but the lxc network only worked using internal network mode 
network cards.

Some advices:

- Network cards must be enable in promiscuous mode  "Allow all", 'cause 
the lxc guest needs to flood its MAC address (correct me if i'm wrong).
- If you are using host only mode for the network cards, you need a NAT 
in the physical machine for the vbox guests to get internet connection.

I'm pretty sure this is an issue regarding mac flooding with the lxc 
veth interfaces and virtualbox.

I asked a similar question a month ago: 
http://comments.gmane.org/gmane.linux.kernel.containers.lxc.general/5365 
.. check it, maybe you can solve it.


Good Luck, and if you do it let us know.

Mike


> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>





More information about the lxc-users mailing list