Bridging to USB network adapter

Discussions related to using VirtualBox on Windows hosts.
Post Reply
elfrider
Posts: 3
Joined: 12. Jan 2021, 15:48

Bridging to USB network adapter

Post by elfrider »

Hi,
I can successfully create a bridged network connection to a 'Realtek USB GbE Family Controller'. The problem is this adapter isn't always present and therefore VirtualBox will not allow the VM to launch without it (Nonexistent host networking interface, name 'Realtek USB GbE Family Controller' (VERR_INTERNAL_ERROR).

Is there any way of allowing the VM to ignore the missing adapter and allow me to connect/disconnect it as it suits while the guest OS is running?

Thanks.
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: Bridging to USB network adapter

Post by scottgus1 »

As far as I know there is no built-in way to cause Virtualbox to automatically ignore the absence of a network adapter the VM is Bridged to.

It should be possible to write a batch file that can query the existing network adapters, then issue appropriate vboxmanage commands to modify the VM's settings, then start the VM.
elfrider
Posts: 3
Joined: 12. Jan 2021, 15:48

Re: Bridging to USB network adapter

Post by elfrider »

Thanks for the reply. Even with a script like that, it would only allow me to launch the VM based on the current status of the USB adapter. It wouldn't allow me to be able to insert and use the adapter after the VM was already launched as the VM definition for the adapters only seems to be 'analysed' at boot up, so if it's not there to start with it never expects it to be there. However, the VM doesn't seem to mind me removing the adapter while it's running (and it also works automatically again after it's reinserted) - so if I could get round the boot up check somehow it would be good to go.
elfrider
Posts: 3
Joined: 12. Jan 2021, 15:48

Re: Bridging to USB network adapter

Post by elfrider »

May have just found a workaround.

In network connections on the host machine, I created a 'bridge' between 'VirtualBox Host-Only Network' and the USB adapter, and then set my VM settings to connect to this new bridge. Because the bridge is using a connection that is always present ('VirtualBox Host-Only Network'), it stays present itself, so the VM always sees a present connection, and launches ok. When the USB adapter is plugged in, it forms part of the bridge, and so provides the actual connectivity for the VM as and when required.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Bridging to USB network adapter

Post by mpack »

That is not recommended procedure. The "host only" network is mean to be an isolated virtual network, with its own IP address range and DHCP server.
Post Reply