Page 1 of 1
Bridging to USB network adapter
Posted: 12. Jan 2021, 15:53
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.
Re: Bridging to USB network adapter
Posted: 12. Jan 2021, 20:41
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.
Re: Bridging to USB network adapter
Posted: 12. Jan 2021, 21:44
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.
Re: Bridging to USB network adapter
Posted: 12. Jan 2021, 22:07
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.
Re: Bridging to USB network adapter
Posted: 13. Jan 2021, 11:53
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.