Skip to content

Instantly share code, notes, and snippets.

@pydevops
Forked from githubfoam/VirtualBox Cheat Sheet
Created January 27, 2019 23:59
Show Gist options
  • Save pydevops/4168cfbb2afbd97ded284a7b1797b95d to your computer and use it in GitHub Desktop.
Save pydevops/4168cfbb2afbd97ded284a7b1797b95d to your computer and use it in GitHub Desktop.
VirtualBox Cheat Sheet
"VBoxManage" command is different from "sudo VBoxManage" command
VBoxManage --version
sudo apt-get dist-upgrade -y -> Debian-based linux makes sure VirtualBox Guest Additions is installed
VBoxManage list runningvms -> Find running vm to box
vagrant package --base xxxxx_1522057296984_52705 --output ubuntu1604.box --> Package running vm as vagrant box
# Download an ISO image of VirtualBox Guest Additions
wget http://download.virtualbox.org/virtualbox/5.2.12/VBoxGuestAdditions_5.2.12.iso
sudo mount -o loop VBoxGuestAdditions_5.2.12.iso /tmp/vbox
lsmod | grep vboxguest -> verify vbox installation
modinfo vboxguest
#troubleshooting
VBoxManage list vms | awk '{print $2;}'
VBoxManage list runningvms | awk '{print $2;}'
VBoxManage showvminfo vmid
VBoxManage unregistervm --delete vmid
VBoxManage modifyvm vmid --name vmname
VBoxManage: error: Cannot unregister the machine 'xx' while it is locked
sudo VBoxManage controlvm 'xx' poweroff
VBoxManage: error: The machine 'xx' is already locked for a session (or being unlocked)
sudo VBoxManage startvm 'xx' --type emergencystop
rm -fr ~/"VirtualBox VMs/NAMEOFVM" -> delete it manually
ps -ef | grep -i virtualbox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment