Skip to content

VirtualBox

Information

  • List available virtual machines:

      vboxmanage list vms
  • List running virtual machines:

      vboxmanage list runningvms
  • Show information about a virtual machine:

      vboxmanage showvminfo <vmname|uuid>

Control VMs

  • Start virtual machine:

      vboxmanage startvm <vmname|uuid>
  • Start virtual machine in headless mode:

      vboxmanage startvm <vmname|uuid> --type headless

    or:

      vboxheadless --startvm <vmname|uuid>
  • Start virtual machine in headless mode with VRDP enabled:

      vboxmanage controlvm <vmname|uuid> --vrde on

    or:

      vboxheadless --startvm <vmname|uuid> --vrde on
  • Connect to virtual machine’s VRDP:

      rdesktop-vrdp localhost
  • Gracefully shutdown virtual machine:

      vboxmanage controlvm <vmname|uuid> acpipowerbutton
  • Power-off virtual machine:

      vboxmanage controlvm <vmname|uuid> poweroff
  • Reset virtual machine:

      vboxmanage controlvm <vmname|uuid> reset
  • Pause virtual machine:

      vboxmanage controlvm <vmname|uuid> pause
  • Resume paused virtual machine:

      vboxmanage controlvm <vmname|uuid> resume
  • Save and stop virtual machine:

      vboxmanage controlvm <vmname|uuid> savestate
  • Discard saved state of virtual machine:

      vboxmanage discardstate <vmname|uuid>

Configure VMs

  • Limit RAM to 256MB:

      vboxmanage modifyvm <vmname|uuid> --memory 256
  • Set number of virtual CPUs:

      vboxmanage modifyvm <vmname|uuid> --cpus 2
  • Cap CPU usage to 50%:

      vboxmanage modifyvm <vmname|uuid> --cpuexecutioncap 50
  • Offset BIOS time one year in the future:

      vboxmanage modifyvm <vmname|uuid> --biossystemtimeoffset +31536000000

Snapshots

  • Create snapshot of virtual machine:

      vboxmanage snapshot <vmname|uuid> take <snapname>
  • List snapshots for virtual machine:

      vboxmanage snapshot <vmname|uuid> list
  • Restore virtual machine to the current snapshot:

      vboxmanage snapshot <vmname|uuid> restorecurrent
  • Restore virtual machine to a snapshot:

      vboxmanage snapshot <vmname|uuid> restore <snapname>
  • Delete specific snapshot:

      vboxmanage snapshot <vmname|uuid> delete <snapname>