Page 1 of 1

How to teach VirtualBox to prevent Mac to sleep?

Posted: 3. Mar 2013, 10:27
by pguyot
Hello,

I am running Windows Media Player within a Windows XP VM to watch DRM-protected videos. Host is a Mac running Mountain Lion. Windows does not go to sleep as WMP naturally prevents it. However, after a while, the Mac's screen goes dim and eventually the Mac would go to sleep.

Is there a way to:
- tell VirtualBox to pass the sleep prevention from the guest to the host?
- tell VirtualBox to prevent the host to sleep for this particular VM?
- tell VirtualBox to prevent the host to sleep when a VM is running?

So far, the only solution I found (beyond moving the mouse during the video) is to change the sleep settings on the Mac. But this is very inconvenient as I want them back whenever I do something else on this computer. After searching this forum and elsewhere on the web, I did this:

Code: Select all

VBoxManage setextradata WindowsXP VBoxInternal/Devices/acpi/0/Config/PowerS1Enabled 1
But I believe this is unrelated or the other way around.

Re: How to teach VirtualBox to prevent Mac to sleep?

Posted: 3. Mar 2013, 13:06
by ptram
I don't know if VB can prevent the Mac (starting from OS X 10.8) from sleeping, but you can create a Terminal script named [anyname].command, containing the "caffeinate" command. You can launch it when you want the Mac to stay always on.

Paolo