Opened 9 years ago
Last modified 7 weeks ago
#14374 reopened defect
Network adapters not working after host returns from sleep Win 7 host Linux Mint 17.2 guest
Reported by: | Johnny Kilo | Owned by: | |
---|---|---|---|
Component: | network | Version: | VirtualBox 5.0.0 |
Keywords: | Cc: | ||
Guest type: | Linux | Host type: | Windows |
Description
Host is Dell E7440 laptop running Windows 7 SP1 Enterprise 64 bit. VirtualBox version 5.0.0 r101573. Wireless NIC is Intel Dual Band AC 7260 as a bridged adapter virtualized as Intel PRO 1000 MT desktop. Guest is "Linux Mint 17.2 Rafaela built on Ubuntu 14.04.2 LTS Trusty Tahr and kernel is 3.13.0-37-generic. The guest additions have been installed
Issue started appearing after the 5.0 update recently. After my host has returned from sleep my network connection is lost on my guest until i completely shutdown. I have tried switching the host adapter to other adapters. Disconnecting and reconnecting the cable in Devices>Network Settings. I have also tried just rebooting. The VM has to be completely powered off and back on for the adapter to work again. The network connection icon in the task bar stays discontented the entire time. No error message is given at any time.
Attachments (9)
Change History (117)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Please reopen if still relevant with VBox 5.0.4. In that case, please attach the requested log file.
comment:3 by , 9 years ago
Hello,
I have the same problem with 5.0.12 I'm attaching the asked log file
comment:4 by , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
by , 9 years ago
Attachment: | VBox.2.log added |
---|
follow-up: 10 comment:6 by , 9 years ago
comment:8 by , 9 years ago
Same problem: Bridged network connection is broken after resuming from sleep.
Workaround:
- Close the VM (saving machine state)
- Re-open the VM
- Then on guest run
systemctl restart network.service
(A full reboot isn't required, "restarting" the VM in VirtualBox by resuming from a saved VM state seems to restore connectivity.
Host: VirtualBox 5.0.14 on Windows 7/64 bit Guest: RHEL 7.2 64 bit. Network: Bridge Network adapter, attached to GbE.
Notes:
- The guest sees the network go up/go down, from changing the state of the cable connection from Network Settings.
- The guest never receives any traffic as seen by tcpdump.
- No packets from the guest are seen on the host.
Steps to Reproduce:
- Start Linux guest with bridge adapter
- Verify guest network is working.
- Put host system to sleep.
- resume host system from sleep.
- Try guest network.
I will attach a clean VBox.log. Let me know if there is other information that I can provide to help fix this.
comment:9 by , 9 years ago
Please consider raising the priority of this bug. Having to restart the VM everytime my laptop goes to sleep doesn't feel like a minor bug to me. Thanks.
by , 9 years ago
Attachment: | VBox.3.log added |
---|
VBox.log after host system resumed from sleep, guest network broken.
comment:10 by , 9 years ago
Replying to tomasth:
Testing this workaround https://www.reddit.com/r/HomeServer/comments/2ndfzq/virtualbox_with_ubuntu_guest_network_failure/
Manual control of the network interface, stoppping/starting the network isn't enough to resolve the problem I'm seeing. The VM's network interface is not receiving any network traffic when the network interface is broken, verified with tcpdump -n -i ...
What works for me:
- Closing the VM while saving state
- Restarting the VM from the saved session
- Restarting the network inside the VM to do DHCP, etc.
comment:12 by , 9 years ago
priority: | minor → major |
---|
The more tickets you open the more time we need to handle all the tickets. The ticket priority is only a rough rating. These priorities don't really define which tickets are handled first. Fixing issues in this bugtracker is done on a best-effort basis. You could even help by debugging the problem and make suggestions what to fix -- the source code is freely available.
comment:13 by , 9 years ago
Understood. Thanks for raising the priority.
If there is anything I can do to help debug this please let me know. I'm not sure where to start.
comment:14 by , 8 years ago
An additional data point: If there are two bridged VMs open when the machine sleeps/wakes-up, closing and reopening a single VM will NOT restore network connectivity. BOTH VMs (or presumably all bridged VMs) must be closed before restarting the VM to get bridged network connectivity back.
If there is anything I can do to help debug this please let me know.
comment:15 by , 8 years ago
I've been having the same problem on Windows 8.1 for a couple of months now, can't exactly pinpoint when it started. Currently the error occurs under these conditions:
Host: Windows 8.1 running VirtualBox 5.0.20 r106931
Guest: Ubuntu 14.04
Network type: Bridged Adapter
After resuming host system from sleep, there is no connection between guest and host (pinging doesn't work either way). No errors are shown. The only solution is to shutdown the guest and start it again. VBox.log attached.
by , 8 years ago
Attachment: | VBox.4.log added |
---|
Host woken up from sleep, network doesn't work on guest.
comment:16 by , 8 years ago
I am also facing the same issue.
Host: Windows 8.1 64-Bit running VirtualBox 5.0.20 r106931
Guest: XP 32-Bit Network type: Bridged Adapter
After resuming host system from sleep, there is no connection between guest and host (pinging doesn't work either way). Restarting on guest system does not resolve the issue. The only solution is to restart the host system.VBox.log attached.
comment:17 by , 8 years ago
Same issue faced since 5.0.8. Windows 7 host, Redhat 5.7 guest. The problem is systematic.
Same workaround as mentioned by a previous comment:
- close ALL opened VMs (no need to restart them)
- re-open VM
- run "service network restart" to reload the network stuff
comment:18 by , 8 years ago
Also experience the guest losing network connectivity issue for quiet some time (Has happen for more than a year - I've been using Virtual box for about 4 years in total)
Has occurred with a Windows XP Home Guest running on windows 8/8.1 premium and now windows 10(migrated from 8.1), after suspending/hibernating the Host OS.
Currently Running Oracle Virtual Box 5.0.20 r106931 with latest addons install in the guest. The host network is being accessed in bridge mode
Happens about 80% of the time (20% of the time it works after resume)
I usually have to close the guest and "Save the machine state", close the Virtual Box Manager, then reload the Guest saved state (Haven't had to restart the Host OS)
Some times, closing the guest - "Save the machine state", reload the save state, then repeat these steps a second time some times works to restore network connectivity (without having to shut down the Virtual Box Manager)
This bug is painful; but is survival-able (the bug where the virtual box host services crash [taking the guests out too] during a accidental shutdown is way worse! :-)
I'd still like to see some time put into fixing it. Can provide logs and assist in any testing support
Sincerely
PaulW
comment:19 by , 8 years ago
Is there anything I can provide to help this along? I too am now facing this severe problem. I have just upgraded to 5.1 from 4.3.28. I had been holding off on the upgrade because 4.3.28 is the last release where I had the ability to resume from sleep and have the network work properly.
This is a fairly painful regression.
follow-up: 100 comment:20 by , 8 years ago
I performed some network interface dumping and I could see the guest (Linux Ubuntu 14.04 in this case) was clearly still trying to use the host bridge but the host bridge but no packets make it to the bridge.
For at least the VirtualBox 5.1, I managed to find a work around by dynamically setting the VM's network interface to none and putting it back into bridged mode. I can do it with the UI, but it was easier to create a script with the following:
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm linux nic1 null
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm linux nic1 bridged "Intel(R) Dual Band Wireless-AC 7260"
So at least I have a temporary work around for now. It would be nice if the VirtualBox driver could properly reset itself after a system resume. This certainly worked in the past with the 4.3.28 version.
comment:21 by , 8 years ago
@LinuxGuy thanks for that, it's the first workaround that works for me. I just had to make the argument match the adapter name (in my case "Realtek 8821AE Wireless LAN 802.11ac PCI-E NIC"), not type like I thought at first.
comment:22 by , 8 years ago
Met same issue. virtual box version: 5.0.22.r108108 , and bridged network.
comment:23 by , 8 years ago
I have upgraded to 5.1.2 r108956, it seems that this issue is fixed. @LinuxGuy, @BoxGoBoom @jankondratowicz anyone confirmed?
comment:24 by , 8 years ago
@shawguo no, unfortunately update to 5.1.4 didn't help in my case, I still need to manually restart the interface.
comment:25 by , 8 years ago
@LinuxGuy thanks for posting that work around! It saves a lot of time for rebooting the VM every day. Works fine for me with the following settings.
Host: Windows 7 SP1 Pro 64 bit. VirtualBox Version 5.1.2 r108956
Guest: Mageia Linux 5 with kernel 4.4.13
The guest additions have been installed
Syntax:
"C:\FULL-PATH-TO\Oracle\VirtualBox\VBoxManage.exe" controlvm "NAME-OF-VM" nic1 null
"C:\FULL-PATH-TO\Oracle\VirtualBox\VBoxManage.exe" controlvm "NAME-OF-VM" nic1 bridged "NAME-OF-NETWORK-INTERFACE"
for example
C:\>"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "Mageia Linux" nic1 null
C:\>"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "Mageia Linux" nic1 bridged "Intel(R) 82577LM Gigabit Network Connection"
I will now upgrade to VirtualBox Version 5.1.4 r110228 but according to the Changelog there was nothing fixed in that context
follow-up: 27 comment:26 by , 8 years ago
Hello.
I "confirm" that the version 5.1.4 did not solve this problem.
Regards, Daniel
comment:27 by , 8 years ago
Replying to dchiaramello:
Hello.
I'm running Windows 10 Host and CentOS Guest, I fix this problem with the spuch solution, >but when I run my guest in Headless mode VBoxManage says that Virtual Machine isn't >running...
Regards, Pablo
comment:28 by , 8 years ago
just to confirm this behavior on my hp envy dv6-7xxx series with intel centrino advanced n-6235 and onboard realtek 8168 gb-ethernet:
host: windows 10 pro, virtualbox 5.1.4 guest: windows 7 ultimate, vb guest additions 5.1.4
after coming up from sleep state i always have to disable/enable virtualboxes network bridge for every nic assigned to the guest.
regards, peter
ps: vb 5.1.6 does not address the issue. the problem is still existing.
comment:29 by , 8 years ago
I'm also noting the network issue still occurring on build Version 5.1.6 r110634 (Qt5.5.1)
Win 10 home running a windows XP guest using a Lenovo Flex15 laptop with 6gig of ram, and a I5 processor.
Usually occurs after resume sleep/hibernate. May occur more often after physical network change (Home wifi to wired work connections)
Solve issue by saving machine state & closing the VM guest, closing the Virtual Box Manager, then open manager, and start up saved vm guest.
comment:30 by , 8 years ago
no change with new maintenance release 5.1.8. workaround still seems to fix the problem.
comment:31 by , 8 years ago
I can confirm the same symptoms with VirtualBox 5.0.16 on Windows 7.
Saving, turning off/on VirtualBox and restoring fixed the network problem.
by , 8 years ago
Attachment: | DevVM_Template_12c_7.0_1-2016-11-14-19-29-47.log added |
---|
Lost network connection on host-only (eth0) adapter
comment:32 by , 8 years ago
I have been having the same issue for several months. It started occurring after an upgrade, but I didn't keep track of which version. Unfortunately, my only workaround is to reboot the host machine! None of the other workarounds mentioned on this thread solve the problem.
VirtualBox 5.1.8 r111374 (Qt5.5.1)
Host: Windows 10 Pro
Guest: Ubuntu 14.04.4 LTS
Host-Only (same problem with Bridged)
Each time I suspend/resume or switch networks, I lose network connectivity between the host and the guest (same problem with host-only or bridged). I've tried the VBoxManager suggestion as well as all of the suspend, shutdown vbox, start combinations and nothing works. This is my development laptop, so I'm constantly switching networks and suspending. Rebooting the host each time is untenable. I added an attachment of the vbox.log
comment:33 by , 8 years ago
Just to add, that I am seeing the same symptoms, running: Windows 10 host 14393.447 (with all mainstream updates as of 21/11/2016), VirtualBox 5.1.8r111374 and a single Linux Mint 17.2 VM with bridged networking. The NIC is a Realtek PCIe GBE on an HPE 250 Gen5 laptop. After waking up from hibernate, the VM has no connectivity at all - restarting the VM does not help. It needs to be powered off fully, then powered on. Another workaround, that others have mentioned, is to change the network of the VM while it is running from bridged to none then back again.
A fix would be great!
comment:34 by , 8 years ago
Another user here with the same problem. New laptop with fresh installation of everything: Windows 10 Professional, VirtualBox 5.1.8, and Ubuntu Mate 16.10.
Thanks to LinuxGuy above for the simple workaround script, that will save me a few seconds every day until this is fixed.
I don't have time to debug this, but I am happy to try debug builds of VirtualBox or collect logs/metrics to send if it helps.
comment:35 by , 8 years ago
Just upgraded VirtualBox to 5.1.10 r112026 - same issue and workaround as in 5.1.8. Not surprising, since nothing in the changelog indicating "broken bridged networking after resume from sleep/hibernate on windows hosts" was fixed.
follow-up: 37 comment:36 by , 8 years ago
VirtualBox Version 5.1.10 r112026 (Qt5.6.2) under Windows 10 - same issue
comment:37 by , 8 years ago
Replying to vicpryl:
VirtualBox Version 5.1.10 r112026 (Qt5.6.2) under Windows 10 - same issue
Same problem here using Version 5.0.30 r112061 Windows10 host and WindowsXP guest
comment:38 by , 8 years ago
VirtualBox 5.1.12 r112440 (latest stable Production release) on Windows 10 Host (fully patched 1607 14393.576) - same issue still persists. Dear Devs - any indication when this issue of bridged networking not working after host wakes up (workaround being to stop all VMs or detach and attach the NICs for running VMs) might be resolved?
comment:39 by , 8 years ago
I'm running into a not identical but possibly related problem. I use a Surface Pro 4 connected to the Surface Dock. I use an Ethernet cable connected to my Surface Dock for all networking needs while in the office. I have my VM use a bridged adapter on my Surface Ethernet Adapter. My VM is Ubuntu 16.10, and my host is Windows 10 Professional.
If I need to unplug the dock, I lose all network connectivity in my guest OS. That's understandable as I've disconnected the Surface Ethernet Adapter. However, if I plug the Surface Pro back into its dock, while the Surface Ethernet Adapter is reconnected to the system, I still get no internet connectivity. My connectivity is lost until I shut down and restart the VM or if I power down while saving the machine state and power back up.
I'll attach a clean log file shortly.
Most people here seem to report issues with sleep. I wonder if the root issue is that, from the eyes of VirtualBox, that the network adapter is powering off, and once that happens, it doesn't know how to claw it back.
by , 8 years ago
Attachment: | VBoxSVC.log added |
---|
comment:40 by , 8 years ago
VirtualBox 5.1.16 (latest stable Production release) on Windows 10 Host - same issue still persists. Dear Devs - any indication when this issue of bridged networking not working after host wakes up (workaround being to stop all VMs or detach and attach the NICs for running VMs) might be resolved?
comment:41 by , 8 years ago
I'm having the same problem, but found a workaround that I didn't see in the comments here...
- Host: Windows 7
- Guest: Ubuntu 16.04 LTS
- VirtualBox: 5.1.14 r112924
- Vagrant: 1.9.2
The problem seems to be that the VBoxNetDHCP.exe process(es) associated with the VM stop working. Shutting down the VM leaves these processes still running.
My workaround:
- Shutdown VM
- taskkill /t /f /im VboxNetDHCP.exe
- Restart VM
This will start new VboxNetDHCP processes and networking returns (for me).
comment:42 by , 7 years ago
@LinuxGuy
Just saw your post. "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm..... works like a charm.
Thank you.. You've save my life. This has been driving me NUTTs for years!
Paul
comment:43 by , 7 years ago
TL;DR: Try upgrading your host NIC's driver to the latest from the manufacturer.
I've been bitten by this issue for a while. Today, I got WOL working which involved upgrading my NIC driver to the latest from the manufacturer (as opposed to what comes with Windows). Then I started working on implementing @LinuxGuy's workaround, so I tried to reproduce the issue to see if running the batch script would work around but, but I can no longer reproduce the issue.
So it may be that the root problem was the host NIC driver, not VirtualBox. This makes intuitive sense to me. After all, missing power management behavior (WOL) was the reason I had to upgrade the driver to get that to work. Perhaps it's some other missing power management behavior in the driver that causes this issue.
Hope this helps others. I'll try to remember to follow up here if the issue returns for me.
comment:44 by , 7 years ago
same problem here, windows 10. it's a host-only adapter not nat or bridged, so i don't think using the lenovo driver for my nic will change anything. i've tried setting it to "not attached" and then "host-only", without result. i've also tried "disabled" for my windows driver for the virtualbox network interface and then "enabled", with no change.
symptom is, after a suspend/resume cycle on the host, my guests can still ping each other on their shared host-only network, but they cannot ping the host.
i am not having this problem with my "natnetwork" adapters. theoretically i could choose to reach the host from the guests on that network, but i don't want to. i have two interfaces, one natnetwork that i use to reach the internet; one host-only that i use to reach the host and between the guests.
this has been a problem for years. on 5.0 and 5.1. all versions. most annoying, though i feel badly about complaining since the software is so cheap (i am a pro user) and otherwise so excellent.
my workaround is to reboot the host. i think the bug is in the windows "virtualbox network adapter" driver. likely it is not fully reinitializing after a resume, due to some kind of ABI drift.
help wanted. thanks for reading.
comment:45 by , 7 years ago
Latest VirtualBox 5.1.22 r115126 on latest Windows 10 1703 (15063.296 - "Creators Update") still same issue - bridged networking in VMs is broken when host wakes up from sleep/hibernate. Workaround is either to shutdown the VM (restart is not enough) and then start it, or as has been suggested by others:
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm MY-VM-NAME nic1 null
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm MY-VM-NAME nic1 bridged "MY-HOST-NIC-NAME"
Obviously adjust the above for your environment.
Dear VBox devs - this has been an issue for years on multiple VBox versions and Windows Hosts. I believe this is the active defect where it should be being tracked - could we please at least get an update or acknowledgement?
comment:46 by , 7 years ago
VirtualBox development
- is able to reproduce the problem and
- is investigating. No ETA for a fix.
comment:48 by , 7 years ago
Anybody experiencing this problem when using briding to a wired interface? So far we were only able to reproduce the problem with bridged to a wireless interface.
comment:50 by , 7 years ago
I'm having this issue with bridged adapter using wired interface, Windows 8.1 host, Ubuntu 14.04 guest.
by , 7 years ago
Attachment: | Unbenannt.JPG added |
---|
comment:51 by , 7 years ago
My report in comment:25 also based on a (bridged) wired connection using a Lenovo X201 Laptop with an Intel 82577LM Gigabit Network Chip. Host and Guest OS are still the same as in the report while VirtualBox is at version 5.1.22 at the moment of writing.
comment:52 by , 7 years ago
I'm experiencing the same issue with both wired & wireless connections.
- VirtualBox 5.1.22 r115126
- Host: Windows 10 Pro
- Guest: Ubuntu 14.04
The workaround mentioned several times here works for me:
- Disable the guest's networking
- Set VirtualBox network adapter(s) to "not attached"
- Close VirtualBox network adapter dialog (if applicable)
- Set VirtualBox network adapter(s) to "bridged"
- Enable the guest's networking
Happy to provide more info or run tests to help.
comment:53 by , 7 years ago
Workaround:
# Set adapter to "not attached" in VirtualBox, click Ok
# Ensure Guest no longer sees the interface (e.g. missing in top right menu in Fedora 25)
# Set adapter to "bridged" in VirtualBox, click Ok
# Connect adapter to Wired network
Fedora 25 guest on Windows 10 Pro Host and VirtualBox 5.1.22
comment:54 by , 7 years ago
I'm on Win 10 with Laravel Homestead Ubuntu as my guest. I'm using wifi. I need to run homestead.bat reload --provision
probably every time Windows wakes up.
comment:55 by , 7 years ago
Yes, I am also experiencing this when bridging to a wired adapter.
Host: Windows 10 Pro 64bit 1703 Build: 15063.540 VirtualBox: 5.1.26 r117224 Guest: Linux Mint 17.2 64bit Kernel: 3.16.0-38-generic Host NIC used for bridging: Realtek PCIe GBE Family Controller (there are other NICs on the host, including wifi and several OpenVPN TAP adapters, but none of these are being bridged - usually, I have only the one guest VM above running)
comment:56 by , 7 years ago
Same issue, running vbox on Windows:
- Windows 10 Pro 64bit
- Vbox: 5.1.26 r117224
- Guest: ubuntu 16.04.1 LTS
comment:57 by , 7 years ago
My unscientific bridged network fix:
- Close your VM
- Under advanced Networking, change the adaptor to a PCnet III type.
- restart
This fixed it for me across 3 reboots, couldn't get the other card type to give me internet without a stop and restart of the network, or turning it from bridged to unbridged and back again.
comment:58 by , 7 years ago
I have the same issue with a Windows 10 host and a Linux guest. This is for firmware development, with an IDE and debugger on Windows and a compiler on Linux. This bug makes it very annoying to use my laptop on the go.
comment:59 by , 7 years ago
Same issue here:
OS X 10.13 High Sierra Host,
Windows 10 Guest.
Resuming from sleep on the OS X Host causes the wireless bridge to fail for the Windows 10 Guest. I keep rebooting the VM to fix, but will try the VBoxManage command lines.
comment:60 by , 7 years ago
Same issue: Windows 10 PRO (HOST) Zentyal Linux 5 (Guest)
The HOST always has connection, but sometimes I have to reboot the machine to things goes back.
comment:61 by , 7 years ago
Same issue but with USB-Ethernet adapter AX88772 and DHCP service.
Host: Win7 x64, Guest: Ubuntu 14.04 x64 with , VirtualBox bridge networking
If usb disconnect/connect: host get IP from dhcp an works ok, guests dhcp request not found.
The same issue found when DHCP lease has expired but DHCP service was not available (server was at shutdown). After DHCP server start - host get IP from dhcp an works ok, guests dhcp request not found.
Workaround with set nic=null and back did not help. Only guest shutdown and start works ok.
comment:62 by , 7 years ago
Host: Win7 Ultimate S1 x64
Guest: Win Server 2016
Limited internet acces (or read none) after waking up. Happens more than often.
Found a mere simple workaround, no need to reboot, or save state or whatever.
Open a cmd prompt and ping www.google.com, seconds after the pong comes in the internet connection is back up. Didn't try any other site, but I'm guessing any other site will work fine too.
comment:63 by , 7 years ago
Seems that comment #62 is a joke. There never comes a "pong" from any server...
comment:64 by , 7 years ago
One thing is working for me is to change the network adapter (this includes survival of any ongoing ssh session using MobaXterm).
Steps:
1.Open virtualbox adminitrator UI.
2.For problematix VM go to configuration/network. Change network adapter to any other one (in my case i have 2 ethernet NICS). Click ok to apply dialog conf changes.
3.For problematix VM go to configuration/network. Change network adapter to the original one. Click ok to apply dialog conf changes.
- Any ongoing ssh session are recovered in few seconds.
- Ping to internet from ssh session to check connection is recovered.
This procedure takes me around 1 minute to be executed (manually). Probably it maybe potentially automated throuhg some script. For me is better than restarting the whole VM, as my ongoing ssh sessions are surviving...
comment:65 by , 7 years ago
I just tried this workaround with changing the network adapter and it worked for me. However, it didn't seem faster or more convenient that saving and restoring the VirtualBox. But of course this depends on the hardware.
comment:66 by , 7 years ago
Same issue:
Virtualbox 5.2.4.
Wired connection
Host: Windows 10 Pro
Guests: Cent OS 7
The network connection works after power sleep mode, not after hibernation. The only solution is to fully close the VMs and restart them; rebooting the VMs won't work.
follow-ups: 68 70 comment:67 by , 7 years ago
This bug is insanely irritating. I'm on Windows 10 running an Ubuntu 16.04 Server VM and it happens every time. I'm not sure why this hasn't been fixed in 2 years, but here's the "best" automated fix that I've come up with. I noticed that changing the VM's Networking "Promiscuous Mode" allowed me to reconnect/ping the guest VM. So:
- Add C:\Program Files\Oracle\VirtualBox to the sytem or user's PATH. (or just add it to the commands below).
- Create a FixVirtualBox.bat file and add:
@echo off VBoxManage.exe controlvm "My VM Name" nicpromisc1 allow-all VBoxManage.exe controlvm "My VM Name" nicpromisc1 deny
- Change "My VM Name" to the VM you're using and have the 2nd nicpromisc1 option set the final value you want (deny is the default). Note that you must switch between two options for it to work as it must change for it to want to reset the networking.
- To automate this, create a new "Basic Task" in Window's "Task Scheduler"
- For Trigger, select "When a specific event is logged"
- Log: Microsoft-Windows-NetworkProfile/Operational
- Source: NetworkProfile
- Event ID: 10000
- Select the batch file created earlier to run for this event.
This will run the batch file automatically any time the network is restore on the Windows host. This seemed slightly more correct than from a sleep 'wake' event, but either probably work.
It's possible there's another, simpler VBoxManage command that will work to reset the networking, and I'm sure this can be automated to modify only running VMs, but I'm hoping the underlying bug is fixed soon.
comment:68 by , 7 years ago
Replying to DougC:
Thanks for the tip. I did try it but didn't work. The commands ran without any issues but the connection to the VMs still doesn't work.
follow-up: 71 comment:70 by , 7 years ago
Hi DougC,
I kept trying because it is indeed an annoying bug. Your script didn't work because in my VMs nicpromisc1 is originally "allow-all," so when running the script there was no change. I inverted the commands, first "deny" then "allow-all" and it works! The bat has to be run as admin and problem solved. Thanks for your solution.
Replying to DougC:
This bug is insanely irritating. I'm on Windows 10 running an Ubuntu 16.04 Server VM and it happens every time. I'm not sure why this hasn't been fixed in 2 years, but here's the "best" automated fix that I've come up with. I noticed that changing the VM's Networking "Promiscuous Mode" allowed me to reconnect/ping the guest VM. So:
- Add C:\Program Files\Oracle\VirtualBox to the sytem or user's PATH. (or just add it to the commands below).
- Create a FixVirtualBox.bat file and add:
@echo off VBoxManage.exe controlvm "My VM Name" nicpromisc1 allow-all VBoxManage.exe controlvm "My VM Name" nicpromisc1 deny
- Change "My VM Name" to the VM you're using and have the 2nd nicpromisc1 option set the final value you want (deny is the default). Note that you must switch between two options for it to work as it must change for it to want to reset the networking.
- To automate this, create a new "Basic Task" in Window's "Task Scheduler"
- For Trigger, select "When a specific event is logged"
- Log: Microsoft-Windows-NetworkProfile/Operational
- Source: NetworkProfile
- Event ID: 10000
- Select the batch file created earlier to run for this event.
This will run the batch file automatically any time the network is restore on the Windows host. This seemed slightly more correct than from a sleep 'wake' event, but either probably work.
It's possible there's another, simpler VBoxManage command that will work to reset the networking, and I'm sure this can be automated to modify only running VMs, but I'm hoping the underlying bug is fixed soon.
comment:71 by , 7 years ago
The script runs when Windows is back from hibernation or sleep, but doesn't work most of the times. Now I'm just running plain "sudo service network restart" in the guest CentOS VMs and it works.
comment:72 by , 6 years ago
Now "sudo service network restart" doesn't work any more. The only solution is to close the VM and restart it again. Please VirtualBox team, try to fix this bug.
comment:73 by , 6 years ago
This morning I tried pinging the VM after hibernation: it replied, but still, the services were down. I checked "ip addr" in the VM and the NIC was missing. So I tried
sudo ifup enp0s3
(enp0s3 is the VM's NIC name)
Followed by:
sudo service network restart
And it works. Apparently it is an issue of CentOS, FAQ #2 https://wiki.centos.org/FAQ/CentOS6#head-b67e85d98f0e9f1b599358105c551632c6ff7c90.
comment:74 by , 6 years ago
Host OS: Windows 10
Guest OS: Ubuntu 16.04.4 server (x32)
VirtualBox: 5.2.10
Issue: after starting guest OS its network interface did not want to work. (I tried all virtual Intel adapters and bridge mode - results were the same, I mean negative ones)
Workaround:
Command sudo service networking restart on guest machine.
But I did not want to do it after every reboot. Therefore in original /etc/rc.local file of guest machine I have added one row (before "exit 0"):
/usr/sbin/service networking restart
(This row restarts network services immediately after starting guest OS)
And after that my guest system worked properly after every reboot.
comment:75 by , 6 years ago
Same here. Host: Windows 10 Pro. Virtualbox 5.2.18 r24319.
Gusts: Oracle Linux 7.5 x64.
After sleep hostonly adaptor is down.
Host can ping itself (10.0.10.1) but not guests (10.0.10.11 & 10.0.10.12). Guests can ping eachother. Guests cannot ping host (10.0.10.1).
Restart guests, deattaching, disabling the adaptor on the host or any other workaround won't help - only HOST reboot fixes it.
Super annoying.
comment:76 by , 6 years ago
Another affected user here.
VirtualBox: 5.2.18
Host: Windows 10 Pro
Guests: Multiple. Another Win 10 Pro, Ubuntu 18.04, RHEL 6, ...
Wired connection. After the router is rebooted, all VMs lose connection indefinitely. Host needs to be rebooted in order to reestablish the connection.
comment:78 by , 6 years ago
@aleksey I tried build r125384. At first, the issue seemed resolved when allowing my laptop to sleep 'naturally' (by walking away/coming back after a brief period of time). But when resuming from a hibernation (overnight), the network error reappeared.
Virtual Box 5.2.19 r125384 (Qt5.6.2) Host: Windows 10 Pro (build 17134 / 1804) Guest: Windows 7 Pro SP1 (build 7601) Guest Additions: r125339 (this seems odd?)
comment:79 by , 6 years ago
@aleksey I tested the development snapshot 125396 and I can confirm what Jim Hume describes above: it appears to retain the connection coming from light/short sleep, but after the sleep/hibernation hybrid by windows 10 kicks in the connection is lost. Additionally I had this dev snapshot crash the running machine once after coming back from this state (I did not note the error sadly, but I think it mentioned something about unexpected memory access violation).
If it helps, the fix described above by DougC of changing the "Promiscuous Mode" setting to force the machine "reconnect" after sleep worked for me on a stable build (but it's far from ideal).
comment:80 by , 6 years ago
Tried 5.2.19-125396. VMs still lose connection indefinitely after roouter is rebooted.
comment:81 by , 6 years ago
comment:82 by , 6 years ago
First I thought it is still a problem in Version 5.2.20 r125813 (Qt5.6.2). I am using NAT Network, host is Windows 10, and few Centos 7 guests. They communicated between each other fine, until the host went to sleep. After waking up, even ping did not work: says host unreachable. On the other hand, the network outside this virtual router was perfectly visible, including internet. So only the in-subnet communication was lost. However, because of some other network issues, I had to fix my /etc/sysconfig/network-scripts/ifcfg-enp0s3 on all virtual machines, and looks like it is working now. I tested it by letting the host sleep for 30 minutes, and it is fine after waking up.
comment:83 by , 6 years ago
I have the same issue and found quite simple workaround: "replug" the cable of network card after waking up from hibernation. Can be done by toggling checkbox in Settings of running machine (Network / Advanced / Cable connected). The same can be done by
VBoxManage controlvm "machine_name" setlinkstate1 off # and on afterwards
I've created simple script for that https://gist.github.com/filimonov/58779d1495e81568fb36a52463d2bdb1. You can schedule that script to on wakeup event.
If that will help also in other cases listed here - thta workaround is quite safe and may be can be added in VirtualBox itself?
PS. My configuration is VirtualBox 5.2.22 (host: Windows 10 Home, guest: Ubuntu Trusty 14.04.5 LTS), AMD Ryzen 5 based laptop (rather it's not important, but Ryzen is known to have issues / 'freezes' when running Linux, latest version of linux kernel address some of those issues).
comment:84 by , 6 years ago
New Datapoint: Network gone after return from suspend in guest debian stretch, host win10. restarting network service and "disconnecting" the virtual network cable did nothing. switching promiscuous mode from on to off fixed it immediately without needing to reboot nor restart network services. I don't think I need it on so I'll know after a few more days if the problem goes away or the switch is the crucial trigger.
Vbox v.5.2.18 r124319.
comment:85 by , 6 years ago
@mkokidko the switch is the trigger, a change in promiscuous mode forces a reset in the virtual network interface of some sort, but the connectivity is always lost on waking from hibernation, hence you need to trigger the network reset every time the computer awakes. That's why several people here on this ticket are writing scripts to do this with every awake event.
It seems like this reset trigger is something that could be built into VirtualBox itself like @filimonov suggests.
comment:88 by , 5 years ago
I also have this issue with a Windows 10 host, Ubuntu 18 guest, and USB ethernet adapter, guest networking in either bridge or NAT mode. After coming back from sleep, guest network is down, while host network works. If I run network enumeration in Wireshark on the host, the guest network starts working. I am now on VirtualBox 6.0.6 r130949
comment:90 by , 5 years ago
Same here: windows 10 host and guest, bridged adapter. My workaround: open network settings (while guest runs), select 'advanced', select one of [the other] 'Promiscuous Modes', click OK. The network interface seems to reset resulting in a guest that's online again. If necessary, reset Promiscuous Mode back to the desired mode.
comment:91 by , 5 years ago
This is still an issue in VirtualBox Version 6.0.16 with a Windows 10 host, Ubuntu 16.04 32-bit guest, and bridge ethernet using a Dell docking station. Switching to/from Wireless back to Ethernet worked sometimes in the past but crashes the VM now. Thanks to KooiInc above his work around seems to work for me. "My workaround: open network settings (while guest runs), select 'advanced', select one of [the other] 'Promiscuous Modes', click OK. The network interface seems to reset resulting in a guest that's online again. If necessary, reset Promiscuous Mode back to the desired mode."
comment:93 by , 4 years ago
Wow, just switched from Hyper-V to VBox 6.1.12, because of the better speeds of vboxsf vs samba shares, for data shares from the host.
Yet now i just "stumbled" on this bug, seriously 5 years and no fix?
PS: This works without any issues in Hyper-V btw.
comment:94 by , 4 years ago
Using VBox 6.1.16 on Windows 10 host (version 20H2) with Ubuntu 20.04 guest. And this problem is still there.
Given how frustrating & persistant this is, PLEASE, fix it. Bridged connection is quite fundamental for techies and this causes so much pain. I don't really want to generate more carbon by not sleeping my machines. But also, its a REAL pain to have to reboot your VM.
comment:95 by , 4 years ago
Same here. Still an issue un Vbox 6.x. This makes the software unusable for a 24/7 machine.
comment:96 by , 4 years ago
Any update for this issue?
My last env was Win 10 Pro + vbox 5.2 on asus laptop, it was fine how many times i made it to sleep/hibernate, host only connection worked.
in my new env it's Win 10 home + vbox 6.1 on lenovo laptop, every time the state is changing(sleep/hibernate) host only connection does not work, i have to restart every time.
comment:97 by , 4 years ago
I have a probably related problem: Ubuntu 20.4.4 host, Win8.1 64 Pro guest. After starting the VM, it needs quite some time until all drives attached to the VM are connected (Windows shows network drives not available). Drives are SSD's, HD's with ext4 and ntfs, sbm network NAS with four samba shares. This is resolved after about 10 secs, all drives are accessible. Only then, the second monitor can be toggled to the correct resolution by minimising and maximising the VBox guest window on the second monitor.
The virtual network card (NAT) is up and running. When starting a software with substantial IP traffic (i.e. access to a network scanner from Adobe Acrobat 11, or to an Access data base file on the NAS), the network interface in Windows after a few seconds displays a warning sign as being restricted, IP traffic is stopped and the application hangs. This happens in the midst of ongoing heavy IP traffic from that application. Workaround: Open network settings in the VB, change from NAS to not connected, close. Disable Win interface card. Reset network setting in VB to NAS again, and enable Win interface card. After some seconds, the network link from the host is up again and running, and remains stable for the rest of the session. Problem is that often the Win program generating the IP traffic is hanging and completely blocking the VM (even AltCtrlDel/Taskmanager via VBox menue does not work), so restart of the guest is unavoidable. This blocking network happens quite reliable at the beginning of every new VM session (95% of all new sessions). Problem appeared before two weeks (probably related to update to 20.04.1 or Windows KB's - only security updates for the Win virus scanner and the Office package are installed, no monthly rollups since they more than once shredded the installed Windows version). In a VB this is no big deal with vdi backups (including the backup points!), but on real hardware, it always had been a pain in the ass (permanent cycles of installing and restoring pre-installation status completely blocking the pc). Windows sucks.
comment:98 by , 4 years ago
I have the same problem with VirtualBox 6.1 under Ubuntu 20.04 host:
After waking up a guest from sleep (tried both MS-DOS and Slackware Linux 3.0), the network does not work any longer.
I'm using "bridged" networking.
The behavior of MS-DOS may be helpful to find the problem:
MS-DOS does not support networking natively. I also don't have a network driver installed. I use some MS-DOS application program that accesses the network card hardware directly not using the OS or drivers.
Every time the application is started, the network card is searched (PCI registers), it is completely reset and re-initialized.
The program can be started and works correctly as many times as I like if I don't put the guest machine to sleep.
When I put the guest machine to sleep and wake it up, networking does not work any more.
It does NOT matter if I used networking before I put the VM to sleep: Even if the network card has not been accessed at all before putting the VM to sleep, it won't work after waking up the VM.
After a reset of the VM, networking works again.
comment:99 by , 3 years ago
Hello here is my automated solution for this problem (windows 10) :
installation file:
copy Patch_Virtual_Box_Promiscuite.bat destination_folder schtasks /create /IT /xml "Patch_VirtualBox_Promiscuite.xml" /tn "task_name"
in Patch_Virtual_Box_Promiscuite.bat:
@ECHO OFF ECHO Windows has detected the disconnection of a network card. ECHO this patch corrects the failure on VirtualBox virtual machines that lose connection to the LAN... REM Patch Palliative REM When the Host machine loses its connection to the LAN, the VirtualBox LAN access crashes and does not come back up by itself REM Change the promiscuity mode of the MV network interface to Allow-All then back to Deny REM allows to bypass the problem REM This script allows to switch the promiscuity mode on the network cards n°1 of all the MVs turned on REM to allow the use of !Variable! instead of %Variable%. setlocal enabledelayedexpansion REM We get the raw name of the opened vm FOR /F "tokens=* USEBACKQ" %%F IN (`"C:\Program Files\Oracle\VirtualBox\vboxmanage" list runningvms`) DO ( REM echo %%F SET Vrun=%%F ECHO Trying MV patch : !Vrun! REM ECHO !Vrun:~-37,36! REM nicpromisc1 => MV network card 1; nicpromisc2 the next one... "C:\Program Files\Oracle\VirtualBox\vboxmanage" controlvm !Vrun:~-37,36! nicpromisc1 allow-all REM We wait 2 seconds choice /T 2 /C y /D y > NUL "C:\Program Files\Oracle\VirtualBox\vboxmanage" controlvm !Vrun:~-37,36! nicpromisc1 deny ) pause
In the Patch_VirtualBox_Promiscuite.xml:
<?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Date>2021-05-21T09:45:29.0969263</Date> <Author>E035-P12\btssn</Author> <URI>\Patch_VirtualBox_Promiscuite</URI> </RegistrationInfo> <Triggers> <EventTrigger> <Enabled>true</Enabled> <Subscription><QueryList><Query Id="0" Path="Microsoft-Windows-NetworkProfile/Operational"><Select Path="Microsoft-Windows-NetworkProfile/Operational">*[System[Provider[@Name='Microsoft-Windows-NetworkProfile'] and EventID=10000]]</Select></Query></QueryList></Subscription> </EventTrigger> </Triggers> <Principals> <Principal id="Author"> <UserId>S-1-5-21-3053171842-2777670567-2066293837-1001</UserId> <LogonType>InteractiveToken</LogonType> <RunLevel>LeastPrivilege</RunLevel> </Principal> </Principals> <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>PT72H</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions Context="Author"> <Exec> <Command>C:\PATH\Patch_Virtual_Box_Promiscuite.bat</Command> </Exec> </Actions> </Task>
Matthieu BTS-SN student in New Caledonia.
comment:100 by , 3 years ago
Thanks to LinuxGuy's solution for VMBox 5.1 I could solve my problem with
Virtual Box 6.1 (26) running 2 guests:
Host: Windows 10 64bit running on Dell XPS 15 with most recent drivers for network.
Guest 1: Windows 7, bridged network (yes, this need an update...)
Guest 2: Centos Linux, bridged network
Until that time I needed to suspend both guests, reboot the host and start the guests again to "repair" the network.
The host runs more or less 24/7 (if it's not rebooted ;) ) and the problem occours nearly every day after the FritzBox DSL modem forces a reconnect to the ISP (I have no clue whether and how this may affect the host's internal VM network - but the DSL reconnects at 4am and VM network dies some minutes later)
First I thought that the solution (and also the other workarounds like changing guest's network mode) does not work.
By accident I found out, that resetting the NIC when the Windows guest is ACTIVE and Linux guest is SUSPENDED works. So my current daily workaround for VirtualBox 6.1 is:
(not sure if the timeout commands are necessary)
repair-vm-net.bat:
REM suspend guest 2 (Linux VM) "c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "CentOS Server" savestate timeout 2 > NUL REM reset network of guest 1 (Windows VM) "c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "Windows 7" nic1 null timeout 2 > NUL "c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "Windows 7" nic1 bridged "Intel(R) Dual Band Wireless-AC 7260" timeout 2 > NUL REM start guest 2 (Linux VM) again "c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm "CentOS Server"
This is run as a Windows scheduled task during the night.
comment:101 by , 20 months ago
This bug continues to exist as described on windows 8.1 host , Centos 7 guest, VirtualBox 7.0 . Sometimes changing network settings while the vm is running will fix it but not always. Sometimes, especially if the host was sleeping for a short period the network continues to work fine after resume. Sometimes the only solution is to reboot host. I also can confirm workaround from comment 100 works as described with a second Windows XP guest. (reset windows network while Centos is suspended).
comment:102 by , 17 months ago
Still an issue in Version 7.0.4 r154605 (Qt5.15.2)
Host: Windows 10 22H2
Guest: Debian GNU/Linux 11 (bullseye)
DougC's solution still works so thanks for that Doug.
This bug has been driving me crazy for a while now!
comment:103 by , 14 months ago
The problem is still exists in Version 7.0.10r158379(Qt5.15.2)
Host: Windows 11 22H2
Guest: Ubuntu 22.04.3 (x64)
DougC's solution is perfectly working.
comment:104 by , 13 months ago
DougC's solution did not work for me, but this modified version does. (one for a Windows VM, and a Linux VM)
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "linuxVM" nic1 nat "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "windowsVM" nic1 nat timeout /t 10 "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "linuxVM" nic1 bridged "Intel(R) Ethernet Connection (3) I219-LM" "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "windowsVM" nic1 bridged "Intel(R) Ethernet Connection (3) I219-LM"
Promiscuous mode did not reset the adapter inside the VM. NAT to Bridge does.
Using VBox 7.0.8r156879 on W10
Event for my network loss is... Log: System Source: e1dexpress Event Id: 27
Event log says... Intel(R) Ethernet Connection (3) I219-LM
Network link is disconnected.
comment:105 by , 12 months ago
Still an issue in Version 7.0.10 r158379 (Qt5.15.2)
Host: Windows 10 22H2
Guest: Debian GNU/Linux 12 (bullseye)
DougC's solution still works so thanks for that Doug.
comment:106 by , 6 months ago
comment:108 by , 7 weeks ago
For those still struggling I've created a new thread (with a fix based on DougC)
Please attach a VBox.log file for such a VM session (when your host suspended + resumed).