Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

closed as off-topic by Michael Hampton Feb 23 at 12:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Michael Hampton
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

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.

share|improve this answer

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