Xubuntu 14.04: how to enable hibernate?

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo nano /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

Look for

[Disable hibernate by default in upower]
[Disable hibernate by default in logind]

Change the value of "ResultActive=no" to "ResultActive=yes" in both, press ctrl+x to exit the file. It will ask to save the change or not. Press Y to save the change, if you're on Ubuntu restart your system.

Edit

Just tried this on Xubuntu 16.04, and Ubuntu 16.04. and it also works.

enter image description here

For Ubuntu 16.04 I had to reboot for it to work.

enter image description here

enter image description here