Tuesday, June 12, 2012

Connecting to Virtual PC's Internet Connection from Host

If you're like me who has a Windows 7 64bit computer with a broken LAN port and you purchased a usb lan card but does not have the driver's for it, then this article is for you.

I will teach you how you could still make use of your USB LAN adapter from within a virtual environment and access the internet from your virtual machine.

The first thing you will need is to download and install a virtual machine. You can download Microsoft's XP mode for Virtual PC or setup Oracle's Virtual Box and grab a Windows XP image on the net. I prefer installing Windows XP because of the JP1081 USB Lan adapter I have runs great on Windows XP. There are lots of tutorials on how to setup and install these virtual machines so go and Google it up because this article will not cover setting up the virtual machine.

Once your virtual machine is setup and running. Fire it up and plug in your USB Adapter and load it up on the virtual machine with all of its drivers installed of course on the virtual machine. Once the USB LAN adapter is working and properly running on your virtual machine, its time to setup the host computer.

First, setup a loopback adapter on your host computer.
On Windows 7, you go to Device Manager and under action click Add legacy hardware.

After the welcome screen, select Install the hardware that I manually select from list then click next. Pick Network Adapters and then in the Microsoft manufacturer click Microsoft Loopback Adapter.

Click finish and then wait for the new network adapter to show up in your Control Panel > Network and Internet > Network Connections folder.

It will show up as a Local Area Connection with a Microsoft Loopback Adapter Description. Right click the newly created network adapter and click on Properties. Edit the IPV4 settings and just use the settings below.
Pay attention to the default gateway as this will be the IP of your Virtual Machine's Internal network. The DNS server addresses are from Open DNS and you can use any DNS server you want. Click on OK to save your settings.

You have finished setting up your host, now we setup the Virtual PC's network to talk to your host.

First, open the networking setup of your virtual PC. On Virtualbox, you click on Devices and Network Adapter.
On network select Bridge Adapter on the Attached to and select Microsoft Loopback Adapter, the name of the Lan Adapter we just created earlier.
Click OK to save your settings and wait for the virtual machine to update its network adapters. 

Your virtual machine should have these settings on its Network Adapters folder.

You should have internet connection enabled by now on the virtual machine. Try opening the virtual machine's browser and check if you have internet connection.

We now then have to configure the virtual machine's LAN Adapter with these settings.
Take note of the default gateway. This is the IP of your host computer. Your host computer's loopback adapter's default gateway should also be your virtual pc's IP. The host and Virtual PC should not have the same IP's. Click OK to save your settings and you are done!

Verify if you have connection by pinging your virtual pc from the host and also pinging your host from the virtual pc. Also try to ping a website from your host and check if there is a connection.


No comments:

Post a Comment

Clixsense