Page 1 of 1
[Solved] Host Interface -> Guest can't connect internet
Posted: 4. Apr 2009, 16:46
by thundersnows
Hi,
I'm using Virtualbox 2.1.4 on WinXP.
I have internet cable
IP : <public>
Subnet : 255.255.255.0
Gateway : <provider>
DNS Servers : 61.247.0.8, 202.73.99.8
I run Ubuntu on Guest OS and use Host Interface
IP : <public>
Subnet : 255.255.255.0
Gateway : <provider>
DNS Servers : 118.136.79.1, 61.247.0.8, 202.73.99.8
Right now I can ping from host to guest and vice versa.
But I can't connect to internet from my guest OS.
Can someone point me what did I missed ?
Thanks.
Modedit: removed your public internet IP address for safety. Never post your IP address on the web.
Re: Host Interface -> Guest can't connect internet
Posted: 4. Apr 2009, 16:57
by vbox4me2
Remove the primary DNS from the Guest(leave other 2).
Re: Host Interface -> Guest can't connect internet
Posted: 4. Apr 2009, 19:19
by Sasquatch
Problem is your internet connection. You try to get a second IP on an interface where your provider will only supply one. You're not connected to the internet using a router, so your Guest will never be able to use HIF like it's supposed to. If you want to use HIF, you have to install the loopback adapter (see the
VirtualBox FAQ). For just internet, use NAT.
Re: Host Interface -> Guest can't connect internet
Posted: 4. Apr 2009, 22:35
by vbox4me2
Why? before you removed the IP's it clearly shows .74 for the Host and .75 for the Guest, only the dns was a bit mixed up, unless he set the Guest static with a 'stolen' second public ip...
Re: Host Interface -> Guest can't connect internet
Posted: 4. Apr 2009, 22:43
by Sasquatch
True. Some providers don't limit it, while they actually should. And there is already a shortage on IPv4 addresses.
Re: Host Interface -> Guest can't connect internet
Posted: 5. Apr 2009, 05:07
by thundersnows
Thanks for replying.
I set static IP to my guest OS. How can we know if we're limited to 1 IP only from ISP ?
I'd like to use host interface, so I can try setup a server on my guest OS, and pretend my host OS as the client.
If I use NAT, my host can't connect to guest.
I'll try another way :
- use NAT on guest OS, DHCP IP (internet should be working fine)
- set MS Loopback adapter on host OS, set static IP to the same class as guest OS
I think my host OS should be able to connect guest OS and vice versa.
I'll update you all the result.
Thanks for your help.
Re: Host Interface -> Guest can't connect internet
Posted: 5. Apr 2009, 05:27
by thundersnows
Here's the result
Host OS
IP : 10.0.2.10
Subnet : 255.255.255.0
Gateway : not set
Guest OS (DHCP)
IP : 10.0.2.15
Subnet : 255.255.255.0
Gateway : 10.0.2.2
DNS : 10.0.2.3
I'm not able to ping between host and guest
I tried to change host gateway to be the same with guest (10.0.2.2) with no result (even ping to the gateway)
It seem like virtualbox does not allow direct connection between host and guest in NAT mode.
is there anyway I can connect my host to guest, and guest can connect to internet ?
Thanks.
Re: Host Interface -> Guest can't connect internet
Posted: 5. Apr 2009, 12:46
by vbox4me2
What you want is only possible with the Host interface, so get a second IP address from your ISP or place a router and forward services as needed which is what a router is made to do.
Re: Host Interface -> Guest can't connect internet
Posted: 5. Apr 2009, 13:42
by Sasquatch
thundersnows wrote:Here's the result
Host OS
IP : 10.0.2.10
Subnet : 255.255.255.0
Gateway : not set
Guest OS (DHCP)
IP : 10.0.2.15
Subnet : 255.255.255.0
Gateway : 10.0.2.2
DNS : 10.0.2.3
I'm not able to ping between host and guest
I tried to change host gateway to be the same with guest (10.0.2.2) with no result (even ping to the gateway)
It seem like virtualbox does not allow direct connection between host and guest in NAT mode.
is there anyway I can connect my host to guest, and guest can connect to internet ?
Thanks.
Using NAT, and then set HIF to use the same range as NAT is asking for problems. Like vbox4me2 said, get some things straight first. And please learn a thing or two about networking, saves us both a lot of throuble.
If you want to do it the easiest way, and the cheapest, use only one HIF interface, no NAT or whatever. Then right click on your internet connection on the Host, go to the advanced tab of the properties and enable Internet Sharing. Select the loopback adapter if you have more than one additional NIC and that's it. Now use DHCP on the Guest with HIF selected to the loopback.
Re: Host Interface -> Guest can't connect internet
Posted: 5. Apr 2009, 15:08
by thundersnows
Thanks Sasquatch for the idea ICS, I almost forgot this feature

It works now.
Re: Host Interface -> Guest can't connect internet
Posted: 25. Jul 2009, 22:53
by ironmonger
If you want to do it the easiest way, and the cheapest, use only one HIF interface, no NAT or whatever. Then right click on your internet connection on the Host, go to the advanced tab of the properties and enable Internet Sharing. Select the loopback adapter if you have more than one additional NIC and that's it. Now use DHCP on the Guest with HIF selected to the loopback.
This appears to be the solution to the same problem I am having. However, I am finding it difficult to implement. Can someone please post detailed, step-by-step instructions?
Re: Host Interface -> Guest can't connect internet
Posted: 25. Jul 2009, 23:24
by Sasquatch
You can't get it more detailed than that. It's just these steps you need to take. What isn't working on your end now? Remember, the steps I described were for an older version of VB that used virtual interfaces for it's Host Interface, or Bridged mode. VB now no longer needs them and can access the NIC directly.
For your situation, it might be best to use the Host-Only adapter for ICS. Go to the preferences of VB itself and select network. There you can change the configuration for the interface. Set the IP address to 192.168.0.1, netmask 255.255.255.0. Disable the DHCP server if it isn't already and that's it. Now the Guest should get an IP from Windows itself and be able to get onto the internet, while you can also access the Host.
Something more easy is to set up two network interfaces for the Guest. One with NAT for internet, the other with Host-Only for Host <> Guest communication.
Re: Host Interface -> Guest can't connect internet
Posted: 26. Jul 2009, 01:16
by ironmonger
Thank you. What confused me were the differences between the two versions of VirtualBox. The second solution of setting up a Host-only and NAT adapter works just fine.