I have used the following shutdown function for a while. (If needed I could rewrite it as init.d script.) $ cat /etc/local.d/virtualbox.stop . /etc/init.d/functions.sh for user in $(/usr/sbin/groupmems -g vboxusers -l); do for uuid in $(su - $user -c '/opt/bin/VBoxManage -q list runningvms' | sed -n 's/^.*{\([^}]*\)}$/\1/p'); do name=$(su - $user -c "/opt/bin/VBoxManage showvminfo $uuid" | awk '/^Name:/{print $2}') ebegin "Save state of vm '$name' of user $user" su - $user -c "/opt/bin/VBoxManage controlvm $uuid savestate" &>/dev/null eend $? done done
Ping!
Created attachment 361800 [details] updated init.d script
Looks interesting. Once I have some time I gonna test the script...
Created attachment 362412 [details] updated init.d script (In reply to Lars Wendler (Polynomial-C) from comment #3) > Looks interesting. Once I have some time I gonna test the script... I added a start function, which will start a list of machines.
Where does ${VMS_TO_START} come from? I suppose it's set via conf.d file? If yes please provide a sample file.
(In reply to Lars Wendler (Polynomial-C) from comment #5) > Where does ${VMS_TO_START} come from? I suppose it's set via conf.d file? If > yes please provide a sample file. Yeah one needs to create a conf.d file with VMS_TO_START="user:machine-uuid user2:machine-uuid2" in it.