Setting up a System w/ Wake-on-LAN and VNC? 74
andrebsd asks: "I'd like to make myself some sort of webpage where I could startup my system with 'Wake on Lan', and once it is started, use VNC to login. Once I'm done doing what I need the system for I would then like to shut it down again. I'm wondering how one might go about putting something like this together. VNC has various scripts for making that part work, but I haven't seen any scripts that can function as a 'Power on/Power off' button for a webpage. Thanks to anyone with any way of doing this." While there are helpful reference for Wake-on-LAN tools, how would you integrate all of these into a coherent system? How might one keep such a system (relatively) secure?
what system, dude?!?!?! (Score:4, Insightful)
WOL isn't very hard. (Score:5, Informative)
It's not very difficult to do this with a perl script or something similar that can be integrated into a web page.
Another alternative that may interest you if your target computer has access to a phoneline is "Wake on Ring". Some BIOS vendors (Abit was one) allow a modem to power on a PC after a specified number of rings.
Re:WOL isn't very hard. (Score:4, Informative)
Here's a perl script [cafwap.net] that will do just that, then all you would need to do is combine it with mod_perl and you'd be set. As far as security I don't really think it'd be an issue, besides, you DEFINITLY have security-through-obscurity on your side here
Re:WOL isn't very hard. (Score:1)
Where is your "system"? (Score:4, Informative)
Where is your "system"?
You do realize that Wake on LAN is a layer two protocol, right? I.e. it's an ethernet protocol that has nothing to do with IP, UDP, or TCP.
The webserver that is hosting this webpage will have to be on the same local area network [layer two] as your "system." So:
where the final arrow MUST be on the same local area network.The person who administers the webserver [the second to last point in the diagram] must give you sufficient rights to some daemon on that webserver so as to allow you to send out a layer two [ethernet] packet via that daemon. If you yourself are not the administrator of this webserver, the chances of you getting those kind of rights are between slim and none. The standard sandboxes, such as the Java sandbox, don't allow you to get anywhere near sending a layer two packet.
Zero hits on "static ARP association". (Score:1)
I'm getting zero hits on this mystery technique called "static ARP association": Doe it have another name?
Well (Score:3, Informative)
webmin module (Score:2)
I suppose you can take one of the hundreds of perl WOL scripts and pretty easily(though not completely pain free Google: "perl wake on lan"), issue a WOL command.
Um, too obvious? (Score:5, Interesting)
<html><body>
<?php
$machine="123.123.1
$connect="wakeonlan --wakeup $machine";
if($_REQUEST['connect']) {
exec($connect);
?>
Starting up <?=$machine?>.
<?php
} elseif(ping($machine)) {
?>
<?=$machine?> is up.
<?php
} else {
?>
<?=$machine?> is down. <a href="?connect=1">Start up</a>.
<?php
}
?>
</body></html>
Re:Um, too obvious? (Score:2)
Re:Um, too obvious? (Score:2)
Making it up as i type it into a slashdot box? Nope ;-)
But for things without a template system I do prefer to keep HTML output outside the php parser.
The above was simplistic, but add some real HTML with lots of quotes that need escaping, some indentation, and an editor that syntax highlights HTML differently from PHP (and sure, a bit more thought into layout), and I find it easier to manage. That's just me of course, and i've n
Re:Um, too obvious? (Score:1)
In short, when writing themes, HTML should be written as HTML and PHP should be written as PHP. One of the great strengths of PHP is that it allows the coder to break out of PHP and code HTML on a dime with no performance setback by simply specifying closing and opening PHP tags where you want to start PHP code again. In fact, it is faster for your server to process a PHP/HTML mix this way.
Instead of coding HTML where
Re:Um, too obvious? (Score:2)
Uh, dude, that "or whatever" is more than 50% of the question he was asking. (Unless you are holding out on us with a "wakeonlan" script you have filed away somewhere...)
Re:Um, too obvious? (Score:2)
Some simple ideas (Score:5, Informative)
I use WOL to turn my Windows XP PC on by SSH'ing to my Linux server on the same LAN, then running the Linux WOL utility [uminho.pt] to turn the Windows PC on. Then I have the Terminal Services service running on the WinXP system on a non-default port where I can shut it down if I want to (using tsshutdn). It might also be possible to shut the system down remotely from the Linux system with Samba, but I've never tried that.
Re:Some simple ideas (Score:3, Informative)
WOL uses UDP to send the "magic packet", usually to port 9, where the packet never goes past layer-2 on the receiving end.
In a LAN this is a broadcast packet, but you can also direct the UDP to the last known IP address associated with a particular NIC. Sometimes it works, usually it doesn't.
Re:Some simple ideas (Score:3, Informative)
Re:Some simple ideas (Score:1, Informative)
Re:Some simple ideas (Score:2)
Security through obscurity - the golden path to heaven
you might want to go read these pages [insecure.org]
particularly this one [insecure.org]
your non-default port is worth 0 points
Re:Some simple ideas (Score:2)
Re:Some simple ideas (Score:1)
Re:Some simple ideas (Score:2)
Port-forward through SSH = Give Gudlyf cookie and 20 points
Re:Some simple ideas (Score:3, Informative)
The second meth
Re:Some simple ideas (Score:2)
Re:Some simple ideas (Score:2)
(I can only assume that your Windows box is behind a firewall, and not directly accessible to the world. If it is, well, this is a moot question.)
WOL works fine across the internet (Score:2)
Why WOL? (Score:2)
What I do. . . (Score:3, Informative)
I have a couple boxes on my network, one of which is a linux box that is "always-on". I have the SSH port (port 22) open to incoming connections from outside the network, and I have a VNC port open able to get to from outside the network, on the windows machine. I just ssh into my linux box, and run a simple perl script (I already recorded the NICs MAC address) to send the magic packet to the windows machine, give it a couple minutes, and then VNC on in to my windows machine. . .
always-on appliance with an IP address (Score:4, Interesting)
You have a good basic idea. You don't want to leave the computer on all the time, but you would like to VNC the computer when you need it. Actually, I want that too.
All you need is a low-voltage switch with an Internet address. You can adjust the OS to turn on when the power switch is pressed and hibernate if the power switch is pressed, if the computer is already on. If you need a cold re-boot, you can run the shutdown command from VNC, using a time delay.
A switch with an Internet address need cost no more than $50. The question is, who sells such a switch?
Re:always-on appliance with an IP address (Score:4, Interesting)
You can pick up one on eBay [ebay.com] for a few hundred dollars, which works out to less than $50 per switched device.
I picked up a Masterswitch Plus (basically a switch with a serial port that can signal a computer to do an orderly shutdown) for about $300 on eBay about 6 months ago, and use it to control several computers and my network hardware.
Shouldnt be that hard (Score:1)
internet -> Webserver -> priv network -> Machine
You use the internet to hit the webserver which is a machine that is on both the internet and the private network. The web server has scripts that allow it to run some WOL script to wake the machine and then checks every now and then to see if the machine is started and the vnc server is running, now that you have the machine running be sure it is configured to run the java vnc server so all you have to do is connect to the vnc
Apple Remote Desktop (Score:2)
Can be done with GSM (Score:2, Interesting)
Any cheap routers capable of sending WOL? (Score:4, Interesting)
Are there any cheap routers that can send a simple WOL message? Are there any that have been hacked so that someone can add this function?
Re:Any cheap routers capable of sending WOL? (Score:5, Informative)
Consequently, I have a 3Com 3C510 Home Gateway (not made anymore) and it can also do the same wake up functions (not surprisingly, since it contains the same internals as SMCs)
Re:Any cheap routers capable of sending WOL? (Score:2, Informative)
Catch (Score:2)
Having said that, you may as well have your extra PC always turned on as well, but with power saving enabled.
If only you could wake up machines straight over the internet...
it's not IP, so it won't get routed (Score:4, Informative)
"FF FF FF FF FF FF 00 11 22 33 44 55"
(if 00:11:22:33:44:55 is the target MAC). So it won't pass any routers, You have to do this in an ethernet-segment. Try
# ether-wake 00:11:22:33:44:55
and catch it with Your favorite sniffer.
It would be senseless to use IP for WoL, as the arp-table of the last router has already forgotten the MAC of the dest ip and cannot resolve via arp-request it as the destination host is sleeping. If You have no machine next to Your target, You're lost.
graf0z.
Re: it's not IP, so it won't get routed (Score:5, Interesting)
Because of the handshake You cannot use TCP, but any UDP or ICMP (ping!) packet including the magic would do it. It has to pass the firewall (if any). The dest address could be
Read AMD whitepaper [amd.com] and a howto [uminho.pt].
Re: it's not IP, so it won't get routed (Score:2)
Thanks, this will be useful to me!
Re:you can use IP... (Score:2)
You're right, but you can use IP if you use the remote subnet's broadcast address (i.e. no ARP request is needed). The perl WOL utility allows you to specify the IP to use.
New Wrinkle (Score:3, Funny)
How about when I've got only one system, and it connects using PPPoE to the outside world... can anybody solve *that* one?
How about if pull out the power plug before I leave for work in the morning?
Re:New Wrinkle (Score:1)
APC 9210 power switch (Score:2, Interesting)
We use these where I work for remote control of systems that have to be cold-booted every so often.
May I add to this question? (Score:3, Offtopic)
As far as your concerned these are winXP machines. We have 4 on the same lan. I was thinking of having a wake-on-lan system that would force a kiosk to send a "wake-on-lan" request to a neibooring kiosk if it was offline.
But that doesn't really help me if the kiosk is crashed and online. Is there a similar "reset-on-lan" feature out there?
Yes. (Score:2)
There are two solutions that offer what you seek. First you can use server hardware like HP/Compaq with built in Out Of Band(OOB) management cards or Lights Out management cards [hp.com] in them. These cards are IP addressable and connect into the system's BIOS. They allow you to power the system on and off as well as view the boot up screens and even access and change the BIOS settings, all remotely. These are very powerful and indespensible for ma
Re:Yes. (Score:1, Troll)
From what I can tell, the only downside is that it'll need its own IP address. (Which we try and conserve at my workplace).
Re:May I add to this question? (Score:2)
On a somewhat related note ... (Score:2)
Think powering an out-of-case device (in my case, a IR receiver).
Re:On a somewhat related note ... (Score:2)
Cygwin's shutdown command works for windows (Score:1)
shutdown -h 25
$ shutdown --help
Usage: shutdown [OPTION]... secs|"now"
Bring the system down.
-f, --force Forces the execution.
-s, --shutdown The system will shutdown and power off (if supported)
-r, --reboot The system will reboot.
-h, --hibernate The system will suspend to disk (if supported)
-p, --suspend The system will suspend to RAM (if supported)
--help Display this help and exit.
--version Output version in
shell ap (Score:2)
That'll turn the system on, then, VNC as necessary.
To turn off, VNC in and click shutdown or shutdown -k now or w/e.
Routing WOL across internet, through firewall (Score:1)
One thing worth noting is that the windows software they used to send magic WOL packets sent them to UDP port 2304. I don't know if this port is standard, so if WOL works through your firewall with their program but not ether-wake or some other software, find out what port your software uses and subsititure that into the firewall forwarding rules.