- I develop websites on my Ubuntu laptop (Ubuntu 13.04 64b).
- Each site runs within a dedicated LXC container¹ on network 10.0.3.x
- I sometimes need to reach those sites from a virtualbox guest running Windows²
It used to work "out of the box", but a few weeks ago, it just stopped. I guess after an Ubuntu update but was it a LXC or a Virtualbox or even a "network stuff" update ? I can't tell since I don't run those tests every day.
¹ To fake various and complex platforms and only use ressources I actually need.
² To test them under Windows browsers.
The question :
How should I setup my Virtualbox/LXC/host network configurations to reach the websites on LXC containers from the Virtualbox guest ?
What I have done so far
My current virtualbox setup is to have 2 network cards.
- A bridge on
wlan0(to access the Internet)
- A bridge on LXC virtual card
lxcbr0(to access the containers)
A Weird thing : I can ping LXC containers from the Windows VM, but I can't access them in HTTP (browsers or telnet on port 80).
Only actually started containers responds to ping.
I tried a bunch of others setups but I am more "guessing" than understanding what is going on.
My current workarround
I setup a port forward on my host with iptables, as I would do to make a container reachable on the whole network (it's actually what it does).
When I do so I can reach the forwarded container from the Windows VM.
But this is definitly not a clean solution :
- I can only access one container at the time (or I have to use different ports)
- I need to reconfigure iptables any time I switch project
- I actually give access to the container to the outside world
- I need to have an active LAN or WAN connection
- I can hardly use domain names anymore (I have a host file in Windows matching container's ip)