VirtualBox

Ticket #8126 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Regression: guest sleep triggers VM stop instead of pause

Reported by: omascia Owned by:
Priority: major Component: other
Version: VirtualBox 4.0.2 Keywords: sleep,suspended,terminated
Cc: Guest type: Windows
Host type: Mac OS X

Description

Using 4.0.0, when the guest goes to sleep, the VM enter the pause state and can be resumed without any issue. Using 4.0.2, the VM gets stopped. This has been seen on a Mac OS X host, and confirmed using Windows 7 64 bits or Windows XP 32 bits as guests.

Typical log excerpt for 4.0.0:

00:03:37.828 OHCI: USB Operational
00:03:37.828 EHCI: USB Operational
00:03:37.847 OHCI: USB Suspended
00:03:37.864 EHCI: USB Suspended
00:03:38.301 Entering S1 power state (powered-on suspend)
00:03:38.303 Changing the VM state from 'RUNNING' to 'SUSPENDING'.
00:03:38.581 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'.

Buggy behavior with 4.0.2:

01:45:09.371 OHCI: USB Operational
01:45:09.395 EHCI: USB Operational
01:45:09.414 OHCI: USB Suspended
01:45:09.415 EHCI: USB Suspended
01:45:09.777 Ignoring guest attempt to enter S1 power state (powered-on suspend)!
01:45:09.777 Entering S4 power state (suspend to disk)
01:45:09.784 Changing the VM state from 'RUNNING' to 'POWERING_OFF'.
...
01:45:09.784 Changing the VM state from 'POWERING_OFF' to 'OFF'.
01:45:09.785 Console::powerDown(): A request to power off the VM has been issued (mMachineState=Stopping, InUninit=0)
01:45:09.811 VRDP: TCP server closed.
01:45:09.815 Changing the VM state from 'OFF' to 'DESTROYING'.
...
01:45:09.926 Changing the VM state from 'DESTROYING' to 'TERMINATED'.

Attachments

VB4.0.2-guest-sleep-triggers-stop.log Download (75.3 KB) - added by omascia 3 years ago.
Complete log of typical reproduction of the bug
VBox.log.3 Download (68.3 KB) - added by V_RocKs 3 years ago.
Ubuntu 10.10 - VB 4.0.2 - Sleep triggers dirty shutdown
Sleep request from guest crash VM.log Download (73.0 KB) - added by omascia 3 years ago.
Example of wrong behaviour with PowerS1Enabled == 0

Change History

comment:1 follow-up: ↓ 2 Changed 3 years ago by jamlazevedo

I have the same issue on Ubuntu 10.10 host.

Changed 3 years ago by omascia

Complete log of typical reproduction of the bug

comment:2 in reply to: ↑ 1 Changed 3 years ago by V_RocKs

Replying to jamlazevedo:

I have the same issue on Ubuntu 10.10 host.

Same for me too on Ubuntu 10.10 host.

Changed 3 years ago by V_RocKs

Ubuntu 10.10 - VB 4.0.2 - Sleep triggers dirty shutdown

comment:3 follow-up: ↓ 4 Changed 3 years ago by frank

  • Status changed from new to closed
  • Resolution set to duplicate

Actually a duplicate of #8008, see there. I wouldn't call this a dirty shutdown. According to the log the VM state is saved to the disk. Either disable the guest power management or do like described in #8008. Will be fixed in the next maintenance release.

comment:4 in reply to: ↑ 3 Changed 3 years ago by omascia

  • Status changed from closed to reopened
  • Resolution duplicate deleted

Replying to frank:

Actually a duplicate of #8008, see there. I wouldn't call this a dirty shutdown. According to the log the VM state is saved to the disk. Either disable the guest power management or do like described in #8008. Will be fixed in the next maintenance release.

Frank, that is similar though maybe a *bit* different than #8008. (a) It is a dirty shutdown, no matter what the log say, the guest OS has unwritten disk I/O and detects the dirty shutdown on its next boot. If it was auto-saving state to disk instead of pausing the VM, that would be fine. (b) What I have seen is the guest *do* shutdown, no window of any sort left over. (c) What I have experienced is NOT related to 4.0.0. It only happens with 4.0.2. 4.0.0 is fine, apparently.

I'm very happy to read it will be fixed in the next maintenance release, but fear the small differences I have seen might mean there are two related distinct cases. I unfortunately don't have the OSs mentioned in #8008 to have a closer look.

I have re-opened only to be sure you get this info (just not sure you would get it on a closed ticket) and apologize for any inconvenience, please close again and I'll let it down. :)

comment:5 Changed 3 years ago by frank

Ok, I understand now what you mean by dirty shutdown. But that still sounds like a duplicate of #8008. Please try the lines with VBoxManage I posted there, it should solve your problem.

comment:6 Changed 3 years ago by omascia

Re-installed 4.0.2, confirmed problem again. Then did:

VBoxManage setextradata Windows7 VBoxInternal/Devices/acpi/0/Config/PowerS1Enabled 0
VBoxManage setextradata Windows7 VBoxInternal/Devices/acpi/0/Config/PowerS4Enabled 0

as instructed by #8008 and started the test VM.

Now, requesting a "Sleep" from Windows 7:

00:02:05.516 Ignoring guest attempt to enter S1 power state (powered-on suspend)!
00:02:05.516 Ignoring guest attempt to enter S4 power state (suspend to disk)!
00:02:05.516 Entering S5 power state (power down)
00:02:05.516 Changing the VM state from 'RUNNING' to 'POWERING_OFF'.

it doesn't even pretend trying to suspend to disk, it just goes to power down and pull the plug (cause the file system is dirty on reboot). I'm attaching full log. V4.0.0 transform the sleep request from Windows (S1) to a VM-Pause state. Which sounds perfect, that is the best VM equivalent of a sleeping PC. V4.0.2 says it ignores it, tries a S4 which doesn't work fine. With the fix offered by #8008, it is more straightforward, though not in the expected way. :)


Wait a minute... Bingo!! The right fix is to enable S1.

VBoxManage setextradata Windows7 VBoxInternal/Devices/acpi/0/Config/PowerS1Enabled 1
VBoxManage setextradata Windows7 VBoxInternal/Devices/acpi/0/Config/PowerS4Enabled 1

Now when the guest does auto-sleep or if I ask for a Sleep, the VM perfectly PAUSE, just as that was happening with 4.0.0. Somehow the S1 setting might have changed from 1 to 0 by installing 4.0.2 ? Or maybe if this setting is NOT defined, it defaulted to 1 with 4.0.0 and defaults to 0 with 4.0.2 ? As far as I can tell, this is different, though related, to #8008.

Success looks like this:

00:02:27.243 Entering S1 power state (powered-on suspend)
00:02:27.243 Changing the VM state from 'RUNNING' to 'SUSPENDING'.
00:02:27.255 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'.

Changed 3 years ago by omascia

Example of wrong behaviour with PowerS1Enabled == 0

comment:7 Changed 3 years ago by WhatistheMatrix?!

Same problem here on Windows 7 Ultimate 64 bit with Windows XP SP3 32-bit as guest.

comment:8 follow-up: ↓ 9 Changed 3 years ago by vr8ce

I'm not sure if this is the same problem, but it's similar enough I'm posting here first. Pleast let me know if you think it isn't. VBox4.0.2 on OS X 10.6.6 host, running Win7 Ultimate/32 guest.

I've been running VBox since 3.0, but had to re-install VBox and build a brand new VM today for reasons not pertaining to the problem at hand. I normally suspend my session with Cmd-Q, and then restart it when I need it.

With VBox 4.0.2, the Cmd-Q shows the "Saving suspended state" message (that's not it exactly, but close enough), but when it's finished and the VM window closes, the VBox window says the VM status is "Aborted". Looking in the log, the VM state lines are: Changing the VM state from 'RUNNING' to 'SUSPENDING'. … Changing the VM state from 'SUSPENDING' to 'SUSPENDED'. Changing the VM state from 'SUSPENDED' to 'SAVING'. … Changing the VM state from 'SAVING' to 'SUSPENDED'. Console::powerDown(): A request to power off the VM has been issued (mMachineState=Saving, InUninit=0) Changing the VM state from 'SUSPENDED' to 'POWERING_OFF'. … Changing the VM state from 'POWERING_OFF' to 'OFF'. Changing the VM state from 'OFF' to 'DESTROYING'. Changing the VM state from 'DESTROYING' to 'TERMINATED'.

It appears everything was fine until the "A request to power off the VM has been issued". Where did that come from?

When I restart the VM, it acts like it's the first time it's been started, i.e. it asks where the setup disk is (defaults to CD), but when I hit OK, it correctly starts from the disk. However, Windows thinks it's been aborted, so it gives the Safe/etc. menu at startup.

I have tried both solutions presented here — the enabling the PowerS1Enabled setting, and within Win7 itself turning off sleep mode, i.e. Sleep Mode says "Never". Neither made any difference, i.e. every time I Cmd-Q, the status ends up Aborted.

comment:9 in reply to: ↑ 8 ; follow-up: ↓ 10 Changed 3 years ago by omascia

Replying to vr8ce

The trigger is different, but I think the issue is related. With the sleep issue, when the VM ignores the S1 state request, it later falls on the same powerDown(). At least I can work-around the sleep by either do not let the guest request sleep or applying the settings change to not ignore it and act upon it. Here the initial trigger is different so I'm not sure there is a work-around (though I would try first to uninstall 4.0.2 and install the initial 4.0.0 build). At least, I can confirm your findings on my configuration.

comment:10 in reply to: ↑ 9 Changed 3 years ago by omascia

Replying to omascia:

... At least, I can confirm your findings on my configuration.

I must correct myself here: I don't how I confused it (got 3 hosts and 8 or 9 VM of various versions), but I apparently cannot reproduce a problem, at least and for now, with a Mac OS X hsot and a Windows 7 (64 bits) guest. Cmd-Q opens up a 3 choices popup : save state, send shutdown signal, power off (ok these are translated from the french localization of my VB host). Choosing the right one, the first one (save state), I see it saving the state, then the virtual machine closes. It is shown as suspended (in the Virtual Box Manager GUI). When starting, it restores the saved state and is fine. This is on 4.0.2 / extension pack 4.0.2 / guest additions 4.0.2 and I have run both:

VBoxManage setextradata myVMname VBoxInternal/Devices/acpi/0/Config/PowerS1Enabled 1
VBoxManage setextradata myVMname VBoxInternal/Devices/acpi/0/Config/PowerS4Enabled 1

The logged sequence is indeed the following, but that does not seem to exhibit any issue. Maybe I'm lucky.

00:08:11.646 Changing the VM state from 'RUNNING' to 'SUSPENDING'.
00:08:11.649 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'.
00:08:12.887 Changing the VM state from 'SUSPENDED' to 'SAVING'.
00:08:22.623 SSM: Footer at 0x24aa0f15 (615124757), 36 directory entries.
00:08:22.634 SSM: Successfully saved the VM state to '/Users/Olivier/VirtualBox VMs/OM-VM764/Snapshots/{63454952-32a2-448b-9726-d9cc7e0aca05}.sav'
00:08:22.634 Changing the VM state from 'SAVING' to 'SUSPENDED'.
00:08:22.634 Console::powerDown(): A request to power off the VM has been issued (mMachineState=Saving, InUninit=0)
00:08:22.634 Changing the VM state from 'SUSPENDED' to 'POWERING_OFF'.
00:08:22.635 Changing the VM state from 'POWERING_OFF' to 'OFF'.
00:08:22.636 Changing the VM state from 'OFF' to 'DESTROYING'.
00:08:22.654 Changing the VM state from 'DESTROYING' to 'TERMINATED'.

comment:11 Changed 3 years ago by Eponymous

Me too. Mac OS X 10.6.6 host and WIndows XP 32-bit guest.

comment:12 Changed 3 years ago by frank

  • Status changed from reopened to closed
  • Resolution set to fixed

The 3.2.12 behavior is back in VBox 4.0.4. Doing VBoxManage setextradata like above you can selectively enable S1 and S4.

comment:13 Changed 3 years ago by tienhn

+1 on Mac OSX host.

comment:14 follow-up: ↓ 15 Changed 3 years ago by frank

tienhn, what does your last comment mean?

comment:15 in reply to: ↑ 14 Changed 3 years ago by tienhn

Replying to frank:

tienhn, what does your last comment mean?

I meant I'm on 4.0.4 and I still get the crash when my MacBook went to sleep and wake up.

comment:16 Changed 3 years ago by frank

Then your problem is not related to this ticket (this ticket is about guest sleep, not host sleep).

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use