Internet connection in Virtualbox won't work (Mac OS X host / Windows XP guest)
Asked Answered
B

12

20

I have been trying (and failing) to set up any kind of internet connection for my Windows XP virtual machine and would appreciate some assistance.

Details are as follows:

Virtualbox 4.3.0

Mac OS 10.6.8 host

Windows XP SP 2 guest

My internet connection is via Airport, with the IP address of the host being 192.168.1.2 (dynamically assigned by the router) and the router 192.168.1.1.

I think the problem I'm having is either not knowing which settings I'm supposed to be changing or what configuration I need. Is Windows XP supposed to retrieve its settings from an in-built DHCP server in Virtualbox or do I need to manually specify the IP address and gateway? If so, how do I know which addresses I'm supposed to be using?

In the Virtualbox preferences I also tried adding a host-only network and switching on the DHCP server, but when I ping any of the IP addresses used in the default configuration I just got either a "request timed out" or "destination unreachable" message.

As a last resort I tried installing the guest additions but this stopped Windows from even being able to boot so that doesn't seem to be an option either.

Taking all those points into account and trying not to complicate things, I thought I'd start over from the beginning again and the easiest option seemingly was to set-up a bridged adaptor connection and then (in Windows XP) manually specify the same IP addresses that the host has been assigned. But this didn't work either - the guest was unable to ping the router and the host got automatically assigned a different IP address after a Finder alert appeared saying that another computer on the network was already using the same IP address.

Thanks for any assistance!

Bunkhouse answered 17/1, 2014 at 12:53 Comment(19)
Bridged adapter works for me just fine. Both host and guest are using DHCP, both get distinct IP addresses, both can connect to the router (i.e. to Internet) and to each other. Try configuring it that way. Say A is router, B is host, C is guest. B and C are using DHCP. C configured with bridged adapter. Then try pinging: A -> B, B -> A, A -> C, C -> A, B -> C, C -> A. What you see?Attribute
Thanks for replying. If I set the Virtualbox connection to bridged adaptor and then set the TCP/IP connection in Windows XP to "Obtain an IP Address automatically" nothing seems to happen - the output from ipconfig shows that the guest is using a self-assigned IP address and does not have an IP address set for the gateway (router?).Bunkhouse
I once had such problem, when the router was set to allow only predefined MAC addresses. Could it be the case with you?Attribute
I don't think that's the case with my setup as I've never had to specify any MAC addresses. After logging-in to the admin control panel for my router to check this though, I did see that the DHCP server leased an IP address to the MAC address that Virtualbox was set to, so I'll try manually using this IP address in Windows XP to see what happens.Bunkhouse
That didn't work either - seems Windows XP is unable to see either the host or the router, and pinging the guest from the host machine just results in a time out.Bunkhouse
I'd try the following hack (although result is not guaranteed): Lets suppose your VM is named "xyz". Close all VirtualBox windows. Find "xyz.vbox" file - it is an XML file containing VirtualBox configuration (for the given VM). BACKUP THIS FILE. Then edit it with your favorite editor, remove the section <Network>...</Network> completely. Start VirtualBox, go to VM properties, select "Network", enable network adapter and set it to "Bridged Adapter". In "Name" combobox select the "real" adapter which is actually connected to the net (cable or wifi). Then click "OK", start VM, see what happens.Attribute
Don't change other network parameters (within VM properties) - do small changes step by step. As I told you, with me it works out of the box with very minimalistic network setup - just "Enable Network Adapter", "Attached to: Bridged Adapter" and "Name: eth0".Attribute
Removing the <Network>...</Network> section of the configuration file just greyed out the options in the Network settings, so it was not possible to configure anything after that point. When I first started using Virtualbox I used default settings with no configuration in Windows XP, first for NAT and then Bridged Adapter with no success - I would expect internet access to work out of the box as well but this doesn't seem to be the case for me.Bunkhouse
Which network names you see in "Name" field of "Network" section in "settings" dialog?Attribute
If Bridged Adapter is selected in the settings then I see two names, "en1: Airport" and "en0: Ethernet", Adapter Type is greyed out, Promiscuous Mode is set to Allow All, MAC Address box is greyed out and Cable Connected is checked. Thanks again for your help, btw.Bunkhouse
One more idea how to isolate problem: connect your Mac to the router via Ethernet (not Airport). If in this case VM guest will start to see the network, then this could be reported as Airport-specific bug to the VirtualBox team. If not, then, um, try installing and running VirtualBox on another computer, but on the same network.Attribute
Ok, thanks - I'll try that option again although it didn't previously work. I'm beginning to think that the Virtualbox software is too clever for its own good and/or it just outright doesn't work for some setups. MBP/Snow Leopard/Airport setup is hardly non-standard for an OS X application though is it?Bunkhouse
For the benefit of anyone else that's having this problem, the solution that worked for me in the end was simply to switch to VMware Fusion - no issues whatsoever and it all worked first time with no configuration needed. In fairness to VirtualBox, some aspects of the software work very well, the performance is generally very good and for some people it works out-of-the-box just fine, but not being able to get the internet connection working was for me a real non-starter.Bunkhouse
Experiencing this issue on OS X Mojave, I have an Airport Extreme. My PC running a Vbox VM works fine (no internet issues). Though nothing works on my MacBookPro, I’ve tried both Vbox and VMware Fusion. For debugging purposes I decided to use my phone as a hotspot and connect my MBP to it... funny enough I the virtual machine can now connect to the internet. Which brings up the questions: Is the problem the Airport Extremem or the MacBookPro...?Sussna
@Sussna Your MBP is likely to be a lot newer than mine, but my guess is that there's still some underlying incompatibility/bug in Apple's Airport drivers when it's trying to manage a "bridged" connection from a software application. I never found a way to get Virtual Box working but VMware Fusion works fine for me with my current setup, although I've noticed with Vista that the connection sometimes doesn't work if the VM has been suspended. The fix is to open IE9 and load any site (?) and that somehow makes the connection accessible to any other Vista software that needs it.Bunkhouse
@NoelWhitemore I will be talking to my ISP about this issue this week. It’s definitely a router/modem/Airport Extreme issue. My suspicion is that the ISP’s modem/router is trying to assign IP addresses and it’s messing things up? I get the “double-NAT” error when the AirPort Extreme is running in DHCP & NAT mode, so I’ve switched the airport to run in bridges mode. Forgive me if I’m misusing any terms — this isn’t exactly my area of expertise... thanks for any help! If it helps any, the VMWare VM is Windows Server 2008 R2.Sussna
@Sussna If it helps, my copy of VMware Fusion is configured so that the network connection shares the host's connection and the VMs aren't seen by the router. According to the VMware documentation, this means that any running VMs get a private address from VMware's virtual DHCP server and don't have an IP address reserved on the "external" network. This would seem to be the simplest option if you can get it working, particularly if you want to run multiple VMs at the same time. This issue is probably outside of an ISP's scope and they might not want or be able to do much from their end.Bunkhouse
@NoelWhitemore If it’s a private IP & isn’t on the “external” networks then would it mean that the Android device that I’m developing on would not be able to connect to the WebServer VM. I think I had actually set it up as you had described — when initially debugging. I was happy at first because the VM had connection, but couldn’t communicate with the Android device that needs the server in order for me work. I’ve talked to others in this situation & read other blogs similar to this & it seems like the ISP will help especially if their modem/router is assigning IPs. Thanks!Sussna
@Sussna It sounds like the internal NAT configuration that I'm using is not going to work with the setup you need. All I can suggest is to try using the bridging option and make sure that both the VM and the Android device have internet access, then confirm whether the VM can ping the Android device (or vice versa, if you have that facility on the Android device).Bunkhouse
B
18

Choose "Bridged Adapter" and "PCnet-FAST III" in Network Settings.

Name en1: Wi-Fi (AirPort)

Worked for me, too. "PCnet-FAST III" is in the advanced options and can only be selected, when the machine is not running (but selected) via the 'Machine' > 'Settings' Menu option
Virtualbox 5.0.38

Would have put this in the comments, but as i just registered I don't have enough reputation points to do so.

Brownfield answered 30/5, 2017 at 14:12 Comment(1)
This is the one that worked for me, My mac is connected via ethernet and configured a wi-fi connection, in this case the name is en0: WI-FI(AirPort) and this solution works even if the ethernet cable is unplugged.Gonzalo
L
10

This issue is essentially due to a the allocation of the same IP addresses to both the Host WiFi adapter (by the wifi router's DHCP server) and the Guest interface (by the VirtualBox DHCP server under Nat networking).

From the VirtualBox documentation about the integrated DHCP server Fine-tuning the VirtualBox NAT engine:

In NAT mode, the guest network interface is assigned to the IPv4 range 10.0.x.0/24
by default where x corresponds to the instance of the NAT interface +2. So x is 2
when there is only one NAT instance active. In that case the guest is assigned to the 
address 10.0.2.15, the gateway is set to 10.0.2.2 and the name server can be found at
10.0.2.3.

Looking at your host's WiFi adapter's IP address you will find that the address assigned to it is from the 10.0.2.0/24 network range as well.

This is the reason for the issue as now the Nat driver for VirtualBox is confused by the fact that the host and guest addresses are from the same subnet.

To fix this you can change the subnet served out by the VirtualBox DHCP server using the VBoxManage command(while the VM is powered down):

VBoxManage modifyvm VMName --natnet1 "192.168/16"

And you're good to go.

Leucotomy answered 24/11, 2014 at 17:10 Comment(0)
T
8

I tried all of this but it did not work for me, instead I tried to shutdown vb mac and go to the settings in the "Network" part and enable all "Adapters" like in the screenshots. It works for me.

Tab 1:

enter image description here

Tab 2:

enter image description here

Tab 3:

enter image description here

Tab 4:

enter image description here

Theadora answered 27/7, 2018 at 16:24 Comment(1)
Works on macOS SieraMeacham
I
7

Chose Bridged Adapter and PCnet-FAST III in Network Settings.

Instant answered 15/4, 2015 at 17:28 Comment(2)
This works just great with VirtualBox 5.0.2 on Mac OSX 10.10 Yosemite with Windows XP 64-Bit Professional (German) as a guest.Berl
keep in mind that PCnet-FAST III can only be selected when the machine is not running.Aliaalias
R
6

I have to choose following to make it works.

My settings:

  1. MacOS Majave, 10.14.3;
    2) Virtual Box, VirtualBox VM 6.0.8 r130520 darwin.amd64 (May 13 2019 15:40:24) release;
    3) Ubuntu 16.04 LTS, 64 bit.

I choose "NAT" and "PCnet Fast III" and it worked now.

Thanks for other suggestions here.

Rankin answered 20/6, 2019 at 14:32 Comment(3)
Worked for me as well! (y)User
Worked for me as well :)Jesus
This is awasome, it work for me !!! thank you so much for sharing~Rheingold
G
3

I know this is more than likely not the issue with most, but after many hours of trying to fix my internet connection from a Mac Air host to an Virtual Box XP guest I finally went into my network settings in XP and realized that the network was disabled. Hopefully most are smart enough to look here first, but I wasn't. Again the law of parsimony proves true. Hope this helps some other poor dumb bastard.

Gelatinate answered 3/10, 2014 at 11:4 Comment(1)
That's always worth checking - after spending too long trying to fix things you miss the obvious ones. The odd thing is thought when I recently re-installed XP in VMware Fusion I didn't change any configuration settings, which means that XP automatically detected the connection. Maybe this is something specific to VMware Fusion, but it worked with Vista also - I haven't even opened the networking settings since I've installed it and the Internet connection works just fine.Bunkhouse
F
3

MacBook Pro - Mojave:

Network settings - NAT

Go to advanced settings and click on Advanced.

Click on port forwarding and click on add a connection. Enter 0 in the first PORT box and 1 in the second port box. Leave the IP addresses blank.

Click apply.

Make sure the "Cable Connected" box is checked. Worked for me with no other issues. All of the suggestions above did not resolve the problem on my MacBook Pro.

Hope this helps someone....

Furry answered 22/10, 2019 at 18:45 Comment(2)
Doesnt work for me because vm doesnt allow the IP adresses to be blank.Proudhon
Worked for me! I couldn't add a connection @Proudhon since I Probably got the same error message as you did. But setting the Network settings to 'NAT' and selecting 'PCnet Fast III' was enough for me to get the connection working in my VM.User
S
2

In case anyone had the same problem, here is my case:

Settings:

  1. macOs Mojave 10.14.6
  2. VirtualBox Version 6.0.12 r133076 (Qt5.6.3)
  3. ISO: CentOS Linux release 7.7.1908 (Core)

I tried NAT,Bridged Adapter and other adapters,they just won't work. When i typed "ip addr",the result looks like this, there's no ipv4 address assigned to the enp0s3 interface.

[root@localhost ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ether 08:00:27:43:59:bf brd ff:ff:ff:ff:ff:ff

So i guess maybe there's something wrong with the network interface config, which is not that obvious when you are not familiar with linux. We can check specified network interface config through following command.

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=0b1aa850-85ba-478d-8efb-94f3c16d47e1
DEVICE=enp0s3
ONBOOT=no

The ONBOOT field is set to no,which indicates the network interface is not activated.We can start the enp0s3 interface by following command.

[root@localhost ~]# ifup enp0s3

The Internet is back on. ^_^

Subdominant answered 29/9, 2019 at 6:27 Comment(1)
This works for MacOS Big Sur 11.1, Virtualbox 6.1, CentOS 8. Using NAT.Metallist
L
1

OS X El Capitan (10.11.6) and VirtualBox 5.1.30

For me it was just changing the Adapter Type to PCnet-FAST III:

Attached to: NAT
Name: -
Adapter Type: PCnet-FAST III (Am79C973)
Promiscuous Mode: Deny
Laryngotomy answered 28/10, 2017 at 15:48 Comment(0)
W
0

What ended up working for me on OS X El Capitan with a Windows 7 VirtualBox was the following settings:

Attached to: Bridged Adapter
Name: en0: Wi-Fi (AirPort)
Adapter Type: Intel PRO/1000 MT Desktop (82540EM)
Promiscuous Mode: Allow All
Welldone answered 9/10, 2017 at 15:40 Comment(0)
F
0

VM: 7.0.20 r163906

MacOS: HighSierra 10.13.06

For me nothing of the above worked, or it seemed to me that I have working internet connection with DNS resolving (command ping google.com works just fine).

So I assumed that the Safari browser was not updated, so trying Firefox Extended Support Release worked fine! Steps that I have performed:

  1. Download Firefox DMG file on host machine: https://www.mozilla.org/en-US/firefox/all/#product-desktop-esr Parameters for Firefox Browser download
  2. Transfer DMG file to MacOS VM
  3. Install Firefox on MacOS

Make sure that when downloading Firefox Browser, you are downloading compatible version with OS that you have running in your VM.

Fallen answered 19/7, 2024 at 17:42 Comment(0)
B
-1

Had the same issue, used Bridged adaptor & Wifi Airport, Installed generic ethernet card drivers off internet, reboot and boom found it. Works.

Bloody answered 20/1, 2021 at 19:58 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.