VirtualBox using the CLI

You can use VBoxManage to control Oracle VM VirtualBox from the command line of the host operating system. When using command line, the first thing you may want to do is to list the existing VMs:

1. Display all the VMs.

$ VBoxManage list vms
"samdb" {44c17727-a20a-4cb9-957a-c3569d0ee63f}

2. Run the samdb VM as a headless instance.

$ VBoxManage startvm "samdb" --type headless

3. View the VMs that are running at the moment.

$ VBoxManage list runningvms 

4. Shutdown the VM.

$ VBoxManage controlvm "samdb" poweroff --type headless 

5. Revert back to the snapshot.

$ VBoxManage snapshot samdb restore snap1-before-upgrade

Add a comment