Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Ubuntu 10.04 running Oracle VirtualBox 3.2.6 with a Windows XP guest. I use a VPN that I would like to be accessed by the guest VM, on a ifconfig it shows as:

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:  P-t-P:  Mask:
          RX packets:14151 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19860 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:4415271 (4.4 MB)  TX bytes:17949982 (17.9 MB)

Using NAT or Bridge adapters on the VM only gives me the non-vpn adapter. How can I map the tun0 adapter to VirtualBox?

share|improve this question
It did not work for me but it is clearly correct advance. Setting sysctl.conf: sysctl net.ipv4.ip_forward=1 Then running sudo sysctl -p – Mashimom Aug 6 '10 at 11:54
Finally it is working, though it did not work when I loaded sysctl. Later I found it working. – Mashimom Aug 7 '10 at 0:01

I met the same problem, and googled around but found no answer. at last I found my solution:

  1. in windows, open the VPN connection using VPN GUI.
  2. in VM configuration, add a new Network: Internal network.
  3. restart VM.

then I can access the resource in VM.

share|improve this answer
up vote 2 down vote accepted

Setting /etc/sysctl.conf:

sysctl net.ipv4.ip_forward=1

Then running:

sudo sysctl -p

(Should not be necessary but) I rebooted after that.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.