Created
March 4, 2019 16:15
-
-
Save pol8139/8ce920b46b5a1507d732efdac1f4ea48 to your computer and use it in GitHub Desktop.
WindowsホストでVirtualBoxのゲストOSがネットワーク接続できなくなったときにネットワークアダプタの接続解除・再接続をする(とうちの環境ではうまくいく)。管理者権限で一定期間ごとに実行(VMも管理者権限で起動されてる必要あり)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| ping -n 1 192.168.vm.ipaddress | find "TTL" > NUL | |
| if not ERRORLEVEL 1 goto end | |
| "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "vmname" setlinkstate1 off | |
| "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "vmname" setlinkstate1 on | |
| :end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment