Skip to content

Instantly share code, notes, and snippets.

@filimonov
Last active August 9, 2020 18:08
Show Gist options
  • Save filimonov/58779d1495e81568fb36a52463d2bdb1 to your computer and use it in GitHub Desktop.
Save filimonov/58779d1495e81568fb36a52463d2bdb1 to your computer and use it in GitHub Desktop.
"Replug" the cable of running VirtualBox VM (network freeze in guest VM after host windows hybernate - awake)
@echo off
set VboxManageEXE="%VBOX_MSI_INSTALL_PATH%\VBoxManage.exe"
set ListRunningVMS=%VboxManageEXE% list runningvms
for /f tokens^=2^,4^ delims^=^" %%p in ('%ListRunningVMS%') do (
echo "%%p"
%VBoxManageEXE% controlvm %%p setlinkstate1 off
%VBoxManageEXE% controlvm %%p setlinkstate1 on
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment