Remote boot ubuntu desktop machine

1

I've setup ubuntu 14.04 on my iMac at home (as well as SSH & portforwarding).

I can connect via SSH when the machine is on, connected, and not suspended.

Similar to many hosting providers (i.e. digitalocean), how can I remote boot my iMac? If my iMac is off and I want to connect to it via SSH, I can't.

How do hosting providers do this? Is it something easily doable with an iMac running ubuntu?

Noah Matisoff

Posted 2014-12-17T19:31:48.180

Reputation: 111

Answers

1

Remotely powering on a machine is generally done with a wake-on-LAN "magic packet". This kind of packet, as it requires to be sent to the Ethernet address of the machine when it is off (so not being able to query it over ARP), or more commonly to the broadcast address, could only be sent from the same subnet/VLAN as the machine to wake (except if the router uses a static MAC address for the IP associated to the machine).

Some home ADSL modems (e.g., several models of FritzBox) are able to generate these Wake-on-LAN packets when clicking a button on their web interface. More generally, if you have any device you can remotely access in the same LAN as the machine to wake, it should be relatively easy to implement some way to send the packet that can be triggered from the Internet (trigger URL, web interface, SSH, etc.), depending on the needs. From a Linux shell, you can use the wakeonlan command (on Debian/Ubuntu: you can install with apt-get install wakeonlan), specifying the MAC address of the machine to wake as parameter.

However, the hardware of the machine must support Wake-on-LAN (on most PCs this has to be enabled in the BIOS): as far as I know, Macs do not react to it when they are really off, but only from sleep mode.

Ale

Posted 2014-12-17T19:31:48.180

Reputation: 920

Ok, so if I suspend my iMac running ubuntu, install wakeonlan, and follow this: http://superuser.com/questions/392956/wake-on-lan-on-uverse-router for my AT&T router, I can awake my machine and run commands via SSH?

– Noah Matisoff – 2014-12-17T20:44:34.150

I'm not sure that the modem will actually forward those packets from the Internet even if you setup a port forwarding for UDP port 9 (although it seems what the tutorial you mention suggests). This because (except if the router has a static ARP entry for your iMac) it will not know where to forward the packet... But it is worth trying. If it does work but not always, it might be the router forgetting the MAC address of the iMac after some time. Don't forget to enable the "wake for Ethernet access" checkbox in the energy saving preferences. – Ale – 2014-12-17T20:59:04.730