Windows Guest Network / Internet not working in NAT Mode

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
hungrygeneration
Posts: 22
Joined: 22. Jul 2019, 04:09

Windows Guest Network / Internet not working in NAT Mode

Post by hungrygeneration »

I am having trouble accessing my network and the internet in my Windows 10 guest. I've looked at some of the help on the forums but nothing has worked so far. Any ideas on what could be going wrong?
My host is Mac OS Catalina
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Windows Guest Network / Internet not working in NAT Mode

Post by scottgus1 »

Start the guest from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the guest from within the guest OS if possible. If not possible, close the Virtualbox window for the guest with the Power Off option set.

Right-click the guest in the main Virtualbox window's guest list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.

Also, right-click the guest in the main Virtualbox window's guest list, choose Show in Finder. Zip the guest's .vbox file, and post the zip file, using the forum's Upload Attachment tab.

Finally, run 'ifconfig' or 'ip address' in the Mac's terminal, and 'ipconfig /all' in the Windows guest's command prompt, and post the texts of the command outputs.
hungrygeneration
Posts: 22
Joined: 22. Jul 2019, 04:09

Re: Windows Guest Network / Internet not working in NAT Mode

Post by hungrygeneration »

Thanks so much for your help! I am also attaching a couple of screenshots in case they are helpful.
Attachments
Screen Shot 2020-07-30 at 5.45.32 PM.png
Screen Shot 2020-07-30 at 5.45.32 PM.png (63.09 KiB) Viewed 2683 times
Screen Shot 2020-07-30 at 5.47.57 PM.png
Screen Shot 2020-07-30 at 5.47.57 PM.png (66.6 KiB) Viewed 2683 times
Windows 10-2020-07-30-17-48-19.log.zip
(31.94 KiB) Downloaded 8 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Windows Guest Network / Internet not working in NAT Mode

Post by scottgus1 »

Ok, looks like we have a good log, but not the .vbox file or command outputs?
hungrygeneration
Posts: 22
Joined: 22. Jul 2019, 04:09

Re: Windows Guest Network / Internet not working in NAT Mode

Post by hungrygeneration »

Oh sorry about that. Here you go! That command did not work in MacOS but I am attaching screenshots with my ip addresses if that is what you are after?
Attachments
Screen Shot 2020-07-31 at 10.41.57 AM.png
Screen Shot 2020-07-31 at 10.41.57 AM.png (66.88 KiB) Viewed 2666 times
Screen Shot 2020-07-31 at 10.41.49 AM.png
Screen Shot 2020-07-31 at 10.41.49 AM.png (66.81 KiB) Viewed 2666 times
Windows 10.vbox.zip
(2.39 KiB) Downloaded 6 times
hungrygeneration
Posts: 22
Joined: 22. Jul 2019, 04:09

Re: Windows Guest Network / Internet not working in NAT Mode

Post by hungrygeneration »

Then on the windows guest
Attachments
Screen Shot 2020-07-31 at 10.43.58 AM.jpg
Screen Shot 2020-07-31 at 10.43.58 AM.jpg (97.1 KiB) Viewed 2666 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Windows Guest Network / Internet not working in NAT Mode

Post by scottgus1 »

OK, we're getting closer. You'll notice that the host's Wi-fi and Ethernet are connected in the 192.168.1.### IP range, whereas the guest's IP address is 192.168.0.15.

Your guest .vbox file says the network is connected thus:
<Network>
<Adapter slot="0" enabled="true" MACAddress="0800270277B5" cable="true" promiscuousModePolicy="AllowNetwork" type="82540EM">
<DisabledModes>
<BridgedInterface name="en7: Thunderbolt Ethernet Slot 1"/>
<InternalNetwork name="intnet"/>
<NATNetwork name="NatNetwork"/>
</DisabledModes>
<NAT network="192.168/16"/>
</Adapter>
</Network>
Your guest is connected through an unusual "NAT network". Note the active Blue <NAT network="192.168/16"/> vs a previously attempted but now unused Brown <NATNetwork name="NatNetwork"/>. The extra space in the active Blue setting between 'Nat' and 'network' is not supposed to be there, and the name of all numbers is unusual though possible.

Something is wrong with that NAT Network.

Shut your guest down, then switch that guest adapter to just NAT. That should connect Internet, and the guest should get a 10.0.2.15 IP address.

See Virtualbox Networks: In Pictures for how these network types work.
hungrygeneration
Posts: 22
Joined: 22. Jul 2019, 04:09

Re: Windows Guest Network / Internet not working in NAT Mode

Post by hungrygeneration »

As you can see in previous screen shots it is just NAT already. How can I get it to reset itself and delete that other network? Also, I did double check none of the other network adapters are active. Thanks again!
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Windows Guest Network / Internet not working in NAT Mode

Post by scottgus1 »

hungrygeneration wrote:As you can see in previous screen shots it is just NAT already.
Regrettable to disagree, but that's not what the .vbox file says. NAT and NAT Network are two different things. NAT network can be pebcak-corrupted rather easily, whereas NAT is more robust. (Screenshots can be old, but the .vbox file gives the guest state when the file was posted.)

Further evidence that your guest was not on NAT is that its IP address is 192.168.0.15, fitting the distorted-named NAT Network's IP range, whereas simple NAT's default IP address is 10.0.2.15. While it is possible to change NAT's IP address, doing so requires deliberate command-line access.

So I believe you are still on the bunged-up 'NAT network'. If you have switched to NAT, post another .vbox file and 'ipconfig /all' from the guest.

(FWIW Though 192.168 IP range is allowed to be /16 according to https://en.wikipedia.org/wiki/Private_network, it is of interest to me that Windows defaults to giving 192.168 a /24 mask, which would block your 192.168.0.15 guest from communicating on the host's 192.168.1.# network. Also, NAT and NAT network behave like house routers: one shouldn't have the same IP range on both sides.)
hungrygeneration
Posts: 22
Joined: 22. Jul 2019, 04:09

Re: Windows Guest Network / Internet not working in NAT Mode

Post by hungrygeneration »

Well in trying to fix this problem I did run a command listed on these forums to change the ip so it is possible I did that!! :-(
So if you look at the time stamp this screenshot and the vbox are identical or nearly identical. Maybe that would be helpful. Is there any command to kick it back into an automatic IP address perhaps?
Attachments
Screen Shot 2020-08-01 at 8.59.43 PM.jpg
Screen Shot 2020-08-01 at 8.59.43 PM.jpg (102.83 KiB) Viewed 2635 times
Windows 10.vbox.zip
(2.69 KiB) Downloaded 7 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Windows Guest Network / Internet not working in NAT Mode

Post by scottgus1 »

hungrygeneration wrote:I did run a command listed on these forums to change the ip
Ok, now I get it. And I now understand the unusual display in the .vbox's XML:
<NAT network="192.168/16"/>
This is regular NAT with a modified IP address range.

The manual https://www.virtualbox.org/manual/ch09. ... ess-config says to use this command:
VBoxManage modifyvm <VM-name> --natnet1 "192.168/16"
which is the exact result your NAT shows. https://www.virtualbox.org/manual/ch08. ... networking says that this should undo the IP address modification:
VBoxManage modifyvm <VM-name> --natnet1 default
Have the guest fully shut down first.

If this command does not reset the guest's IP address to 10.0.2.15, then disable this network card and enable the second card. Set it to NAT as well and don't change the IP address. The guest must be fully shut down for switching the cards.
hungrygeneration
Posts: 22
Joined: 22. Jul 2019, 04:09

Re: Windows Guest Network / Internet not working in NAT Mode

Post by hungrygeneration »

Thank you so much! That last command fixed the problem 100%. Whoops! :roll: I appreciate you helping me! How many times do you help people when they have done it to themselves?? Probably a lot!! :D
Post Reply