Network setup so that guest doesn't care how host connects

Discussions related to using VirtualBox on Windows hosts.
Post Reply
abalter
Posts: 17
Joined: 16. Aug 2007, 16:09

Network setup so that guest doesn't care how host connects

Post by abalter »

I have Ubuntu 14.04 installed under Windows 10. I'm switching back and forth a lot between different network connections. I've been using bridged adapter and going back and forth between my wireless and ethernet adapters. Also, when I'm at work, where my ethernet is flaky, I can't get Ubuntu to connect to the internet at all when using the wireless (there is both secure and guest).

I thought that Nat meant that the VM connects through the host, so doesn't care how the host is connected. But when I try Nat, Ubuntu shows a successful connection, but no connectivity.

This is what I have in my interfaces file. I've tried enabling eth0, but that doesn't seem to help.

/etc/network/interfaces

Code: Select all

auto lo
iface lo inet loopback
#auto eth0
#iface eth0 inet dhcp
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Network setup so that guest doesn't care how host connec

Post by scottgus1 »

Bridged is known to not work all the time with Wi-Fi due to poorly-written host Wi-Fi drivers or network router firmware. You could try updating your host's wi-fi drivers, and if you can get access to the router, try updating the firmware. Bridged does make your guest appear as another PC on your network, which you may not need.

There is no built-in Virtualbox way that I know of to test and use whichever network setup works. You could put multiple NICs in the guest, one Bridged, one NAT, one something else, etc. and have a program in the guest that tests each for the desired connectivity, but such a thing isn't provided with Virtualbox, you'd have to develop it yourself or google for it.

It could be possible that your network setup in the Linux guest is bunged up from all the switching. Virtualbox NAT is the usual go-to for internet in a guest, and should work with Wi-Fi or wired. I'd try setting to NAT and resetting the guest network stuff, however that's done. File transfer can be done with Guest Additions Shared Folders, or if GAs aren't wanted, a Virtualbox Host-Only network on a second guest NIC.
abalter
Posts: 17
Joined: 16. Aug 2007, 16:09

Re: Network setup so that guest doesn't care how host connec

Post by abalter »

Thanks. Yes, NAT seems to be the default, and the guest does "connect" to the host, at least in the sense that the network icon shows connectivity. But I have no network access. So I wonder if it is something on the host side not letting traffic through. Maybe a firewall? I could test what happens if I turn that stuff off. I've tried different configurations in my interfaces file, and restarting the network daemon, but it hasn't helped so far.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Network setup so that guest doesn't care how host connec

Post by scottgus1 »

As a test, start a new guest with NAT, and install a fresh Ubuntu. let Ubuntu configure the network. See if it is able to get to the internet when the other guest fails. This will help determine if the problem is with the host and/or Virtualbox, or the failing guest.
abalter
Posts: 17
Joined: 16. Aug 2007, 16:09

Re: Network setup so that guest doesn't care how host connec

Post by abalter »

I'll give it a try. But too big a project just at the moment.
Post Reply