Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am having problem hibernating and suspending my Dell Laptop while virtualbox is running( XP Guest). I have tried default kernel method, uswsusp and tuxonice and none of them works. But if I close virtualbox, then hibernation and suspend works fine. Following are system specs. OS : Ubuntu 10.10 64bit (completey updated) Ram : 4GB Swap : 8 GB Root : 500 GB (of which, about 79% is free)

My laptop model is Dell Inspiron N5010. It has ATI HD 5000 series graphic chipset and I am used proprietary Drivers for it, installed via jockey.

Thanks.

share|improve this question
1  
I've not played around with this much, but I'm not particularly surprised that it doesn't work. A vitrualbox is not quite an application; I can't imagine the semantics that would be required. Do you hibernate the VMs and then the host? How would you signal a VM to hibernate? How could you confirm that it had? What should it do upon wake? –  msw Jan 23 '11 at 5:52
    
oddly enough, there was the answer in your comment " Do you hibernate the VMs and then the host? ", After reading this I found that there is a feature in virtualbox with which once save the current state of VMs. Its pretty much like hibernating, except that I am not hibernating the Guest OS explicitly. Morever the process is very fast and after that I can hibernate the Host OS normally. So, thanks for the comment. P.S: Please excuse my bad english, I am still learning. –  Harbhag Jan 23 '11 at 8:04
    
if you have an answer, please place it in the Answer section not as comment. –  Marco Ceppi May 4 '11 at 14:18
add comment

2 Answers

up vote 1 down vote accepted

As per the comments to the original question:

I found that there is a feature in virtualbox with which once save the current state of VMs. Its pretty much like hibernating, except that I am not hibernating the Guest OS explicitly. Morever the process is very fast and after that I can hibernate the Host OS normally.

This feature is known as Save Machine State.

share|improve this answer
    
Can you please identify the feature by name? I don't know what the feature is called. –  ptrcao Oct 17 '11 at 12:06
    
@ptrcao it's known as pause (i think). Not near my VBox machine, otherwise I'd double check –  jrg Oct 17 '11 at 12:25
    
I have never heard of this "pause" before... I use the "save machine state" option on closing the VM guest window - I don't know if this is the same as what you are talking about? –  ptrcao Oct 17 '11 at 12:46
    
@ptrcao yeah, that'd be. It. thanks. –  jrg Oct 17 '11 at 12:51
add comment

I had the same problem, "pause" the virtual-guest-XP (HostKey-P) did work some times but often NOT. Putting the VM-Guest-XP in "saved-state" let the system hibernate again with no problems.
I wrote a small script, put it in /etc/pm/sleep.d/05_virtualbox (don't forget chmod a+x 05_virtualbox) and power-management will do the save-machine-state and start procedure on VMs automatically...

#!/bin/sh

# File: /etc/pm/sleep.d/05_virtualbox  #(at least in ubuntu/fedora)
# 
# This hack saves-state all VirtualBox-VM's off user $VBUSER on hibernate/suspend,
#   saves the list of this VMs in $VM_LIST_FILE, and on thaw/resume it starts all
#   VMs in that list again, and removes $VM_LIST_FILE.
# BUGS: don't use the same NAME for different VMs, or rewrite the script to use UUIDs
#
# a REAL hack, tried to comment as much as possible, but the chosen syntax is obfuscated, 
#   sorry...also sorry for the bad english...
#
# Writer (guilty person): Lutz Langenbach
# Copyleft: do what you want with the Code
# Help: VBoxManage 2>&1 |less or http://www.virtualbox.org/manual/ch08.html

VM_LIST_FILE=/var/tmp/vms-in-saved-state-list
VBUSER=Put_YOUR_username_here

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "${1}" in
  suspend|hibernate)
    # print list of running VM's output: "vm-name" {vm-uuid}\n
    # extract only the name of VM's and send 
    echo -n "Send savestate to VM's:"
    sudo  -u $VBUSER  VBoxManage list runningvms \
    |perl -ne 'chomp;s/^"([^"]*)".*/\1/; print $_; system("sudo -u '"$VBUSER"' VBoxManage controlvm \"$_\" savestate && echo \"$_\">>'"$VM_LIST_FILE"'");'
    echo ..done
    ;;
  resume|thaw)
    # get each line in $VM_LIST_FILE, use it as VM-Name and send start to it 
    echo -n "Send resume to VM's"
    cat $VM_LIST_FILE | perl -ne 'chomp;s/^"([^"]*)".*/\1/; system("sudo -u '"$VBUSER"' VBoxManage startvm \"$_\"");'
    rm -f $VM_LIST_FILE
    echo .
    ;;
  *)
    echo "Don't know what to do, 1st Arg was:${1}; Must be suspend|hibernate|resume|thaw"
    ;;
esac
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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