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.





More posts in this category


3 Comments on “HOWTO: Remote Wake-up of Ubuntu Linux Machine”

You can track this conversation through its atom feed.

  1. 3arabsoft says:

    that’s sounds interesting

  2. Karthikeyan says:

    Cool article

  3. arlona mcconico says:

    Cool, thankyou very much,I must comment that your site is fantastic! :-P

Leave a Reply

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>

RSSSubscribe to Comments on this post



Educate Elevate!

Well said!

If you have to gain all these other "soft skills" or business skills in order to just be a regular software engineer, then why keep working for someone else? One of the main reasons for being an employee is because it's (supposed to be) both easier and safer than striking out on your own. Instead of long hours and having to wear many hats, you can just concentrate on your own skill, and leave the business stuff to the people who specialize in that. Anyone familiar with the idea of specialized labor should understand this. The downside is (supposed to be) your pay is lower than it could potentially be by owning and operating your own business. If today's corporations want their regular rank-and-file employees to wear many hats, be multi-talented, and have a lot of business skills, then they're simply not doing their own jobs correctly. - Grishnakh (Slashdot user)

Archives

Google Page Rank

Creative Commons License
Black God by KaruppuSwamy Thangaraj is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Based on a work at www.karuppuswamy.com.
Permissions beyond the scope of this license may be available here