One thing you could try would be to make a script that gets run on hibernation that saves/restores your VMs for hibernation. I tried this (without the pm-utils specific stuff) in a "sudo -i" shell and it worked as expected (Using VirtualBox 1.6.0):
Code:
#!/bin/bash
# Replace this with the user that runs the VMs
VBUSER=your_username
. /usr/lib/pm-utils/functions
case "$1" in
hibernate)
rm -f /home/${VBUSER}/.savedvms
for vm in `su $VBUSER -c "VBoxManage list runningvms | tail -n+4"`; do
echo $vm >> /home/${VBUSER}/.savedvms
su $VBUSER -c "VBoxManage controlvm $vm savestate"
done
;;
thaw)
for vm in `cat /home/${VBUSER}/.savedvms` ; do
DISPLAY=:0.0 su $VBUSER -c "VBoxManage startvm $vm"
done
rm -f /home/${VBUSER}/.savedvms
;;
esac
exit
Change your_username to your username, name it 01savevms and install with:
Code:
sudo install 01savevms /etc/pm/sleep.d
That may not be perfect, but, it's the general idea. Hope that helps.
Bookmarks