You are not logged in.

#1 2012-07-08 06:26:02

workdowg
Member
Registered: 2010-12-31
Posts: 69

[SOLVED]Execute VBoxManage in rc.local.shutdown

I have been up and down the forums... I found 1 thread that states "solved" but it does not work (anymore?). Edit: https://bbs.archlinux.org/viewtopic.php?id=125866

Here is what I am trying to do...

I want to reboot my server while gracefully saving the state of my headless virtualbox vm.

Here is what I have tried:

I put

su username -c "VBoxManage controlvm xp-real savestate"

in rc.local.shutdown

This works from the command line but gets totally ignored in rc.local.shutdown.

I then put it in a execicutable bash script:

#!/bin/bash
VBoxManage controlvm xp-real savestate

in my home directory (works from command line) and tried that in rc.local.shutdown

su username -c /home/tliscum/vboxshutdown.sh

Same thing.

Anything else I can do, except remember to shut it down manually everytime I reboot?

Edit: I forgot to mention I followed the shutdown procedure here: https://wiki.archlinux.org/index.php/Vi … ss_servers
I didn't start the machine the way described because I started it from openbox autostart.

When I started it instead from rc.local as described

exec /bin/su -c 'VBoxManage startvm --type headless <UUID|NAME>' PREFERED_USER >/dev/null 2>&1

and now all of a sudden it works as expected.

If anyone can tell me why I needed to have it start from rc.local AND shutdown from rc.local.shutdown to work????

PM me, or post here. TIA

Last edited by workdowg (2012-07-09 00:57:57)

Offline

Board footer

Powered by FluxBB