How to connect an 'internal network' to internet

Discussions related to using VirtualBox on Windows hosts.
Post Reply
everyman1980
Posts: 2
Joined: 1. Oct 2008, 13:05

How to connect an 'internal network' to internet

Post by everyman1980 »

I'm running 2 guests (1 Windows Server 2003 and 1 Windows XP) on an XP host. They are currently linked through the Internal Network option.

Is there any way to give one of the guests internet access through my host? Or do I have to setup NAT or HIF for this?

Ultimately what I want is a testing lab with the guest machines interacting with each other while completely isolated from the company network but with internet access.

Any help much appreciated!
mikeva50
Posts: 5
Joined: 1. Oct 2008, 16:02

How to connect an 'internal network' to internet

Post by mikeva50 »

I came across this when I was trying to do the opposite. I was trying to have the virtual machine accessible from all of my other PC's on my network. I wanted to run the VM in the background "invisible" and remote desktop into the VM from my laptop. I have a powerful machine that is dedicated for doing all my torrents, media storage, and unfortunately the wife insists on using it all of the time and sticks me with the laptop "That I Had To Have!" Anyhow I don't like downloading to the laptop because it’s far too slow and becoming obsolete. Becomes a pain to try and extract really large files and transfer to a PC capable of handling the job. So now I am able to do anything and everything I want without disturbing the wife when she's using MY other machine that I "Had To Build!"

When I set the VM's network settings to "PCnet-FAST III" and attached it as "NAT" the host machine gave my VM an IP address of 10.x.x.x. This gave me full internet connection but zero access to the other PC's on my network. Since all of your VM's will have a similar IP addresses supplied by the host machine they should be able to see each other but I haven't created more than one VM to try this. Let me know how it works.

In case anyone else is trying to get their VM to pull an IP supplied by a router you have to go into the VM's network settings within virtual box and set the VM's network adapter to be attached to the host interface. Then on the same page add a host interface "virtual network adaptor" to the host machine. Make sure you select the new host interface and select OK.

Now on the host machine you need to go into Network Connections and highlight both the virtual network adaptor and your real network adaptor, right click on them and select bridge connections. This will now link your host card "Mine is 192.168.1.103" to your virtual card which will then in turn supply the IP address to the VM's virtual network adaptor "Mine is 192.168.1.102"
Dest
Volunteer
Posts: 138
Joined: 11. Jan 2008, 17:03
Primary OS: MS Windows Vista
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 2000, Windows XP, Ubuntu, FreeBSD

Post by Dest »

the easiest way to do that is to leave your current 2 systems setup as internal network and to the one you want to have internet access, add a second nic in "Nat" mode.

You'll want to set that "NAT" NIC as the default route and you should be set
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

Post by Sasquatch »

Everyman1980:
You have to add a second NIC and attach it to NAT if you want them to access the Internet.


Mikeva50:
You have to switch to Host Interface Networking and create a bridge. See the manual for how to set it up. If you are on a wireless NIC, don't bother as it won't work.
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.
everyman1980
Posts: 2
Joined: 1. Oct 2008, 13:05

Post by everyman1980 »

Thanks for the help guys, all up and running. All I had to do was add the NIC in NAT mode.
atek
Posts: 1
Joined: 6. Nov 2008, 18:44

Re: How to connect an 'internal network' to internet

Post by atek »

mikeva50 wrote:I came across this when I was trying to do the opposite. I was trying to have the virtual machine accessible from all of my other PC's on my network. I wanted to run the VM in the background "invisible" and remote desktop into the VM from my laptop. I have a powerful machine that is dedicated for doing all my torrents, media storage, and unfortunately the wife insists on using it all of the time and sticks me with the laptop "That I Had To Have!" Anyhow I don't like downloading to the laptop because it’s far too slow and becoming obsolete. Becomes a pain to try and extract really large files and transfer to a PC capable of handling the job. So now I am able to do anything and everything I want without disturbing the wife when she's using MY other machine that I "Had To Build!"

When I set the VM's network settings to "PCnet-FAST III" and attached it as "NAT" the host machine gave my VM an IP address of 10.x.x.x. This gave me full internet connection but zero access to the other PC's on my network. Since all of your VM's will have a similar IP addresses supplied by the host machine they should be able to see each other but I haven't created more than one VM to try this. Let me know how it works.

In case anyone else is trying to get their VM to pull an IP supplied by a router you have to go into the VM's network settings within virtual box and set the VM's network adapter to be attached to the host interface. Then on the same page add a host interface "virtual network adaptor" to the host machine. Make sure you select the new host interface and select OK.

Now on the host machine you need to go into Network Connections and highlight both the virtual network adaptor and your real network adaptor, right click on them and select bridge connections. This will now link your host card "Mine is 192.168.1.103" to your virtual card which will then in turn supply the IP address to the VM's virtual network adaptor "Mine is 192.168.1.102"
Any ideas on how I would do this from the linux side? For example, I want to switch to linux at work, but I'm required to run some windows apps on a domain. I want to image my current machine. restore it to a VM under ubuntu and virtualbox, and still have access to the domain with the VM.
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: How to connect an 'internal network' to internet

Post by Sasquatch »

atek wrote:
mikeva50 wrote:...
Any ideas on how I would do this from the linux side? For example, I want to switch to linux at work, but I'm required to run some windows apps on a domain. I want to image my current machine. restore it to a VM under ubuntu and virtualbox, and still have access to the domain with the VM.
What do you have now? What settings do you have and what is the exact situation you want to create? It might be better to create a new topic, as it probably won't be the same matter as this topic.
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