Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 Ubuntu running in VirtualBox and getting Internet access, via the host OS, from my office wlan.

Sometime I take the laptop out of the office and use my mobile as a 'wireless hotspot' to get Internet access. This all works fine for the host OS but I can't get Ubuntu to 'see' the internet when I'm using the 'wireless hotspot'.

I have one nic defined in the VM and it looks like this :

enter image description here

I've tried adding another nic in NAT mode (which is what I think is being advised here) but that didn't help.

I think perhaps I need to do the nic in NAT mode but then make changes to the /etc/network/interfaces file but I don't know what changes necessary.

Advice ?

share|improve this question
I suppose you restart your Ubuntu networking or whole machine to try to get it working? – mirkobrankovic Jul 9 '13 at 9:51
Yes I have but thanks for the suggestion – glaucon Jul 11 '13 at 12:11
up vote 0 down vote accepted

I am the OP and I got it working and this is how.

Firstly the VM had previously been setup to use a fixed IP in bridge mode so I changed /etc/network/interfaces so that it went back to the 'normal' value for eth0 ...

auto eth0
iface eth0 inet dhcp

Secondly I realised (embarrased to admit this but it's true) that when using something other than the first tab in the 'Network Devices' of Virtualbox ... like this where I'm using the third tab ...

enter image description here

... I had to be making changes within /etc/network/interfaces that specified to, in this case, eth2, not putting them into eth0. Might be worth saying that I was using 'Adapter 3' only because I didn't want to disturb the settings I'd previously put into 'Adapter 1' and 'Adapter 2' (although I deactivated these temporarily)

Thirdly - as you can see above I set it up to use NAT

Fourthly, and last, I went into port forwarding on the that Adapter tab ...

enter image description here

... and specified ports 8000 and 22 (the only two ports I needed to traffic to use getting in and out of the VM) to forward from the host to the VM - that is specifying ...


... on the host OS would result in a server listening on the VM to port 8080 to receive the traffic.

So now it works ! I'm sure there other ways but this is one way.

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.