PDA

View Full Version : Virtualbox bypass "Close Virtual Machine" box


jonthysell
March 14th, 2008, 03:02 PM
I'm running VirtualBox OSE 1.5.0 on a 64bit Gutsy host with a WinXP guest.

I usually keep the virtual machine open so I can test things in IE (and use flash without a kludgey hack).

Whenever I shutdown Ubuntu, VirtualBox always throws up a "Close Virtual Machine" prompt with either "save snapshot" or "shutdown".

Does anyone know how to set a default answer so there's no prompt? That way when I hit shutdown in Ubuntu, I can leave the computer and know that it'll shutdown?

The prompt pops up under other windows, so sometimes I don't see it and I leave my computer, only to find out later that it's still running (trying to save electricity here).

Thanks.

Hero of Time
March 15th, 2008, 08:35 AM
From the User Manual, I found the following option to use in the shutdown script:
VBoxManage controlvm "VM name" savestate
That works like a charm, it saves the state of the VM for you to continue next time you start the VM. You can also use poweroff or acpipowerbutton to shutdown the VM directly.

jonthysell
March 17th, 2008, 03:32 PM
Thanks!

The command works, but where do I put it? I tried making a shutdown script and placing links in rc0.d and rc6.d, but they won't run until after gdm is finished.

Hero of Time
March 17th, 2008, 07:03 PM
You have to add it in the /etc/acpi/power.sh script I think. Check what the shutdown button calls in order for the system to shutdown, then put the command at the beginning.