No internet access, with "NAT" mode

Discussions about using Linux guests in VirtualBox.
Post Reply
SamFF
Posts: 6
Joined: 21. Mar 2021, 20:06

No internet access, with "NAT" mode

Post by SamFF »

Hello!
I am using an Ubuntu VM on a Windows 10 host for quite a bit of time and everything worked fine. But a few days ago I decided that I wanted to reinstall it. I already had done this twice/three times roughly one week after creation it and everything went fine.

But this time when I started up the VM with the ISO disk for Ubuntu, there was no internet access during and after the installation. I decided to try again, but nothing. After that I created a new VM with the same configuration and tried again, but nothing.

I already searched on the internet and in this forum but the "solutions" I found didn't work for me.
I don't remember changing any configurations that might have caused that, and unfortunately I didn't make a snapshot of the machine, so I can't restore it.
I also don't know if this post should be in the "Windows hosts" or "Linux guests" forum. (should I post on both?)

I hope someone can help me and thanks in advance! :)
Last edited by SamFF on 24. Mar 2021, 19:02, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: No internet access, with NAT network mode

Post by scottgus1 »

SamFF wrote:should I post on both?
No, just one place is good.
SamFF wrote:No internet access, with NAT network mode
This can happen if the IP address range for the NAT Network is changed after the NAT Network has been used. See Virtualbox Networks: In Pictures: NAT network

Try NAT, not NAT Network, see what that does.
SamFF
Posts: 6
Joined: 21. Mar 2021, 20:06

Re: No internet access, with "NAT" mode

Post by SamFF »

I didn't explain me well, I meant that i was using NAT mode, sorry about that.
Try NAT, not NAT Network, see what that does.
Since I was using NAT I tried NAT network, and bridged. NAT network didnt work, but bridged is working for now, but i would still like to use NAT/NAT network.
Is there a way I can do that?

Thanks :)
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: No internet access, with "NAT" mode

Post by scottgus1 »

Normally NAT works out of the box... :shock:

While the VM is on NAT (not NAT Network), please run 'ip address' in the VM's terminal, and 'ipconfig /all' on the host OS's Command Prompt, and please post the text outputs of these commands.

Also, Please right-click the VM in the main Virtualbox window's VM list, choose "Show in Explorer". In the window that opens, zip the VM's .vbox file, and post the zip file, using the forum's Upload Attachment tab. (If you have a Windows host, please make sure all file extensions are shown, so you will be able to see the .vbox extension easier.)
SamFF wrote:I meant that i was using NAT mode, sorry about that
That's all right. Personally I wish they had come up with a different name for "NAT Network", since it sounds so similar to plain NAT.
SamFF
Posts: 6
Joined: 21. Mar 2021, 20:06

Re: No internet access, with "NAT" mode

Post by SamFF »

scottgus1 wrote:Normally NAT works out of the box...
But as I said it workd out of the box. It only stopped working when i tried to reinstall the OS. And I already had done that twice or tree times before.
scottgus1 wrote:While the VM is on NAT (not NAT Network), please run 'ip address' in the VM's terminal, and 'ipconfig /all' on the host OS's Command Prompt, and please post the text outputs of these commands.
GUEST:

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 fq_codel state UP group default qlen 1000
link/ether 08:00:27:a6:bc:e2 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15.24 brd 10.0.2.155 scope global dynamic noprefixroute enp0s3
valid_lft 85745sec preferred_lft 85745sec
inet6 fe80::f671:da80:aff3:151a/64 scope link noprefixroute
valid_lft forever preferred_lft forever

HOST:

Windows IP Configuration

Host Name . . . . . . . . . . . . : Laptop-HP
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Ethernet:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek PCIe GbE Family Controller
Physical Address. . . . . . . . . : BC-E9-2F-BF-5B-5F
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Ligação de Área Local* 1:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter
Physical Address. . . . . . . . . : 72-66-55-E9-00-51
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Ligação de Área Local* 2:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter #2
Physical Address. . . . . . . . . : F2-66-55-E9-00-51
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Wi-Fi:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek RTL8822CE 802.11ac PCIe Adapter
Physical Address. . . . . . . . . : 70-66-55-E9-00-51
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::a089:83d1:15d4:b2%21(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.8.99(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : fe80::fac3:9eff:fe33:adf1%21
192.168.8.1
DHCPv6 IAID . . . . . . . . . . . : 191915605
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-26-8B-0A-5F-BC-E9-2F-BF-5B-5F
DNS Servers . . . . . . . . . . . : fe80::fac3:9eff:fe33:adf1%21
NetBIOS over Tcpip. . . . . . . . : Enabled

Some things are in portuguese, but where it says "Ligação de Área Local" it means "local area connection" I think.
scottgus1 wrote:In the window that opens, zip the VM's .vbox file, and post the zip file, using the forum's Upload Attachment tab.
Ubuntu.zip
There it is
(1.96 KiB) Downloaded 16 times
Thanks for the help :)
Last edited by SamFF on 25. Mar 2021, 12:48, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: No internet access, with "NAT" mode

Post by scottgus1 »

SamFF wrote:I think that command if for windows command prompt. My guest is linux (Ubuntu)...
There's two commands there:
scottgus1 wrote:please run 'ip address' in the VM's terminal
scottgus1 wrote:and 'ipconfig /all' on the host OS's Command Prompt
SamFF
Posts: 6
Joined: 21. Mar 2021, 20:06

Re: No internet access, with "NAT" mode

Post by SamFF »

Oh ok Sorry

I edited the post with the outputs of the commands

:)
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: No internet access, with "NAT" mode

Post by scottgus1 »

Your VM is using NAT, and the 10.0.2.15 ip address is as expected. Could you please check that the 'cable' to the VM's adapter is connected? If so, please try a ping in your VM's terminal to your host 192.168.8.99, and also be sure that the Windows host firewall allows ping (ICMP Echo Request).
SamFF
Posts: 6
Joined: 21. Mar 2021, 20:06

Re: No internet access, with "NAT" mode

Post by SamFF »

scottgus1 wrote:Could you please check that the 'cable' to the VM's adapter is connected?
What do you mean by that? If you are talking about the "cable connected" checkbox in the VM's network settings, yes it is connected.
scottgus1 wrote:please try a ping in your VM's terminal to your host 192.168.8.99
I typed "ping -c 4 192.168.8.99" (I searched it on google and this was what it said to do) and the output was:

PING 192.168.8.99 (192.168.8.99) 56(84) bytes of data.
64 bytes from 192.168.8.99: icmp_seq=1 ttl=64 time=54.7 ms
64 bytes from 192.168.8.99: icmp_seq=2 ttl=64 time=61.4 ms
64 bytes from 192.168.8.99: icmp_seq=3 ttl=64 time=97.5 ms
64 bytes from 192.168.8.99: icmp_seq=4 ttl=64 time=110 ms

--- 192.168.8.99 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 54.737/81.012/110.324/23.475 ms

I'm not sure but I think that means it worked.

What can I do now?
Thanks :)
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: No internet access, with "NAT" mode

Post by scottgus1 »

SamFF wrote:If you are talking about the "cable connected" checkbox
Yes, that's what I had in mind, good.

Good, the ping from within the VM to the host ip shows (I think) that the VM OS can get out of the VM to the host through NAT.

Now please try 'ping 8.8.8.8' inside the VM's terminal.
SamFF
Posts: 6
Joined: 21. Mar 2021, 20:06

Re: No internet access, with "NAT" mode

Post by SamFF »

ping -c 4 8.8.8.8:

PING 8.8.8.8 (8.8.8.8 ) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=135 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=161 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=179 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=81.7 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3025ms
rtt min/avg/max/mdev = 81.709/139.281/179.372/36.704 ms

:)
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: No internet access, with "NAT" mode

Post by scottgus1 »

Ah, interesting, ping to 8.8.8.8 works! 8.8.8.8 is Google, so your VM does have internet access.

Your VM's 'lack of internet access' is probably not being able to resolve website names to the ip addresses that the names represent. DNS? I don't know how to fix this further, though. We'll need a network guru on this one.
Post Reply