Vista Host/Ubuntu Guest, networking and PPTP problem

Discussions related to using VirtualBox on Windows hosts.
Post Reply
complexsetups
Posts: 5
Joined: 15. Sep 2009, 19:29
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Ubuntu

Vista Host/Ubuntu Guest, networking and PPTP problem

Post by complexsetups »

Hi Everybody

I have quite a complicated setup that I need to get working - or at least find out that it just isn't possible.

Here's the setup: Laptop running Windows Vista SP1 - VB3.0.6, guest O/S is Ubuntu 9.0.4. I use the guest OS for web development so need it to be able to do internet access etc.

My main problem is that a number of my clients have PPTP VPN's to be able to download/commit and update live servers, i'm rarely part of their network physically so a dial-up tunnel is my main way.

The Windows side needs to do the PPTP dial-up, this is because some clients require VPN connect to get email as well and I use outlook. I generally always have a wired internet connection.

I've got VB to give the guest access to the internet by using Host Only Adapter shared to the Local LAN Connection adapter. The Host Only is configured as 10.55.0.1, guest being 10.55.0.2 - this means I can always see the guest on a reliably static IP address. Other machines never need to connect to the guest.

However, what I can't get sorted is that when I make the dial-up connection, only the host side can see the VPN. I really want the guest side to also be able to see it, however, you can't share more than one connection. To complicate matters further, when I connect to the VPN, I set up specific static routes so that general traffic goes out over the regular internet and only things destined for their address range goes via their router.

Is what i'm trying to do even possible?

It appears that the guest can route to the host primary network connection but because that's the default gateway, it tries to send data that way.

Host interface: configured via DHCP, guest OS has static IP.

Please can anyone point me in direction, have spent entire day searching to no avail.

Thanks
James
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Vista Host/Ubuntu Guest, networking and PPTP problem

Post by vbox4me2 »

Are these static routes on the Host? then try using NAT for the Guest, the Host routing table should route the same for the Guest.
complexsetups
Posts: 5
Joined: 15. Sep 2009, 19:29
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Vista Host/Ubuntu Guest, networking and PPTP problem

Post by complexsetups »

The problem I had with using NAT on the guest is that I couldn't get static IP to work for the guest. If I can't get static IP then I have to keep editing the hosts file in windows to be able to test the code in a proper version of IE.

Yes, whem the VPN tunnel comes up, it adds static routes to 10.0.0.0/8 as the client's network is quite large. My 10.55.0.0/24 range for the guest isn't causing overlap in their network either as I adminster both and reserved that block for this purpose.

So, normally, all routes go to standard internet connection on LAN1 (Local LAN wired), windows sees this ok, I bring up the PPTP and windows sees both the standard route and the new 10.x.x.x range and can talk to anything on either but the guest can still only see normal internet.

Are you saying I can force static IP's into a NAT environment guest - didn't think that would work or did I read something overcomplicated and probably about an old version of VB about doing static IP's?
complexsetups
Posts: 5
Joined: 15. Sep 2009, 19:29
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Vista Host/Ubuntu Guest, networking and PPTP problem

Post by complexsetups »

Ok, so I had a go at that, I converted back to NAT, rebooted, brought the guest eth0 up as static - nothing, couldn't talk to the internet etc, couldn't see the host IP either.

So, changed eth0 to dhcp and got an internal address of 10.0.2.15, could see the internet, started the PPTP tunnel, ping'd some addresses, took it a few seconds but it could see the others so i'm 95% there now.

What I need to be able to do now is be able to see the 10.0.2.15 from the host side somehow - or configure this to be back in that 10.55.0.x range somewhere so I can point my c:\windows\system32\drivers\etc\hosts entries at 10.55.0.x and create virtual hosts.

I'll only ever be running one VM at a time on this machine and in this configuration needing VPN access.

Anyone help please?
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Vista Host/Ubuntu Guest, networking and PPTP problem

Post by vbox4me2 »

In NAT every Guest gets and uses 10.0.2.15, can't you revert to that? Somewhere in the Manual there is a way to change that somewhat.
complexsetups
Posts: 5
Joined: 15. Sep 2009, 19:29
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Vista Host/Ubuntu Guest, networking and PPTP problem

Post by complexsetups »

Yeah, I could cope with 10.0.2.15 no problem, however, its not visible from the guest side which was why I went down the host only interface route I think.

Is there a way I can make the guest visible to the host - preferrably without using port mapping?
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Vista Host/Ubuntu Guest, networking and PPTP problem

Post by vbox4me2 »

Only by using "Host only", but you can combine by having more then one adapter on the Guest this way.
complexsetups
Posts: 5
Joined: 15. Sep 2009, 19:29
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Ubuntu

Re:[SOLVED] Vista Host/Ubuntu Guest, networking and PPTP pro

Post by complexsetups »

Thank you x infinity!

Adding a second network interface using host only and configuring that to static and not putting a gateway on the second adapter sorted it out.

So, for anyone else reading this, here's the full solution - note this is a bit dirty as I hate a lot of the GNOME/KDE network utilities

1) Make sure everything is working properly in the host OS - full internet connectivity, VPN tunnel etc
2) Setup guest OS as per normal but....
2a) Network card 1 - NAT mode
2b) Network card 2 - Host Only Adapter
3) Configure a static IP for the host side of the host only adapter in Network Connections (Start - ncpa.cpl for Vista Users) - I set mine to 10.55.0.1 on the host. On my version, the host only adapter is called "Virtualbox Host-Only Ethernet Adapter" - don't change your Local LAN adapter settings.
4) Start the VM
5) Open a shell and type "sudo nano /etc/network/interfaces", my config is below, change what you need in the eth1 section to match the settings for the host side virtual adapter that you configured in step 3

[--- /etc/network/interfaces start ---]
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
# one address higher than the host side!
address 10.55.0.2
netmask 255.255.255.0
#Note that gateway is commented out or your routing table will get a bit messed up
#gateway 10.55.0.1
[--- /etc/network/interfaces end ---]

7) Reboot guest OS (sounds a bit windows ish but makes it easier than typing a bunch of ifup/ifdown commands).

8) Re-open shell in guest and see if you can ping 10.55.0.1 first, then the gateway of your normal network

9) If all is working this far then you can start your PPTP (VPN) tunnel and try and ping some devices down that side and all should work.

10) Make cup of coffee, sit back in smug satisfaction and say thank you. :)

Thanks to vbox4me2 for pointing me in the right direction. Sometimes the most obvious answer is right in front of you!
Post Reply