Skip to content

Instantly share code, notes, and snippets.

@dagrons
Last active September 21, 2021 17:05
Show Gist options
  • Save dagrons/589b371a05a7b6a14a13457efdbc7e37 to your computer and use it in GitHub Desktop.
Save dagrons/589b371a05a7b6a14a13457efdbc7e37 to your computer and use it in GitHub Desktop.
vboxmanage cheatsheet

vboxmanage cheatsheet

list vms

vboxmanage list vms 
vboxmanage list runningvms

rename vms

vboxmanage modifyvm $ORIGNAL_NAME --name $NEW_NAME

delete vms

vboxmanage unregistervm $MACHINENAME --delete

clone vms

vboxmanage clonevm --mode all --basefolder ~/vms/ --name $CLONENAME --register $MACHINENAME 
# copy $MACHINENAME to ~/vms with name $CLONENAME
# basefolder: must be abs path
# --mode machine: copy only the current state
# --mode machineandchildren --snapshot=<snapshot-name>: clone snapshots specified and child snapshot

# the uuid of .vdi, mac address will be modified, so the ip addr will change accordingly

register an exsiting vms

# vboxmanage internalcommands sethduuid $VDIPATH # change the vdi uuid # no need if move, needed only when copy
vboxmanage registervm $VBOXPATH # must be absolute path of the vbox file

poweroff vms

vboxmanage controlvm $MACHINENAME poweroff

discard state

vboxmanage discardstate $MACHINENAME

show vm info

vboxmanage showvminfo $MACHINENAME

vm snapshot

VBoxManage snapshot $MACHINENAME take $SNAPSHOTNAME

VBoxManage snapshot $MACHINENAME delete $SNAPSHOTNAME

VBoxManage snapshot $MACHINENAME restore $SNAPSHOTNAME

VBoxManage snapshot $MACHINENAME list [[--details] | [--machinereadable]]

VBoxManage snapshot $MACHINENAME showvminfo $SNAPSHOTNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment