Solved VirtualBox Host-Only Network Not connecting to the Internet

emiljan

New member
Local time
4:05 PM
Messages
3
Hey guys,

I'm having a little trouble setting up two virtual machines connecting to the internet. I've setup a Windows Server 2008 R2, and Windows 7 virtual machine with host-only networking on their own subnet.

I'm having issues with getting them to connect to the outside network for internet access. Both machines are on their own subnet 192.168.2.0/24 and the host machine on subnet 192.168.1.0/24.

Both vm's are on Internal Network Mode and the Windows Server 2008 machine has a static ip of 192.168.2.2, but no default gateway or dns because i have no idea what to put in there. Do i put in the IP of the VirtualBox Host-only adapter as the default gateway?

This is where im having trouble with. I have DHCP setup on the Server VM and the Windows 7 VM can get an ip from the Server but neither can communicate out to the internet.

I'm lost and i need your help to set this up. I have included a network diagram to for clarity.

http://i.imgur.com/wGmtY.jpg
 

My Computer My Computer

At a glance

Windows 7 Home Premium 64bitAMD A6-3400M APU8GB DDR3 1333MHzAMD Radeon HD 6520G 512MB + AMD Radeon 6650M 1GB
Computer Manufacturer/Model Number
ASUS K53TA-BBR6
OS
Windows 7 Home Premium 64bit
CPU
AMD A6-3400M APU
Memory
8GB DDR3 1333MHz
Graphics Card(s)
AMD Radeon HD 6520G 512MB + AMD Radeon 6650M 1GB
Sound Card
RealTek HD Sound
Monitor(s) Displays
15.6"
Screen Resolution
1366 * 768
Hard Drives
Seagate Momentus 500GB 5400RPM
Mouse
Logitech Wireless Mouse
Internet Speed
ATT DSL 1.5Mbits/s
The behaviour you are experiencing is due to the fact that there is no routing happening between the VBox HO adapter and the physical NIC that is connected to the internet. That is the nature of host-only networking and the routing will not happen by accident.

You can establish routing with your current configuration by using Internet Connection Sharing to share your real network adapter to the HO adapter, but the ICS default settings will mean that your VM static IPs will be wrong. Changing the default ICS settings requires editing the registry and instructions for that can easily be found elsewhere.

> Do i put in the IP of the VirtualBox Host-only adapter as the default gateway?

Yes, but it won't achieve anything until such times as there is a route from the HO adapter.

To be honest you'd probably be better off using NAT or Bridged networking.
 

My Computer My Computer

At a glance

Windows 7 Pro x86T6600 @ 0.975V4GB DDRII-800Onboard Intel 4500mhd
Computer Manufacturer/Model Number
AOpen MP45
OS
Windows 7 Pro x86
CPU
T6600 @ 0.975V
Motherboard
i45GMx-I
Memory
4GB DDRII-800
Graphics Card(s)
Onboard Intel 4500mhd
Sound Card
Onboard Realtek + SteelSeries USB
Monitor(s) Displays
Asus ProArt 246
Screen Resolution
1920x1200
Hard Drives
Seagate Momentus XT 750
Keyboard
Cherry G230
Mouse
MS Wireless 3500
There is quite a good description of what each type of networking does in the VirtualBox Help->help Contents. Chapter 6 is what you want.
 

My Computer My Computer

At a glance

Microsoft Windows 7 Home Premium 64-bit Servi...Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz8 GB DDR3Intel(R) HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Hewlett-Packard/G62-107SA Notebook
OS
Microsoft Windows 7 Home Premium 64-bit Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz
Motherboard
Hewlett-Packard 1425
Memory
8 GB DDR3
Graphics Card(s)
Intel(R) HD Graphics
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
Builtin
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
250 GB SATA Hard Disk Drive 7200 rpm
2TB Seagate GoFlex USB 2 Drive
1TB Iomega Prestige USB 2 Drive
1.5TB Iomega Prestige USB 2 Drive (Samsung)
2TB WD MyBook Live NAS.
Mouse
Logitech Anywhere MX
Internet Speed
152 Mbs download 10 Mbs upload
Antivirus
Norton 360
Browser
Chrome
I'm having a little trouble setting up two virtual machines connecting to the internet. I've setup a Windows Server 2008 R2, and Windows 7 virtual machine with host-only networking on their own subnet.
The networking is host only, meaning that the VM's will ONLY be able to talk to each other. They won't be able to talk to the Internet. Sounds like you really wanted bridged or NAT instead of Host only.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Intel Q9550 2.83Ghz OC'd to 3.40Ghz8GB G.Skill PI DDR2-800, 4-4-4-12 timingsEVGA 1280MB Nvidia GeForce GTX570
Computer Manufacturer/Model Number
Self-Built in July 2009
OS
Windows 7 Ultimate x64
CPU
Intel Q9550 2.83Ghz OC'd to 3.40Ghz
Motherboard
Gigabyte GA-EP45-UD3R rev. 1.1, F12 BIOS
Memory
8GB G.Skill PI DDR2-800, 4-4-4-12 timings
Graphics Card(s)
EVGA 1280MB Nvidia GeForce GTX570
Sound Card
Realtek ALC899A 8 channel onboard audio
Monitor(s) Displays
23" Acer x233H
Screen Resolution
1920x1080
Hard Drives
Intel X25-M 80GB Gen 2 SSD
Western Digital 1TB Caviar Black, 32MB cache. WD1001FALS
PSU
Corsair 620HX modular
Case
Antec P182
Cooling
stock
Keyboard
ABS M1 Mechanical
Mouse
Logitech G9 Laser Mouse
Internet Speed
15/2 cable modem
Other Info
Windows and Linux enthusiast. Logitech G35 Headset.
Thank You for the replies. But i decided to use VmWare Workstation instead because it supports multiple subnets and it seems to run much better than VirtualBox did.
 

My Computer My Computer

At a glance

Windows 7 Home Premium 64bitAMD A6-3400M APU8GB DDR3 1333MHzAMD Radeon HD 6520G 512MB + AMD Radeon 6650M 1GB
Computer Manufacturer/Model Number
ASUS K53TA-BBR6
OS
Windows 7 Home Premium 64bit
CPU
AMD A6-3400M APU
Memory
8GB DDR3 1333MHz
Graphics Card(s)
AMD Radeon HD 6520G 512MB + AMD Radeon 6650M 1GB
Sound Card
RealTek HD Sound
Monitor(s) Displays
15.6"
Screen Resolution
1366 * 768
Hard Drives
Seagate Momentus 500GB 5400RPM
Mouse
Logitech Wireless Mouse
Internet Speed
ATT DSL 1.5Mbits/s
Well, I would expect VMWare Workstation to run better and offer more benefits, as it's a $200 application and VirtualBox is free. Honestly, I really like VMWare Workstation 8. I'm the VM guy at work, and I just recently purchased VMWare Workstation 8 and am happy with my decision. Helps me to more easily build more complex labs and try some tricky stuff.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Intel Q9550 2.83Ghz OC'd to 3.40Ghz8GB G.Skill PI DDR2-800, 4-4-4-12 timingsEVGA 1280MB Nvidia GeForce GTX570
Computer Manufacturer/Model Number
Self-Built in July 2009
OS
Windows 7 Ultimate x64
CPU
Intel Q9550 2.83Ghz OC'd to 3.40Ghz
Motherboard
Gigabyte GA-EP45-UD3R rev. 1.1, F12 BIOS
Memory
8GB G.Skill PI DDR2-800, 4-4-4-12 timings
Graphics Card(s)
EVGA 1280MB Nvidia GeForce GTX570
Sound Card
Realtek ALC899A 8 channel onboard audio
Monitor(s) Displays
23" Acer x233H
Screen Resolution
1920x1080
Hard Drives
Intel X25-M 80GB Gen 2 SSD
Western Digital 1TB Caviar Black, 32MB cache. WD1001FALS
PSU
Corsair 620HX modular
Case
Antec P182
Cooling
stock
Keyboard
ABS M1 Mechanical
Mouse
Logitech G9 Laser Mouse
Internet Speed
15/2 cable modem
Other Info
Windows and Linux enthusiast. Logitech G35 Headset.

My Computer My Computer

At a glance

Windows XP 32bitI34GbInternal
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows XP 32bit
CPU
I3
Motherboard
ASUS
Memory
4Gb
Graphics Card(s)
Internal
Antivirus
Avast
Browser
Firefox
Hi b0zmeister and welcome to seven forums. Thanks for the info. It may be useful for some of us.
 

My Computer My Computer

At a glance

Microsoft Windows 7 Home Premium 64-bit Servi...Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz8 GB DDR3Intel(R) HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Hewlett-Packard/G62-107SA Notebook
OS
Microsoft Windows 7 Home Premium 64-bit Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz
Motherboard
Hewlett-Packard 1425
Memory
8 GB DDR3
Graphics Card(s)
Intel(R) HD Graphics
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
Builtin
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
250 GB SATA Hard Disk Drive 7200 rpm
2TB Seagate GoFlex USB 2 Drive
1TB Iomega Prestige USB 2 Drive
1.5TB Iomega Prestige USB 2 Drive (Samsung)
2TB WD MyBook Live NAS.
Mouse
Logitech Anywhere MX
Internet Speed
152 Mbs download 10 Mbs upload
Antivirus
Norton 360
Browser
Chrome
No worries - :@):)
 

My Computer My Computer

At a glance

Windows XP 32bitI34GbInternal
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows XP 32bit
CPU
I3
Motherboard
ASUS
Memory
4Gb
Graphics Card(s)
Internal
Antivirus
Avast
Browser
Firefox
Well, I would expect VMWare Workstation to run better and offer more benefits, as it's a $200 application and VirtualBox is free. Honestly, I really like VMWare Workstation 8. I'm the VM guy at work, and I just recently purchased VMWare Workstation 8 and am happy with my decision. Helps me to more easily build more complex labs and try some tricky stuff.


Hi there
VMware workstation also has a HOST ONLY networking option -- this works just like it does in VIRTUAL BOX. As others have said choose NAT or BRIDGED if you want the VM to have its own access to the internet.

(My preference too -- VMware -- although VMware player is Free I got a copy of VMware WORKSTATION from work. What I particularly like is that the VM's can run in the background which means nobody even has to be logged on to the host and they can have accounts on the VM without having a HOST account. -- Rather like a "Server".

In fact I run a W2K3 VM server like this on a W7 Host that usually has nobody logged on to the W7 system. The W2K3 server supports multi-user operation of course.


Cheers
jimbo
 

My Computer My Computer

At a glance

Linux CENTOS 7 / various Windows OS'es and se...Intel i7 Intel i58GB, 16GBOn Motherboard
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom built, several laptops HP/ASUS
OS
Linux CENTOS 7 / various Windows OS'es and servers
CPU
Intel i7 Intel i5
Memory
8GB, 16GB
Graphics Card(s)
On Motherboard
Sound Card
Realtek HD audio
Monitor(s) Displays
Apple Cinema display, Samsung LCD
Screen Resolution
1920 X 1080
Hard Drives
4 X 1TB SATA
Mouse
Toshiba wireless laser
Internet Speed
> 20MB up
Back
Top