Page 1 of 1

Possible Bug with USB Network Device When Unlpugged

Posted: 10. Feb 2016, 17:54
by jerdill
I am running Windows 7 For the Host with a Windows 10 VM

The Windows 7 Host has a built in NIC wired up to one network (10.x.x.x), while it also has a USB Network Adapter wired up to a different network (192.168.x.x)

The Windows 10 VM is attached to the 192.168 network and it works as expected with internet access usually. An issue occurs however if I unplug the USB NIC from the host while the VM is running. Once the USB NIC is plugged back to the host, the VM OS never is able to reconnect to that network without rebooting the Windows 7 Host machine completely.

I've tried after unplugging and replugging the USB NIC only rebooting the Windows 10 VM, but that does not resolve the problem I have to reboot the host completely. I am able to save the VM machine state and reboot the Host then restore the VM machine state and the network connection is restored as expected. When the VM stops working, the 192.168 network on the Host still works though. I'm able to ping the main router after plugging the USB NIC back in to the HOST. It just seems like there is some kind of disconnect between the Host and the VM after disconnecting and reconnecting the USB NIC.

I should also mention the VM uses that adapter in Bridged Mode, so the traffic just passes through when everything is working normally.

The problem also occurs if I put the Host in Sleep Mode while the VM is running. Pausing the VM before unplugging the NIC and unpausing after the NIC is plugged back in has no effect either.

Is this a bug in the software, or is there some steps I could take to help remedy the situation? Thanks!

Re: Possible Bug with USB Network Device When Unlpugged

Posted: 10. Feb 2016, 18:42
by socratis
Please read the following: Minimum information needed for assistance. As far as the "VBox.log.zip" goes, here's what you do:
- Start the VM.
- Observe the erroneous behavior.
- Shut down the VM. Not suspend, not pause. Shut down.
- Right-click on the VM in the VirtualBox Manager.
- Select "Show Log..."
- Save it, ZIP it and attach it in your response (see the "Upload attachment" at the bottom of the form).

Re: Possible Bug with USB Network Device When Unlpugged

Posted: 10. Feb 2016, 19:30
by jerdill
Virtual Box Version: 5.0.14 - Extension Pack and Guest Additions both same version

Host: Windows 7 SP1 6.1.7601 64Bit (8GB RAM)
VM: Windows 10 10240 32bit (3GB RAM)

Virtual Box Log attached. Thanks for the help!

How Log was generated:
1: Booted to VM from fresh power off.
2: Verified Network Connection by Pinging a few servers (worked as expected)
3: Unplugged the USB Network Adapter from Host and waited about 15 seconds
4: Plugged USB Network Adapter back into Host and verified I was able to ping the router again on the HOST
5: Trying pinging servers and router again from the VM was not able to get reply on anything
6: Shut down VM
7: Saved Log File

Re: Possible Bug with USB Network Device When Unlpugged

Posted: 10. Feb 2016, 20:35
by socratis
So, did you actually unplug the NIC and re-plugged it? Because I don't see anything like that in the logs.

But I saw some things worth mentioning:
00:00:01.067831 File system of 'C:\Users\430011725\VirtualBox VMs\Windows 10\Snapshots' (snapshots) is ntfs
00:00:01.067845 File system of 'D:\VM Drives\Windows10.vhd' is ntfs
00:00:01.069248 File system of 'C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso' (DVD) is ntfs
Your VM is at the non-default D:\ drive and it's a VHD. Did you import the VM from somewhere else? If yes, where from? How?
And you still have your GA CD inserted. It's a good idea (generally speaking) to remove it.
00:00:01.325395   NumCPUs           <integer> = 0x0000000000000002 (2)
...
00:00:01.846033 CPUM: Physical host cores: 2
You assign both of your CPUs to your guest. Not a great idea...

Re: Possible Bug with USB Network Device When Unlpugged

Posted: 10. Feb 2016, 21:09
by jerdill
Yes I did unplug and Replug the USB Network Adapter while the VM was running. The VM doesn't see it as a USB device though it would see it as a Network Adapter.

When I unplug it, the Network adapter gets removed as a Network Interface on the HOST.

As for the location of the VHD file, I keep it on a secondary partition on the Host. That is where I keep my data on the Host, The C Drive is basically just the Host OS and some installed applications. I did used to have this VM running in a Microsoft Virtual PC so that is why it has a VHD extension.

Also my machine has 4 Core Processors so the VM is only using half.

Re: Possible Bug with USB Network Device When Unlpugged

Posted: 11. Feb 2016, 01:32
by socratis
Well, come to think of it, the guest doesn't see the USB device being plugged and unplugged. It sees a PCI network interface disappear. And I'm not sure how many operating systems are written with hot-pluggable network interfaces in mind. Not USB, mind you, but a PCI card. I would consider this normal behavior.

As for your cores. You have 2. With multi-threading they may look like 4, but that is useless to VirtualBox. Therefore, for all practical purposes you have 2. Remember, I didn't make it up, I copied and pasted from your log. As detected by VirtualBox. If you look at the log, you'll know what I mean.
00:00:01.845541 CPUM: Logical host processors: 4 present, 4 max, 4 online, online mask: 000000000000000f
00:00:01.846033 CPUM: Physical host cores: 2

Re: Possible Bug with USB Network Device When Unlpugged

Posted: 11. Feb 2016, 05:43
by jerdill
The VM OS doesn't actually see a Network Interface disappear, the network adapters still show in device manager. What should happen is the Virtual Box Network Interface settings should either go to disconnect mode or just switch to another available network adapter I would think. Or if I were to manually change the network adapter settings to use a different host adapter, then switch it back to the USB one, I would expect it to refresh that connection. The Host OS wouldn't really see any change happen except for a Network cable disconnect and reconnect.

Re: Possible Bug with USB Network Device When Unlpugged

Posted: 11. Feb 2016, 10:41
by socratis
jerdill wrote:he VM OS doesn't actually see a Network Interface disappear, the network adapters still show in device manager.
True. The simulated PCI adapter is there even after you disconnect its "bridge".
jerdill wrote: Or if I were to manually change the network adapter settings to use a different host adapter, then switch it back to the USB one, I would expect it to refresh that connection.
Isn't that the responsibility of the guest OS although?
jerdill wrote:The Host OS wouldn't really see any change happen except for a Network cable disconnect and reconnect.
Through a USB device? VirtualBox would have to ask each and every USB device if it is the same as the list of available network adapters presented to it by the host OS. Remember, VirtualBox sees the host's network adapters. If one disappears and re-appears, you want it to make a guess that you actually want to reuse said adapter.

To me it's far easier to either put your guest to sleep and then your host. Takes a couple of seconds more on your side, versus weeks of programming of a questionable algorithm that would add almost 0% value to their paying customers.

Re: Possible Bug with USB Network Device When Unlpugged

Posted: 11. Feb 2016, 15:55
by jerdill
If I truly am the only person experiencing this issue, then I would agree that its not worth them perusing a fix. I just thought I would get the conversation started, its possible others are experiencing something similar.

Thanks for the feedback so far.