How to Start, Shutdown, or Reboot a VM from the Command Line in Oracle VirtualBox

preview_player
Показать описание
If you need to start, shutdown or reboot an Oracle VirtualBox virtual machine from the command line, it's very easy to do and can even be used to start or stop a VM using a script or batch file etc. for when your host computer starts for example. You can also use a command to start your virtual machine headless, meaning it will start the VM but not VirtualBox Manager. You will need to have the virtual machine Guest Additions installed to use these commands.

To run the command you will need to open a command prompt and navigate to.
C:\Program Files\Oracle\VirtualBox

These are the commands to start, stop and restart your VM but you will need to change the VM name to match your environment. Also be sure not to copy the description after the command.

VBoxManage list vms

VBoxManage list runningvms

To start a VM normally
VBoxManage startvm "VM Name or ID"

To start a VM in the background
VBoxManage startvm "VM Name or ID" --type headless

Properly shutdown a VM
VBoxManage controlvm "VM Name or ID" acpipowerbutton

Properly restarts a VM
VBoxManage controlvm "VM Name or ID" reboot

Immediately kills the power as if you pulled the power plug
VBoxManage controlvm "VM Name or ID" poweroff

Resets the VM without properly shutting it down
VBoxManage controlvm "VM Name or ID" reset

Pauses a VM without changing its state
VBoxManage controlvm "VM Name or ID" pause

Resumes a paused VM
VBoxManage controlvm "VM Name or ID" resume

Saves the current state of the VM to disk and then stops the VM
VBoxManage controlvm "VM Name or ID" savestate

Check out our book (VirtualBox Made Easy) that is designed to take your virtualization skills to the next level!

#virtualbox
Рекомендации по теме
Комментарии
Автор

You could just add that directory to your path and then you don't have navigate to that directory every time. Also, it is important to note this is a Windows issue. On macOS and Linux, you don't have to move to the install directory to run vboxmanage

Practical-IT
Автор

Can vboxmanage create a VM or import an existing VM?

cbbcbb