Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'll ask my question first, then give details about where I am coming from:

Is it possible to use host only, then have ubuntu act as a proxy to provide internet access to windows? If so, how?

I am trying to get the right combination of networking for my virtualbox windows client VM (win7). My host is ubuntu 10.10 (maverick).

I believe I understand the basic network options (please correct me if I am incorrect):

NAT - Host can't communicate with guest but guest has access to all host's adapters

Host only - Separate adapter but guest has no net access Bridged - bridge an adapter in the host with the virtual adapter to give the host access to the host adapter

I am trying to give my win guest internet access, but also access the host in a separate network.

Bridged only works when the host is connected to the internet (this is a laptop) so when it's not connected the network is down.

Thanks I appreciate your help.

share|improve this question
    
Do I understand correctly that you want to access the VM from another machine? –  Reuben Swartz Apr 2 '11 at 2:18
    
I want the best of both worlds - I want my guest to have access to the internet, and I want a network connection between guest/host. The only way I could see this happening is connecting the host to the guest, then have a proxy server setup on the host to provide internet access to the guest. –  Russell Apr 2 '11 at 2:21
    
Bridging actually puts the VM on the network so it will work almost like a completely separate computer when it comes to networking. What about 2 virtual network adapters? –  Reuben Swartz Apr 2 '11 at 2:29
    
@Reuben - yeah, but when the network is disconnected (eg laptop out of the office), there is no longer a connection between the host and guest on the laptop. –  Russell Apr 2 '11 at 2:36
    
Since then, I have done this quite simply - I enable two network adapters, one using NAT for internet, and one for host only. Works great! –  Russell Jan 19 '12 at 6:15

3 Answers 3

Ok well I finally got it working.

I have installed the Squid proxy server on my Ubuntu host, and added the virtualbox adapter.

This link was very useful for quickly getting squid running: http://www.ubuntugeek.com/how-to-setup-transparent-squid-proxy-server-in-ubuntu.html

All I need to do now is fix a little issue I am having with the vboxnet0 adapter but all good.

share|improve this answer

Internet access in Virtualbox Host-only networking

http://jackal777.wordpress.com/2012/02/13/internet-access-in-virtualbox-host-only-networking/

share|improve this answer
2  
Welcome to Ask Ubuntu! While this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  michaelms Feb 13 '12 at 15:32

I have ended up having two network adapters enabled on the guest, one NAT, one host-only. That gives Internet access AND host access.

share|improve this answer

Your Answer

 
discard

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.