No Internet Access in Virtual Machine

Discussions related to using VirtualBox on Windows hosts.
Post Reply
robertfg
Posts: 8
Joined: 20. May 2017, 19:46

No Internet Access in Virtual Machine

Post by robertfg »

Hello,

I just installed an Ubuntu Server version 10 and I can't get Internet access using either NAT or Bridged Adapter. Any suggestions would be welcome.

Thanks.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: No Internet Access in Virtual Machine

Post by socratis »

  • Select NAT. Is your guest getting an address? Is it set up to look for a DHCP server?
  • Can you ping your router? Can you ping 8.8.8.8? Can you ping google.com?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
robertfg
Posts: 8
Joined: 20. May 2017, 19:46

Re: No Internet Access in Virtual Machine

Post by robertfg »

I have configured the Network Adapter to NAT. When I ping 8.8.8.8, the server makes one attempt after another and never stops (not sure what the technical name for that is). When I try to ping my own laptop, the same happens.

Thanks for any assistance you can provide.
robertfg
Posts: 8
Joined: 20. May 2017, 19:46

Re: No Internet Access in Virtual Machine

Post by robertfg »

When I attempt to ping google (ping www.google.com), the server attempts and returns the following:

ping: unknown host www.google.com
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: No Internet Access in Virtual Machine

Post by socratis »

robertfg wrote: When I ping 8.8.8.8, the server makes one attempt after another and never stops
There are two potential outcomes in a ping command; it works or it doesn't. And it going to keep attempting and never stop, in both cases, unless you stop it with Ctrl-C (^C). The "works" vs "doesn't work" looks something like:
$ ping 8.8.8.8                     <-- This one works.
PING 8.8.8.8 (8.8.8.8 ): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=55 time=49.735 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=50.140 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=49.282 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=55 time=66.964 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 49.282/54.030/66.964/7.473 ms

$ ping 88.88.88.88                 <-- This one doesn't work. Can't ping.
PING 88.88.88.88 (88.88.88.88): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
^C
--- 88.88.88.88 ping statistics ---
5 packets transmitted, 0 packets received, 100.0% packet loss

$ ping 888.888.888.888             <-- This one doesn't work. Invalid address.
ping: cannot resolve 888.888.888.888: Unknown host
$

$ ping ThisDomainDoesntExist.com   <-- This one doesn't work. Invalid name or no DNS.
ping: cannot resolve ThisDomainDoesntExist.com: Unknown host
$
In your case, you're getting a "This address needs to be resolved (from a DNS server). I can't resolve that address, because (most probably) I can't talk to a DNS server":
robertfg wrote:ping: unknown host http://www.google.com
So, what are your network settings in your host and your guest for your DNS server? Is it a valid one? Can you ping it?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
robertfg
Posts: 8
Joined: 20. May 2017, 19:46

Re: No Internet Access in Virtual Machine

Post by robertfg »

Hi again,

To make sure I supply the correct information, I have taken screenshots of the results of my laptop's ipconfig command and the VM's Ubuntu server's ifconfig command (attached).

Ubuntu Server Settings
  • Code: Select all

    robert@ubuntu:-$ ifconflg
    eth0    Link encap:Ethernet  HWaddr 08:00:27:0d:b2:78
            inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
            inet6 addr: 2602:306:8388:3970:a00:27ff:fe0d:b278/64 Scope:Global
            inet6 addr: fe80::a00:27ff:fe0d:b278/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:2708 errors:0 dropped:0 overruns:0 frame:0
            TX packets:1345 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:202440 (202.4 KB) TX bytes=102462 (102.4 KB)
    
    lo      Link encap:Local Loopback
            inet addr:127.0.0.1 Mask=255.0.0.0
            inet6 addr: ::1/128 Scope:Host
            UP LOOPBACK RUNNING  MTU=16436  Metric:1
            RX packets:786 errors:0 dropped:0 overruns:0 frame:0
            TX packets:786 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes=116194 (116.1 KB) TX bytes=116194 (116.1 KB)
    
    virbr0  Link encap:Ethernet  HWaddr 1e:eb:06:20:bd:9d
            inet addr:192.168.122.1 Beast:192.168.122.255 Mask:255.255.255.0
            inet6 addr: fe80::lceb:6ff:fe20:bd9d/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST MTU=1500 Metric:1
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
            TX packets:91 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:0 (0.0 B) TX bytes=16065 (16.0 KB)
    robert@ubuntu:-$
    
My Laptop Settings
  • Code: Select all

    Wireless LAN adapter Local Area Connection* 12:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
    
    Ethernet adapter Bluetooth Network Connection:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
    
    Wireless LAN adapter Wi-Fi:
    
       Connection-specific DNS Suffix  . : attlocal.net
       IPv6 Address. . . . . . . . . . . : 2602:306:8388:3970::48
       IPv6 Address. . . . . . . . . . . : 2602:306:8388:3970:41c4:ff60:b430:c7f8
       Temporary IPv6 Address. . . . . . : 2602:306:8388:3970:717a:eea7:e231:b8a2
       Link-local IPv6 Address . . . . . : fe80::41c4:ff60:b430:c7f8%4
       IPv4 Address. . . . . . . . . . . : 192.168.1.75
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : fe80::lel4:48ff:fe37:4360%4
                                           192.168.1.254
    
    Ethernet adapter Ethernet:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
    
    Ethernet adapter VirtualBox Host-Only Network:
    
       Connection-specific DNS Suffix  . :
       Link-local IPv6 Address . . . . . : fe80::2d2c:bf72:e8d6:7375%8
       IPv4 Address. . . . . . . . . . . : 192.168.56.1
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . :
    
    Tunnel adapter isatap.{DD247171-24ED-468E-826C-9B337CAE1990}:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
    
    Tunnel adapter Teredo Tunneling Pseudo-Interface:
    
       Connection-specific DNS Suffix  . :
       IPv6 Address. . . . . . . . . . . : 2001:0:9d38:953c:30ab:la7d:3f57:feb4
       Link-local IPv6 Address . . . . . : fe80::30ab:la7d:3f57:feb4%10
       Default Gateway . . . . . . . . . :
    
I am not able to ping either the ip address (192.168.1.75) or the default gateway (192.168.1.254).

Thank you.
Last edited by socratis on 2. Jun 2017, 10:54, edited 2 times in total.
Reason: Replaced attachment with actual text.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: No Internet Access in Virtual Machine

Post by socratis »

I removed the pictures you attached and replaced them with the actual text. 1) it's smaller, 2) it's searchable. You should prefer this method, it works much better. Oh, and since you're in a HiDPI display, next time you post a screenshot, please shrink it by at least 50%.

As I said, if you can ping 8.8.8.8, if you can ping google.com, VirtualBox is working as it should. You should look elsewhere for your networking connectivity. Look in your host for firewalls, proxies, antivirus filters, web-cleaning applications, re-directors, etc.

Now, I really don't know what "virbr0" is doing in your Ubuntu. A quick search reveals (first result):
AskUbuntu wrote:The virbr0, or "Virtual Bridge 0" interface is used for NAT (Network Address Translation). It is provided by the libvirt library, and virtual environments sometimes use it to connect to the outside network.
So, I don't really know how you got that and what it may affect. Let's see if anyone else has any ideas...

For reference, here's what I get:
socratis@VB-Ubuntu:~$ ifconfig
enp0s3    Link encap:Ethernet  HWaddr 08:00:27:40:51:1a  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::d7e:242d:b564:a1c9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:77 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2191 (2.1 KB)  TX bytes:8379 (8.3 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:212 errors:0 dropped:0 overruns:0 frame:0
          TX packets:212 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:16797 (16.7 KB)  TX bytes:16797 (16.7 KB)

socratis@VB-Ubuntu:~$
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: No Internet Access in Virtual Machine

Post by Perryg »

"Virtual Bridge" is another attempt to create an isolation of the real network and in regards the whole proxy thing they seem to love these days. Just another pain in the *** if you ask me but that is not the real problem for the OP. VBox NAT should have worked out of the box. If you can not ping 8.8.8.8 then you do not have Internet connectivity. Possible causes are the cable is not connected in the guest settings, or it is being blocked by the host or before. If you did not change anything in the defaults when installing the guest server it should have detected the network and created the network stack at that point and should have told you there was or was not any network connectivity at that time. After install it gets tricky since the server version does not have a network manager and everything must be done in CLI and most folks just don't know what to do at this point and this would be outside the scope of this forum and need to be addressed with the OS forum that you are using.

Some basic causes for no connectivity is firewalls, virus software, and LAN restrictions especially on a corporate LAN.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: No Internet Access in Virtual Machine

Post by Perryg »

Why such an old version of Ubuntu? It reached its EOL in early 2015 and you will have issues getting the proper packages.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: No Internet Access in Virtual Machine

Post by socratis »

I"m still not clear if the OP can or can't ping 8.8.8.8. The original response was:
robertfg wrote:When I ping 8.8.8.8, the server makes one attempt after another and never stops
which can be interpreted in both ways. That's why I gave the OP all the potential outcomes to a ping. They never replied.

@robertfg
Please clarify what happens if you ping 8.8.8.8. I gave you an example, and some answers. What's happening in your case?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
robertfg
Posts: 8
Joined: 20. May 2017, 19:46

Re: No Internet Access in Virtual Machine

Post by robertfg »

Hi, I'm sorry if I wasn't clear, but I cannot ping 8.8.8.8. It does not resolve, that is, it comes under your "can't ping" example.
Last edited by robertfg on 3. Jun 2017, 08:03, edited 1 time in total.
robertfg
Posts: 8
Joined: 20. May 2017, 19:46

Re: No Internet Access in Virtual Machine

Post by robertfg »

I will try to reinstall without my anti-virus software and see what happens.
robertfg
Posts: 8
Joined: 20. May 2017, 19:46

Re: No Internet Access in Virtual Machine

Post by robertfg »

I will also try to install a more recent version of Ubuntu. Thank you.

Although I should mention that I did try with a more recent version previously and got the same results; however, I'll try again and verify firewalls, anti-virus, etc.

I have not had this problem before on other VMs I've installed and that currently work, so it is surprising that this one has presented such a problem.
robertfg
Posts: 8
Joined: 20. May 2017, 19:46

Re: No Internet Access in Virtual Machine

Post by robertfg »

So I went through a basic installation of "ubuntu-16.04.1-server-amd64.iso" The installation seemed to go smoothly, but I have the same issues I had before. I can't ping 8.8.8.8, and when I attempt to ping http://www.google.com, I receive the "unknown host" message.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: No Internet Access in Virtual Machine

Post by socratis »

You should then look at your host and see what might be affecting network connectivity. As I said:
socratis wrote:You should look elsewhere for your networking connectivity. Look in your host for firewalls, proxies, antivirus filters, web-cleaning applications, re-directors, etc.
PS. You didn't have to install the whole thing. Just booting from the LiveCD and testing the network connectivity would be enough. And much, much faster ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply