1

I have Oracle VM Virtualbox on my Windows 7 development machine. I want to start a VM when Windows starts, and cleanly shut that VM down when Windows stops.

Can that be done?

I can start a headless VM by entering this on the command line;

"C:\Program Files\Oracle\VirtualBox\vboxheadless" -startvm "sw (Ubuntu 12.04)"

How can I 'cleanly' stop that VM? IE. How can I send an ACPI Shutdown to that VM?

1 Answer 1

4

Yes.

  1. Configure your guest OS to shut down on pressing the power button. For Ubuntu 12.04 with GUI it depends on your Desktop Environment installed on where to configure that in the system settings.

    For headless machines, make sure you have installed the package acpid.

  2. Execute

    VBoxManage controlvm "VM Name" acpipowerbutton
    

Reference: VBoxManage controlvm documentation


Alternatively, use SSH and PuTTY to execute the command shutdown -h now without interaction as described in "How to run a command file in PuTTY using automatic login in a command prompt?" on Superuser.com.

Not the answer you're looking for? Browse other questions tagged .