HOWTO: Remote Wake-up of Ubuntu Linux Machine

linuxRecently I faced a problem of transferring files between my Laptop and Media Center Machine at home. My setup is like this: I use to store all my media files (Photos, Videos, Audio collections of family) in Media Center Machine which is powered by Ubuntu 9.10. My laptop which also runs on Ubuntu 9.10 is meant for development and study purpose only. I use to transfer big ISO files and media files (downloaded from camera to laptop) to Media Center Machine. Before doing this I have to power on Media Center Machine by opening the lock in AV Furniture and switch on the Machine which is at Hall. I am such a lazy person to think of avoiding this simple manual work, so thought of power-on the Media machine remotely from another room.

I use Ethernet LAN Wake-up feature to do this. Here is how I did it.

1. Ensure that BIOS in target machine has a feature of “Wake-on LAN” or “Wake-on PCI devices”. Enable this feature.

2. Boot Ubuntu on target machine. Add the following line of command in /etc/rc.local file just before “exit 0″ line.

ethtool -s eth0 wol g

In the above code, my ethernet interface is “eth0″. Consider updating it with your ethernet interface.

3. Note down the MAC Address of your ethernet interface using ifconfig command as shown below

$ ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:1e:ba:b2:ab:0e

UP BROADCAST MULTICAST  MTU:1500  Metric:1

RX packets:0 errors:0 dropped:0 overruns:0 frame:0

TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Interrupt:16

4. Reboot this machine. Now your target machine is ready. You either Hibernate or Suspend this machine now. But ensure that this machine is connected to power.

5. In laptop (which is my source machine, initiates wake-up), install wakeonlan application as shown below

$ sudo apt-get install wakeonlan

6. Run the wakeonlan utility as shown below with your MAC Address noted down

$ wakeonlan 00:1e:ba:b2:ab:0e

7. The above step should wake-up your target machine.

8. If necessary you can create a link to the above command as shown below

Screenshot-Launcher Properties

Enjoy the remote wake-up!

Update:

To shutdown the machine from remote, it is better to hibernate, so that using the above technique, wake-up will be easy. To hibernate remotely, you can install the “powermanagement-interface” package and issue “sudo pmi action hibernate” command using a ssh terminal to remote machine.

sudo apt-get install wakeonlan
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Popularity: 25%

Related posts:
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

3 Responses to “HOWTO: Remote Wake-up of Ubuntu Linux Machine”

  • 3arabsoft says:

    that’s sounds interesting

  • Karthikeyan says:

    Cool article

  • Shawn Smith says:

    I’m new to your site and would say its an informative and exciting one. I went through your blog and enjoyed reading it.
    I’ll keep in touch and will look forward to reading your blogs in the future to know more about it.

  • Leave a Reply:

    Name (required):
    Mail (will not be published) (required):
    Website:
    Comment (required):
    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>