Sunday, December 7, 2008

Setup a Host Interface Adapter with a Wireless internet connection in Virtual Box

In one of my previous post, I showed how to create a virtual network using the Host Interface Adapter mode with Virtual Box. This mode (compared to the Network Adapter Translation mode) allows your host and your guest having two different IP address but in the same network, so you can ping one to the other. Nevertheless, Host Interface Adapter mode does not support wireless internet connection.
To get internet access from your wireless connection in your box:

1- You need to setup manually your guest IP address
But make sure to make it different from your host. If your guest is running Linux Ubuntu, go to System > Administration > Network.
Click the Unlock button then you are prompted to add your administration password.
In the Connections tab, select your wired connection and click Properties.


Uncheck the Enable Roaming Mode checkbox. In the Configuration drop-down list, select Static IP address. Define the other parameters according to your Local Area Network configuration.
You will also need to update your DNS information which is going to be your default gateway. Go to System > Administration > Network.
Click the Unlock button and type in your root password. Go to the DNS tab and click Add in the DNS Servers list.
Add your default gateway IP address and delete your former DNS server. Click Close.
2- Enable Network Layer 3 Compatibility
Use the netsh command from the windows terminal to force your bridge components network layer 3 compatibility, that is allow your bridge adapters be configured in promiscuous mode.
Promiscuous mode means that the network adapter passes all the packets it received to the Central Unit Process rather than filtering only the packets addressed to its MAC (Media Access Control) address. This can become an threat for your network security.
For the Host Interface Adapter mode, it allows wireless connection in a bridge receive and process packets from outside network as well as any other network adapters in the bridge. First, use the following command to retrieve the adapter ID of your bridge members:
netsh bridge show adapter
You need to launch your terminal window as an administrator (right-click and Run as an administrator) in Windows 2003 and Vista.
Once you have the adapter ID for each members of your bridge, type the following command for each of your adapter:
netsh bridge set adapter 1 forcecompatmode=enable
You should come with the next window after typing in netsh bridge show adapter again.



Now you should have 2 different IP address for your guest and your host within the same network, you can ping from one to the other.
If your host is a Windows system, you need to disable Windows firewall first to allow your guest pinging your host.

No comments: