Tried Network Adapters - No Internet Connection

Discussions about using Linux guests in VirtualBox.
Post Reply
scrimshaw
Posts: 2
Joined: 16. Sep 2022, 08:47

Tried Network Adapters - No Internet Connection

Post by scrimshaw »

Hello to all at VirtualBox Forum.

I'm a veteran computer user and Desktop builder, but my experience with virtual machines is
limited.

After installing VirtualBox I added two small Linux distros as guests. Porteus and SliTaz. They
booted normally and are running smoothly, but there is a problem. VirtualBox cannot connect to
the internet.

I performed a Google search and found an article about enabling a VirtualBox internet connection.
(I cannot post the link because I just registered with this forum.) The article says Bridged Adapter
is the best choice, so that's what I tried. Didn't work. Also tried NAT. Again, no internet connection.
I tried various combinations of network adapters and serial ports without any luck.

I don't know why VirtualBox is failing to create an internet connection.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Tried Network Adapters - No Internet Connection

Post by mpack »

Topic moved to "Linux Guests".
scrimshaw wrote:The article says Bridged Adapter is the best choice
There's no such thing as an absolute "best choice". The best choice depends on what you want the connection for. Bridged requires a lot more from the physical network, stuff you may not have or need. So if all you want is basic Internet access from the VM, i.e. a working Browser, then NAT is usually the best choice.

The fact that you tried different Internet adapters sounds bad. That's thrashing, and who knows what changes you made. The NIC selected by the VM template is one known to be natively supported by the guest OS - i.e. no need to hunt down drivers. If you choose a different NIC then you really need to know what you're doing. Please put it back the way it was. You might even be better off starting again, and this time do not change any network related setting in the VM settings or the guest OS.

NAT will work if the host has an Internet connection since that's all it does: it routes traffic through the host's Internet connection. We also, of course, assume that the guest OS has a decent Internet browser. All of the common Linux distros do, but I can say nothing about the two you mention.
Rootman
Posts: 251
Joined: 1. Oct 2012, 18:29

Re: Tried Network Adapters - No Internet Connection

Post by Rootman »

The way that the VMs NIC works is that it is internally bound to the HOSTs physical NIC when the VM is created. That is a virtual ethernet cable is pugged into a specific NAIC from the VMs NiC to the HSOTS physical NIC. If you have multiple NICs on the host you may have bound it to an unused one, like to a wifi NIC when the HOST is running on ethernet.

Check in the VMs settings under the Network settings while the VM is not running. I use bridged adapters, that should work here too. Under the NAME, see what physical NIC the virtual one is bound to. Is it a NIC that actually has connection to the network you want access to? If not then change it to the one that IS connected.

Also check the ADAPTER type under the ADVANCED drop down in the NIC settings. If you choose an oddball NIC type that your Linux version does not support then change it to another more common one and try it.

And finally be sure the ENABLED check box in the VM NIC setting is CHECKED, without that it's like the hardware isn't there.

And make sure that your router's DHCP server has enough free IPs to hand out. Many people limit the number of IPs in their DHCP scope to limit the number of connections to prevent any rogue connections from being made.

Finally try to setup a static IP address using the HOSTS network information, but use another free IP address on your subnet. If you are using a bridged VM adapter then it should appear on the network as just another NIC in another machine, the router should have no idea it's virtual, the guest will have the same gateway, subnet and DNS as the host, just the IP is different.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Tried Network Adapters - No Internet Connection

Post by scottgus1 »

My colleagues Mpack and Rootman have given you lots of good info. I'd suggest starting over with a new VM. That'll clear up any thrashing mistakes that were done.
scrimshaw wrote:two small Linux distros as guests. Porteus and SliTaz
Find out what basic Linux family these distros are from, then make sure the New VM Wizard's dropdowns are tuned properly. The reason for this is because the 'hardware' for the VM will be set correctly so the OS will have built-in drivers for the hardware.

The VM's network will automatically be set to NAT, and internet will be available in the VM. The VM will automatically get a 10.0.2.15 IP address, and you should be able to ping 8.8.8.8 (Google) and browse the web.
scrimshaw wrote:The article says Bridged Adapter is the best choice, so that's what I tried. Didn't work. Also tried NAT.
I have seen Linux VM OS's fail to notice network types change. Going from Bridged to NAT involves a change in IP address and gateway at least. I'm not entirely sure how to fix such a failure to respond, though. Rebooting the VM, or taking the adapter in the VM OS down then up, might work.

Additionally, Bridged doesn't always work with Wi-Fi. See Virtualbox Networks: In Pictures
scrimshaw
Posts: 2
Joined: 16. Sep 2022, 08:47

Re: Tried Network Adapters - No Internet Connection

Post by scrimshaw »

First, I want to apologize for not immediately returning to this thread. I have been trying for
days to login. I see invalid username/password or contact system administrator. I wish there
was time to figure out why this is happening. I own a business and don't have lots of spare
time.

(MOD EDIT: 3rd-party app testimonial removed)

I'm beginning to doubt that VirtualBox will ever establish a functioning internet connection.
Maybe this problem would be less daunting if I had more experience with Linux distros. What I
really need is something like a browser extension for VirtualBox. An applet that would automatically
select the correct network settings for a distro, might be the only way to resolve this problem.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Tried Network Adapters - No Internet Connection

Post by scottgus1 »

Scrimshaw, I removed your testimonial about the 3rd-party app. From a vey new poster like yourself, that sounded extremely spammy, especially since there is no indication that you have tried what has been suggested in the responses to your question. Spam is ban-worthy.
scrimshaw wrote:I'm beginning to doubt that VirtualBox will ever establish a functioning internet connection.
Millions of other internet-connected Virtualbox VMs would speak against this, including all the VMs I've ever made.
scrimshaw wrote:An applet that would automatically select the correct network settings for a distro
This already exists in the New VM wizard, with the two dropdowns that tune the new VM to the OS you're using. Some OS's automatically get tuned if you use the name of the OS in the VM name. A VM named "Linux Mint" will get tuned for Linux Mint's network needs, specifically the network adapter type most tuned to Mint. The VM's network connection type will default to NAT, which always gets internet in the VM if the host has internet.

Please try the suggested options. A new VM with no changes to the defaults chosen by Virtualbox except these following should get you an internet-connected VM:
Tune the New VM wizard's dropdowns to the Linux distro you're installing.
2 processors
Reasonable RAM based on the host's capacity, 2GB is a decent starting place.
Make the VM's disk dynamic and 50GB.
Install the Linux OS.
Post Reply