Here we go:
Note: You can actually start any wol (make-on-lan) capable computer, not just a linux computer this way.
Step 1: Typical Situation.
Oh, Wait I set up that server to turn on remotely!!! Just need to double click the icon to start it up.
Double clicked the icon and will wait a little bit.
Now let me see if I can log in remotely to check the status of the server
$ sudo /etc/init.d/apache2 status
[sudo] password for eddie:
Apache is running (pid 1602).
Oh great!! system is up and the web server is running. Let me get to the web page now. It's up! Done, all without leaving the bed. I will work on the Wordpress blog a bit.
How to do it next......
Step 2: Bios Setup.
Once you have done that, you will want to start up the system and go to a command prompt and type: ifconfig
eth1 Link encap:Ethernet HWaddr 00:00:00:00:00:00 <================ HWaddr is the mac address.
inet addr:192.168.1.115 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:596593 errors:0 dropped:0 overruns:0 frame:0
TX packets:446564 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:757497076 (757.4 MB) TX bytes:50616341 (50.6 MB)
Interrupt:18 Base address:0xb000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:151 errors:0 dropped:0 overruns:0 frame:0
TX packets:151 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:32210 (32.2 KB) TX bytes:32210 (32.2 KB)
This will give you the Mac (media access control address). Nothing to do with Apple.
Save this address for later. I change the address I changed the one here for what ever reason,
Note: for mapping your network also see https://www.instructables.com/id/Map-your-network-visually/
Step 3: Get the Utilities.
Still at the command prompt:
sudo apt-get install wakeonlan etherwake.
You actually loading two utilities that do the same thing. I mention both utilities in case your system does not have one or the other.
Then you can create a batch file with the command and mac address so you do not have to remember it, I prefer wakeonlan.
# sudo etherwake -i eth1 -b 00:00:00:00:00:00
Enter the following command at the prompt from a remote machine to turn it on.
$ wakeonlan 00:00:00:00:00:00
$ chmod +x s1wake
Sending magic packet to 255.255.255.255:9 with 00:00:00:00:00:00
Note the remote machine to be awaken must have power to it, turned off and have a valid hard wired ethernet connection. I have not seen any wireless systems with this feature yet..
There are other utilities that will do the same thing for other systems, but I will not take the time to discuss them here..
Step 4: Logging In/out.
Once the machine is booted, you will want to log into that machine and do what needs to be done. Adding or removing software, doing updates, created and or modifying code such as for web pages, and whatever.
$ ssh servername
Once your done, you can type the following to remotely shut down the machine. (requires the sudo password),
$ sudo poweroff
I have done this with machine half way around the world. Can be a real life saver and you have done this without leaving your seat!
Step 5: Lets Make It Even Easier.
On the desktop, right click and choose "Create Launcher".
You should get a small window with some fill in the blank. Like the one show below.
Leave the type as application.
Name your application such as " Wake my server now!"
Now click on the browse button to locate the s1wake file you created earlier.
Click on open when you have found the file and highlighted it in the file browser.
You can add a comment if you want but that can be done later.
You should see a new icon on the desktop.
Double click on it and viola the remote machine starts.
Note: if you move or remove your s1wake file, the launcher will no longer work. Also you will still need to access the remote machine to shut it down.