VMware Communities
Agendum2
Contributor
Contributor
Jump to solution

Is there support for Sleep?

I am running a home server with a VM on it, and I am trying to be power conscience.  Basically, I want the home server to be able to sleep and wake on LAN.  Additionally, the guest OS may be doing activity for which it demands the physical machine not sleep (for example, playing video is a common task which often prevents a machine from sleeping).  Finally, the guest OS may also occasionally register sleep wake timer events so that the physical machine will need to wake up from sleep.  Essentially, I want to the host machine to be able to configure the power settings, but also be mindful of the applications running within the guest.

Is such a configuration even possible?

Thanks

0 Kudos
1 Solution

Accepted Solutions
bulletprooffool
Champion
Champion
Jump to solution

ESX is aware of sleep instructions within a Windows OS.

So if you have a Windows VM and it goes into 'sleep' mode, VMware will suspend the VM.

The problem is that if your VM is 'sleeping' and VMware suspends it, the vm gets no resource, so no transactions are processed on the VM and your 'sleep wake timer' instances will not wake the VM.

I am afaraid, that there isn't (or at least I am not aware of) a method to do what you want, unless you were perhaps to reverse your design and run ESX on a Microsoft install, rather than Microsoft on an ESX install? (VMware workstation etc) this wqay Windows can be managed as normal and you still have your ESX lab doing what it needs?

One day I will virtualise myself . . .

View solution in original post

0 Kudos
5 Replies
bulletprooffool
Champion
Champion
Jump to solution

ESX is aware of sleep instructions within a Windows OS.

So if you have a Windows VM and it goes into 'sleep' mode, VMware will suspend the VM.

The problem is that if your VM is 'sleeping' and VMware suspends it, the vm gets no resource, so no transactions are processed on the VM and your 'sleep wake timer' instances will not wake the VM.

I am afaraid, that there isn't (or at least I am not aware of) a method to do what you want, unless you were perhaps to reverse your design and run ESX on a Microsoft install, rather than Microsoft on an ESX install? (VMware workstation etc) this wqay Windows can be managed as normal and you still have your ESX lab doing what it needs?

One day I will virtualise myself . . .
0 Kudos
Agendum2
Contributor
Contributor
Jump to solution

Thanks for the insightful response.  I think the right solution for my scenario would have to have the VM manager intelligent.  The VM itself would never "automatically" sleep based on time settings in the guest, but when the host sleeps it would broadcast WM_POWERBROADCAST within the guest OS.  This would give guest apps the opportunity to respond and register sleep wake events.  Those sleep wake events end up in the guest BIOS, which the VM manager is running.  The manager can then forward those sleep wake events onto the host OS.

The thing is, I can easily write an application which is smart enough to forward WM_POWERBROADCAST.  However, the VM Manager would have to have some support for the sleep wake events as they appear in the VM BIOS.

0 Kudos
Noel
Expert
Expert
Jump to solution

Agendum2 wrote:

The VM itself would never "automatically" sleep based on time settings in the guest, but when the host sleeps it would broadcast WM_POWERBROADCAST within the guest OS.  This would give guest apps the opportunity to respond and register sleep wake events.  Those sleep wake events end up in the guest BIOS, which the VM manager is running.  The manager can then forward those sleep wake events onto the host OS.

The thing is, I can easily write an application which is smart enough to forward WM_POWERBROADCAST.  However, the VM Manager would have to have some support for the sleep wake events as they appear in the VM BIOS.

If that is what you want, you can have it.  You can configure the host to use vmrun suspend <path/to/vmx> and configure VMWare Tools in the guest to run a script when there are suspend and resume events.  There are already scripts installed that get excecuted.  For example, by default, the MS-Windows guest scripts run ipconfig /release when the guest suspends, and ipconfig /renew when the guest resumes.

Agendum2
Contributor
Contributor
Jump to solution

This gets me pretty close.

vmrun is a lot of help, and it even has cool readVariable and writeVariable commands.  Is there any way to do a writeVariable on the guest VM from within itself (within the guest OS)?

Thanks!

0 Kudos
WoodyZ
Immortal
Immortal
Jump to solution

Is there any way to do a writeVariable on the guest VM from within itself (within the guest OS)?

Setx

0 Kudos