Sharing Internet Connection from guest

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
SIMONSEZ
Posts: 2
Joined: 18. Sep 2010, 07:32
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows 7

Sharing Internet Connection from guest

Post by SIMONSEZ »

I've installed the latest VBox (Windows7) in my OS X 10.6.4. Everything works perfectly for now, but i have difficulty to share my internet connection from guest (win7) to host (OS X). My internet connection software only run in windows OS (using putty, winPcap, etc). Anyone can help me? Thank you very much...
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Sharing Internet Connection from guest

Post by Sasquatch »

Add a NIC to the VM if you haven't attached one already and set it to Host-Only. In the general VB settings, DISABLE the DHCP service for the host-only interface and configure it with the following IP, the last number can be anything between 2 and 254:
IP: 192.168.0.2
Mask: 255.255.255.0

That is everything you can configure there, but your Host needs a gateway too, and that will be 192.168.0.1. DNS servers can be whatever the Host gets, but you can also use the OpenDNS servers.

In the Guest, right click on the interface that provides internet and click on Properties. Go to the Advanced tab and share the connection. This should set the other interface with the IP of 192.168.0.1 and enable a DHCP server on it. It's a bit of a shame that it can't be set on the Host side to use DHCP, but you can do that manually. Using the DHCP option means that the above steps to set a static IP are not needed, they will be overwritten by DHCP. You have to run the dhcp client from a terminal in order to get the complete configuration for use on the Host.

Hope it makes sense. Ask if you don't understand something.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
SIMONSEZ
Posts: 2
Joined: 18. Sep 2010, 07:32
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows 7

Re: Sharing Internet Connection from guest

Post by SIMONSEZ »

Thanks for replay,
I know nothing about networking, i hope i did what you told me, but still no luck. These are the sreenshoots of my configuration, i hope you can find what i should do.
Thank you Sasquatch.
Image
Image
Image
Image
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Sharing Internet Connection from guest

Post by Sasquatch »

Ok, it looks like your physical interface works too. That means that you can share the internet connection with the first adapter of the VM, Local Area Connection. The rest of the network will be able to get an IP from the VM too if there isn't another DHCP server available (like a router).

The Host-Only adapter can only be configured from within VirtualBox settings, or the Terminal. It does not show up in the network manager on Mac OS. I was using this adapter in my instructions, because the physical interface isn't always connected.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply