VMware Cloud Community
BTim
Contributor
Contributor

Suspending Linux VMs from within the VM

Hi,

I've got a Linux VM (Ubuntu 9.10) with VMware Tools installed that I'd like to be able to suspend from within the VM itself. The reason is that I'm looking at VDI solutions and I'd like to be able to put VMs in to a suspended state when not in use, although the VDI stuff isn't relevant to this question.

Within the VM the S3 state (suspend to RAM) doesn't seem to be supported:

$ cat /proc/acpi/sleep
S0 S1 S4 S5

So when I tell the VM to suspend nothing happens. Hibernating works fine.

The same is true on FreeBSD. But, on Windows XP it works fine and the VM goes to sleep.

My question is: should this work? do I need to modify my kernel? or my VM configuration?

Thanks,

Tim.

0 Kudos
4 Replies
mcowger
Immortal
Immortal

The XP VM isn't doing StR (S3) - its doing an ACPI hibernate (S4).

--Matt

VCP, vExpert, Unix Geek

--Matt VCDX #52 blog.cowger.us
0 Kudos
BTim
Contributor
Contributor

Hi Matt,

Thanks for your reply.

I'll admit to not being an expert on the specifics of suspend/hibernate and S3/S4. But, the XP VM when booting up just comes straight to the desktop (well, unlock screen). In my experience on real hardware when coming out of hibernation it boots up and displays a message about returning from hibernation or something. Is that different to S4?

There's also an option under the Power Management settings for a VM that says "How should the virtual machine respond when the guest OS is placed on standby?" I had assumed that referred to the guest OS going in to an S3 state, and had intended to use that option to suspend the VM.

Thanks again,

Tim.

0 Kudos
mcowger
Immortal
Immortal

I suspect that process may be happening so fast you cant tell.....

--Matt

VCP, vExpert, Unix Geek

--Matt VCDX #52 blog.cowger.us
0 Kudos
BTim
Contributor
Contributor

I'm not sure what's going on then. Hibernation wasn't enabled on XP. If I switch it on and hibernate the OS I get a different process; it spends time "Hibernating...", then the VM is powered off. When I do standby instead it says "Preparing to stand by..." then puts the VM in to a suspended state (because I've selected that option in the VM configuration).

So it seems that the behaviour of hibernate and standby are different on XP. Although they look different, they take about the same length of time both entering the state and resuming. But as always with Windows, it's pretty hard to know what it's doing under the hood Smiley Happy

I suppose the bottom line is: does VMware support S3 for guests? and if not, what's the option in the Power Management settings for the VM referring to?

Thanks,

Tim.

0 Kudos