Skip to content

Instantly share code, notes, and snippets.

@koncybernet
Forked from samqi/virtualbox.bat
Created November 14, 2019 01:41
Show Gist options
  • Save koncybernet/6281ea2ec9c867536ac3def8c49cf915 to your computer and use it in GitHub Desktop.
Save koncybernet/6281ea2ec9c867536ac3def8c49cf915 to your computer and use it in GitHub Desktop.
virtualbox cli command
# List virtual machines
VBoxManage list vms
"MyVM" {wwwwww-4301-4a7d-8af8-fe02fed00451}
# Start VM in headless mode
VBoxManage startvm MyVM --type headless
# Power off VM
VBoxManage controlvm MyVM poweroff
#show details
VBoxManage showvminfo MyVM
###############################
#create virtualbox with a script
# http://www.digitesters.com/manage-a-virtualbox-headless-system-create-a-vm-with-a-script/
###############################
# Get IP Address from Virtualbox VMs
# https://forums.virtualbox.org/viewtopic.php?f=1&t=36592
#show ip from interface 1
VBoxManage guestproperty get "MyVM" "/VirtualBox/GuestInfo/Net/0/V4/IP"
#show ip from interface 2
VBoxManage guestproperty get "MyVM" "/VirtualBox/GuestInfo/Net/1/V4/IP"
#or
VBoxManage guestproperty enumerate MyVMb|grep IP
##################################
# for newer encrypted Virtualbox, you can use this after stasrting server headless
VBoxManage controlvm "vmname" addencpassword "vmname" "/home/user/vm-name-password"
## export ova https://www.techrepublic.com/article/how-to-import-and-export-virtualbox-appliances-from-the-command-line/
vboxmanage export vmname -o vmname.ova
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment