13

I am on a Windows PC running VirtualBox with Ubuntu installed. I have my networking setup as NAT. On my Windows PC, I am connected to a VPN, but I cannot access those VPN resources from VirtualBox (I have also tried Bridged Networking mode with the same result). Is there a way to connect through the host's VPN? Or alternatively if I could just connect to the VPN through Ubuntu that would work, but I don't see that option in the network connections when running within VirtualBox.

4 Answers 4

22

By default, the NAB adapter simply works for me, without Cisco AnyConnect running.

But DNS lookup failed when Cisco AnyConnect is running, this is due to a critical bug in Ubuntu 12.10+, "bug 1048783: network name lookups broken in NAT network adaptors". See more details at, https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1048783

To workaround this, you would need to run the following cmd to use the host DNS lookup,

From an window command prompt (with VMNAME replaced with your VB name, e.g. "Ubuntu"),

cd "c:\Program Files\Oracle\VirtualBox"

VBoxManage modifyvm VMNAME --natdnshostresolver1 on

BTW, I have "NAT" by default for the 1st adapter, and a "Host-Only" for the 2nd adapter to get around the limitations with NAB only adapter. This setting works perfectly for me.

Make sure you reboot the virtualbox and save the state to preserve the previous settings, not only a power off.

2
  • I have been looking for this answer for months! THANK YOU!!!
    – Kirkland
    Sep 25, 2015 at 20:21
  • Still an issue in 2017. Thanks for the explanation and solution
    – Eldamir
    Mar 1, 2017 at 11:26
1

I have had a similar problem. Running Windows 7 (64bit) with Ubuntu 12.04 inside VirtualBox. To work from home, I need to be able to connect to the University network via VPN to be able (in turn) to connect to the University supercomputing cluster.

I couldn't get a VPN client connection from inside Ubuntu, and I was unable to access my Host machine's VPN connect.

What I did was create a new adapter for my Virtual machine, attached to "Host-only Adapter". This showed up under Internet Connections in Windows, and from there I created a bridge between my Cisco VPN adapter and the VirtualBox host-only network.

After doing this, I was able to connect to the VPN host from inside the Ubuntu virtual machine. The Windows side of the VPN connection doesn't like it, but meh.

Hope this helps.

1
  • Thanks. It turns out I just forgot to set the adapter as connected. Feb 18, 2013 at 1:52
0

Make sure your vpn always use the same port. Note that port

Set your virtual machine to Nat

Inside the ubuntu go to network settings proxy and set ip to 10.0.2.2 and port that you noted. (10.0.2.2 is default virtualbox Nat gateway)

Thats how i use psiphon with virtualbox

0

I was running into this issue as well and found a solution on the Cisco forums:

Run the following in your terminal, replacing "VM name" with the name of your machine in the VirtualBox settings:

VBoxManage modifyvm "VM name" --natdnshostresolver1 on

After restarting your VM, the VPN connection should work.

relevant link:

https://community.cisco.com/t5/vpn/anyconnect-3-1-04072-won-t-allow-internet-connectivity-from/td-p/2400378

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .