WOL not working in FOG
I have installed FOG 0.32 under Ubuntu 12.04.1 Server on a ESXi 5.1 machine.
I tried to wake up physical machines in FOG Management. Doesn’t function.
After a lot of searching i installed etherwake on Ubuntu.
And used wakeonlan to manually wake up the physical machine. -> Functions correctly.
So it must be an error in FOG using the WOL function from it’s wol.php.
Is that a right analysis?
I find no information to wol.php or the internal FOG WOL function.
Idon’t know what to do now. Perhaps the source of the error is another.
Can somebody please help? It is a project for my ‘exam’.
Some more information.
The physical machine is a DELL Presision 390 with a Broadcom 57xx NIC.
The settings of WOL Path, Host and so on are correct.
A wake on lan try with browser address pointing to wol.php&[MAC] doesn’t function.
It must be the fog wol function, because it functions on the same system with etherwake wakeonlan.
using etherwake like Daëavelwyn described will also not work with scheduled tasks or cron tasks.
It’s possible to just wake up a machine or to wake up it with an immediatelly followed image but
[B]NOT[/B] with scheduled tasks or cron tasks!
Please any of the developers please check that behavior!
This is not a generall WOL Problem it’s a FOG Problem!
let me say it in the name of a song of my favorite band: It’s hard to know!
I hope i can get wol to function properly in our corporate i see no other solution then wol, also lets say it doesn’t work then the weekend is over and the employee will start to work… we already have the specific pxe file for the client active and his machine will not boot into bs it will start the image creation… They will slap me
Is there a way to delete the active task if it couldn’t start after x minutes (start of image file creation on storage node)?
Most WOL problems with FOG have nothing to do with FOG. WOL is one of those technologies that looks great on paper and is a nightmare in the real world. If you don’t have the correct driver, it doesn’t work. If you don’t select the correct checkbox in the networking config, it doesn’t work. If you don’t turn it on in BIOS, it doesn’t work. If you don’t shut the computer down in a specific way, it doesn’t work. If you don’t have the proper power to the motherboard, it doesn’t work. If your PSU doesn’t supply the right power, it doesn’t work. If you are on different subnets and haven’t configured your networking equipment properly, it doesn’t work.
Right now, WOL has more “it doesn’t work if” that you can shake a stick at, and FOG isn’t one of them. If you’re WOL works when you start an immediate task but not when you schedule it via cron, it’s not a WOL problem, it’s a cron problem.
I banged my head against the wall trying to get WOL working with CrossTec SchoolVue, DeepFreeze, and FOG. Each program ran into the same problems as listed above.
i would bet that this problem has to do with sleep states of the computer:
[QUOTE]Wake On LAN in Configuration Manager 2007 supports waking up computers in sleep states S1 through S5. Sleep states describe the possible power states for a computer, as listed in the following table.
Sleep State Description
The computer is on and fully functional.
The computer appears to be off with the CPU stopped. RAM is refreshed, and the computer is running in a low power mode.
The computer appears to be off with the CPU stopped. RAM is refreshed, and the computer is running in a lower power mode than S1.
The computer appears to be off with no power to the CPU. RAM is in slow refresh.
The computer appears to be off with no power to the hardware. System memory has been saved as a temporary file on the hard disk.
The computer is off with no power to the hardware, and the operating system has been shut down without saving system memory to disk.[/QUOTE]
Is it possible that the fog wol mechanism cannot wake from any sleep state?
Maybe it’s worth a test to try to wake up a computer with fog from any of this states to figure out!
Translation:[QUOTE]In the ACPI specification is laid down that WOL a computer from the S3 state (suspend-to-RAM - STR) - should wake up and S5 (soft-off), S4 (Suspend-to-Disk STD). Furthermore, some specific options in the BIOS and power management of the network card must be enabled WOL can function at all.[/QUOTE]
One thing to remember is that if you want to boot via WOL you need to shut the computer down by the OS, or a WOL Manager.
Thru extensive research, my colleges and I have noted that our problems with WOL not functioning out of any product (we use a product called DeepFreeze that locks our computers in a “frozen” state and changes do not stick, with it I am able to reboot my machines, shut them down and start them again in the morning.) the problems came back to the end user using the power button to physically turn the machine off. The OS can not tell the BIOS to keep the card active, if the OS doesn’t know it’s going down.
Just something to keep in mind while you are troubleshooting.
At least this is true to all 19 different models of computers across my scope. My units all use some variation of RealTek networking cards, and I am not sure if this has something to do with it.
I too am hoping for a better way to manage WOL thru FOG.
thank you Daëavelwyn for your solution i will try this.
At the other end it’s a bit of sad that there are about 10 or more threads about the wol problem and there is still no real solution or an idea what is causing this.
I will report back if i had success.
I’m back !
Ok, so, here are the modifiations i’ve done to correctly use WoL with FOG 0.32
So, first of all, I will not use native FOG mechanism (fog/lib/WakeOnLan.class.php), because it doesn’t seem to work and I don’t know why ! I use etherwake instead.
First of all,install etherwake
[CODE]sudo aptitude install etherwake[/CODE]
After installing, to use etherwake with a non root user, you have (on ubuntu) to change www-data user right.
Become root :
then use the native editor for sudo to change right :
In the file launched, add this :
[CODE]User_Alias APACHE = www-data
Cmnd_Alias FOG = /usr/sbin/etherwake, /usr/bin/nmap
APACHE ALL = (ALL) NOPASSWD: FOG[/CODE]
Then go to edit your /etc/group file to add www-data to sudo group :
[CODE]sudo vim /etc/group[/CODE]
and add www-data to the sudo group
Now you just have to modify your wol.php file.
Be safe and make a backup of the original file:
sudo cp wol.php wol.php.origin
Here is the whole code of my wol.php :
require( “…/lib/fog/” . $class_name . ‘.class.php’);
$mac = new MACAddress($_GET[“wakeonlan”]);
if ( $mac != null && $mac->isValid( ) )
#$wol = new WakeOnLan($mac->getMACWithColon());
echo "MAC Address : ".$mac."<br/>"; system("sudo /usr/sbin/etherwake ".$mac);
As you can notice, i’ve kept the function __autoload but not use the called class. Then I’ve just commented class call and add etherwake call.
I’ve already read argument about the fact I let non root user having privileges and I know this workaround could be better coded (with a real error return code for example) but this is just an example which can avoid somewho to lost as many time as i’ve done !
I hope wol function will be improved in the FOG futur release !
EDIT : I’ve also tested with grouped computer and it works like a charm
Hi gilou and ahachenberg, thanks for your reply, i will try this as soon as possible (probably next tuesday) and let you know if it works for me !
Try the wiki here:
I’d also check to see that etherwake resides where fog is looking for it. Perhaps it’s somewhere else in Ubuntu 12.04. But, I can add that my Fog server is Ubuntu 11 and is a VM ontop of esxi 5 and WoL is working. Some of my Dell laptops would refuse to WoL and only do so after I applied default settings to BIOS and then reconfigure BIOS to enable WoL (and PXE).
And, beyond all of that, check you Ubuntu server’s syslog/messages after attempting to WoL. Maybe it’ll tell you something.
I had trouble with WOL when the server had more than one interface than the one it uses to communicate with the hosts… Even if the settings were set to send the packet on a given interface, for the hosts to start, I have to put a more specific broadcast address than 255.255.255.255.
I actually think by quickly checking that the interface setting is ignored in /var/www/fog/lib/fog/WakeOnLan.class.php but anyway, I solved it by changing line 54 (search 255.255.255.255):
if( socket_sendto($soc, $strRaw, strlen($strRaw), 0, “192.168.1.255”, 9) )
And it works like a charm, and I do have optiplex of many kind that properly wake up now…
Hi, i’ve the same problem with almost the same configuration. Server is a DELL PowerEdge 860 with ubuntu server 12.04 and client is a DELL optiplex 740 with windows XP.
I succeed in starting the client with the etherwake MAC-ADDRESS from the serveur, but I can’t make the wol functions from FOG webui do the same job.
I have to add the client computer must be well shutdown with the windows shutdown menu, otherwise, etherwake doesn’t work.
Any suggestions ?
Yes thats fine Buddy, i wonder that wakeonlan from etherwake package functions and the wol function of FOG not. Must be another mechanism how WOL is working. I will check some things as soon as i have time. Perhaps i made a mistake, but i think not.
I am standardized on just a few models of desktops, but WOL works great with us. Now I know that it will not go through our dumb switches… With my managed switching infrastructure, and our Dell 990 , Dell 9010, and HP 8300 lines it works great.
hit-and-miss success with WoL means it does’nt function each time properly?
I read something that earlier versions of fog used etherwake -> wakeonlan.
Wakeonlan functioned properly within the virtual machine.
So why does’nt FOG use it anymore?
It would be a pitty if i have to turn on each pc manually. Or writing circumstantional scripts to “implement” the function.
Is there any hint how to wake up the machines which are managed to groups?
I don’t think it’s a VM problem. I have hit-and-miss success with WoL functionality between all my models of laptops and desktops.
can somebody proof that WOL functions with FOG 0.32 without being installed on a virtual machine?
I want to locate if it is an error due VMware or a common FOG error.
Perhaps i have to adjust settings in VMware…