How to use Host VPN Connection In VirtualBox

Discussions about using Windows guests in VirtualBox.
Post Reply
Thohidul
Posts: 5
Joined: 25. Jan 2018, 17:30

How to use Host VPN Connection In VirtualBox

Post by Thohidul »

Hi Guys
I got a question. I am using Windows 7 and I have installed VirtualBox to run Ubuntu in it. While my host computer is connected to VPN, how can i use this VPN in VirtualBox
system?

Your help will be appreciated.

Regards
Thohidul
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to use Host VPN Connection In VirtualBox

Post by mpack »

Ultimately, VPN is an end to end connection. There can only be two participants.

However, the whole reason for NAT being easiest to set up is that it uses the host internet connection. So if the host has working internet then so, in most cases, will the guest. The guest should be oblivious to any "special features" of the hosts connection, e.g. it can be redirected to VPN.

Just don't attempt to use anything other than NAT or "NAT network" in the guest. It won't work for internet, or it won't be going through NAT.
Thohidul
Posts: 5
Joined: 25. Jan 2018, 17:30

Re: How to use Host VPN Connection In VirtualBox

Post by Thohidul »

HI Mpack
I am using NAT but still can't use my host computer's vpn connection in VirtualBox. Here is my system
Host System : Windows 7 Ultimate with VPN connection running
VirtualBox : Ubuntu 16.04

Since i am in China, i need to use Vpn to access google or youtube. Which i can do in my host computer but when i try to access through VirtualBox, i mean Ubuntu can't get access there. I need to access it for some testing and learning purpose.
I have uploaded my VirtualBos settings for you.
Attachments
vb.jpg
vb.jpg (65.04 KiB) Viewed 39113 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to use Host VPN Connection In VirtualBox

Post by mpack »

Let's try to isolate the problem. What happens if you eliminate NAT from the equation? Does the VM have internet access via NAT work for you then?

Incidentally, I just tested this myself with VirtualBox 5.2.6, and didn't find a problem. It so happens that I have a VPN client on my host PC. If I run that and then also run an XP VM (using NAT) then I find that I can successfully browse the internet, and the sites I visit show my location as being that of the VPN server. I didn't have to do anything special to make it work.

Ultimately you probably need a network expert rather than a VirtualBox expert to resolve this.
Thohidul
Posts: 5
Joined: 25. Jan 2018, 17:30

Re: How to use Host VPN Connection In VirtualBox

Post by Thohidul »

You mean to setup Not attached mode?
Thohidul
Posts: 5
Joined: 25. Jan 2018, 17:30

Re: How to use Host VPN Connection In VirtualBox

Post by Thohidul »

I am running Ubuntu in my VM but can't access Google from there, though my VPN is running in host OS and can browse google or Fb there.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to use Host VPN Connection In VirtualBox

Post by mpack »

Sorry, I mistyped. I meant to eliminate VPN from the equation. Can you then access the internet from the VM using NAT?
Thohidul
Posts: 5
Joined: 25. Jan 2018, 17:30

Re: How to use Host VPN Connection In VirtualBox

Post by Thohidul »

mpack wrote:Sorry, I mistyped. I meant to eliminate VPN from the equation. Can you then access the internet from the VM using NAT?
Yes i can use host internet connection on my virtualBox VM
tduesterhus
Posts: 1
Joined: 14. Jan 2019, 10:34

Re: How to use Host VPN Connection In VirtualBox

Post by tduesterhus »

Hi,

I have the same problem. I am running a windows 7 host with an ubuntu guest system on virtualbox. The windows-host has an vpn-client (global protect). Some times I was able to use the connection of the vpn in my guest system (NAT). But most of the time it does not work. Does someone else found a solution for this problem?

Best regards,
Tobi
BillG
Volunteer
Posts: 5105
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: How to use Host VPN Connection In VirtualBox

Post by BillG »

It probably depends on which VPN client you are using. Technically it should not be possible. A VPN connection is a point to point connection and should not be routable or shareable. Despite that, some VPN connections can be shared (just like some WiFi connections in the host can be bridged to a vm and some cannot).
Bill
Post Reply