Page 1 of 1

connections between guests with shared host VPN

Posted: 8. May 2012, 17:19
by bh4000
Greetings, all. I've run into a challenge that I'm hoping someone else has seen.

I'm running a web server on a Ubuntu (11.1) guest from a Mac (lion) host. For cross-browser testing, I often have additional virtual machines running - 1 or more WinXP guests and 1 Windows 7 guest - that need to see the web server on Ubuntu. The web server connects to various databases to retrieve content, as usual. When I'm in the office, connected to the wired network, I run the guest machines in bridged mode and they're all able to see the web server running on the Linux virtual machine just fine. The server, if it matters, is an old ATG Dynamo setup, which I can't run on the Mac host.

The difficulty is when I'm off-site and connected via VPN. In order for guest machines to share the host's VPN connection, I seem to need to set the guests to NAT, but then they are unable to access the web server on the Linux guest. Guest machines in bridged mode can get internet access, but do not use the VPN tunnel. I'm using the Mac native VPN (although I've also tried it with a Cisco VPN client).

Has anyone dealt with a situation like this? Any suggestions are greatly appreciated.

Re: connections between guests with shared host VPN

Posted: 10. May 2012, 02:39
by BillG
I would enable an additional NIC in each guest and set it to internal. All the guests then have a netork connection no matter what network the host is connected to (or no network connection at all). If they don't get an IP automatically, configure then manually with IPs in the same IP subnet. Set the other vms to access the web server using its internal network address.

Re: connections between guests with shared host VPN

Posted: 18. May 2012, 03:12
by gsu6100
I don't know if this will help. I know you are using linux and you might have to manually configure the second adapter in the guest OS.

I wanted to have my guest OS (windows 7) to access my VPN over my Mac wireless connection. I went into the virtualbox settings for the guest OS. I set the first adapter to bridged (with defaults). I then setup the second network adapter as nat (with defaults). I went into the mac settings for my VPN and under advanced, set "send all traffic over vpn". I connected to my VPN through the mac. Then started the guest OS and waited for windows 7 to install the new adapter. Once it installed I did a trace route in the guest OS and it now went over the VPN through the mac.

Thanks

Edit---- You don't have to set the VPN on the mac to "send all traffic over vpn" for it to work. I was testing some things on a public address that wasn't open to the internet yet and needed to access that ip over the vpn.