Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a headless HP Proliant Microserver with ubuntu installed. This machine has samba shares on it serving media and I usually rdp or ssh into it. Now my issue is I want the machine to go into sleep mode(so the state is saved from ram to the harddrive) and it will seem like it is turned off after an hour of idling.

If there is any attempt to access the samba share through LAN I would like it to wake up. Now my motherboard supports this function, can anyone point me in the right direction for achieving this easily?


share|improve this question

4 Answers 4

The best instruction I have found on the web was the XBMC wiki for WOL. In short (more info in the link):

  1. You need to enable WOL on your motherboard;
  2. Install ethtool: sudo apt-get install ethtool;
  3. Set Wake-on-LAN options: sudo ethtool -s eth0 wol g;
  4. Get it enabled at system start-up with an init script. There's an init script in the wiki link.

Untested; info from the wiki link

share|improve this answer

Further than sleep mode, what you're looking for is hibernate, as you want to save your state in your harddisk and shutdown completely the server.

So, as many have pointed, the answe is WOL (Wake On Lan). There are a lot of tutorials about it, but mainly you need to set up the following:

  • Your router has to bypass the magic packet (as the WOL packet is called) to your server, so you need to do the port forwarding. It's usually located in the LAN section. The default ports are 7 and 9.
  • Your motherboard needs to be listening on LAN port when is powered off. The most of modern MBs provide this feature, but is disabled by default. Check it! In my case, it is called "Power on by Ring on Lan".

Server doesn't need more setting than the suitable power management configuration to get the system down after an hour of inactivity (it could be done from System > Administration > Power management).

Obviously, you have to wait for a while after you sent the WOL packet, as your system needs to de-hibernate and it could take a few.

Good luck

share|improve this answer

With WoL enabled on your server to get it to wake up to specific protocol traffic you would need something like a script running on your router that has packet rules and can send the WoL magic packet when it receives the request.

Webserver wakeup example

share|improve this answer

Wake On Lan is the key, nearly all cards today support all modes (but not in linux :( ).

Easiest solution is a card which has a working Linux driver that supports Wake On Lan modes: pumbg in ethtool, you want something like unicast mode. So your computer starts as soon as you access its network address. But it is even more hard to get a list of cards which are supported by Linux, one I have found is Intel Gigabit Netzwerkadapter Pro/1000 GT PCI.

A workaround is, if you have a card that does not support all modes: Nearly all linux driver supports the g mode => magic packet. So you have to explictly turn your server on before you use it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.