Last active
December 19, 2018 11:07
-
-
Save jfollmann/9f339c3cd30e4e1a72cbc3a3b82d6a1f to your computer and use it in GitHub Desktop.
VirtualBox commands
This file contains 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 | |
set curdir=%cd% | |
set VM_NAME="Ubuntu Server" | |
c: | |
cd\ | |
cd Program Files\Oracle\VirtualBox | |
:loop | |
if "%1"=="" goto :done | |
if "%1"=="-list" goto :list | |
if "%1"=="-status" goto :status | |
if "%1"=="-start" goto :start | |
if "%1"=="-stop" goto :stop | |
if "%1"=="-ip" goto :ip | |
if "%1"=="-help" goto :help | |
shift | |
goto :loop | |
:ip | |
VBoxManage guestproperty enumerate %VM_NAME% | findstr /c:"/VirtualBox/GuestInfo/Net/0/V4/IP" | |
goto done | |
:list | |
VBoxManage list vms | |
goto done | |
:start | |
VBoxManage startvm %VM_NAME% --type headless | |
goto :done | |
:stop | |
VBoxManage controlvm %VM_NAME% poweroff | |
goto :done | |
:status | |
VBoxManage showvminfo %VM_NAME% | findstr /c:"State" | |
goto :done | |
:help | |
echo --- Help --- | |
echo use manage-vm.bat -stop | |
echo use manage-vm.bat -start | |
echo use manage-vm.bat -list | |
echo use manage-vm.bat -status | |
echo use manage-vm.bat -ip | |
:done | |
echo Done. | |
cd /d %curdir% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment