1

Situation: I am on Debian 8.5. I installed VirtualBox 5.0.22 and its Extension Pack. I further encrypted the VM via VirtualBox: VM settings -> General -> Encryption -> Enable Encryption.

Question: How to start and stop the encrypted VirtualBox VM from terminal in headless mode?

0

To start the VM in headless mode with password, you need to create a file containing the password, suppose:

/home/user/vmname-password

Then you need to execute the two following commands:

VBoxManage startvm "vmname" --type headless

VBoxManage controlvm "vmname" addencpassword "vmname" "/home/user/vm-name-password"

This is just an example. In real world consider wisely if you wish to expose your VM disk password in a permanently stored file. This Q&A is not about that.

To stop the VM:

VBoxManage controlvm "vmname" acpipowerbutton
| improve this answer | |
0

To start the VM in headless mode with password to be requested from console just replace "/home/user/vm-name-password" with "-"

VBoxManage controlvm "vmname" addencpassword "vmname" -

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.