Wednesday, June 1, 2011

Project: Sleep and Remote Wakeup

Problem:  I have a main computer that I utilize as a server for media both at home and away.  There are times when I really don't need it that often and it represents a waste of electric power.
Just having it sleep presents two issues: 1. being able to wake it remotely when I want to access it  and 2. when it does sleep I need to ensure that if virtual machines are running that they are apropriately shut down / put to sleep and woken up as well
Solutions: test how virtualbox machines are handled when the computer shuts down to sleep mode.  I don't think hibernation is necessary.  Sleep mode will present enough of an energy savings.
Use a shutdown utility that runs a script prior to entereing sleep mode and write a script that will shutdown / save the machine state of the virtualbox machines as well as one that will bring them online when the machine is activated.
lifehacker article wake on lan: http://lifehacker.com/348197/access-your-computer-anytime-and-save-energy-with-wake+on+lan
lifehacker article energy:
energy: http://michaelbluejay.com/electricity/computers.html


Edit 8/8/2011:  Using the wake-on-lan feature with ddwrt made the waking up from sleep issue very easy to fix.  Currently I just access the web interface from any device with a browser and wake the server up via that route, although soon I plan to put a script in place so that all I have to do is access the router via ssh and wake it up that way.

To see if the server is active I access the router via ssh and use the 'arp' command, which lists any currently active local ip's.

It only takes about 2 minutes for the server to wake up from sleep mode and be available for access to music or ftp.

The virtualbox server (ubuntu linux) wakes up and sleeps with the primary os with no issues.