To enable hibernation in Ubuntu 12.04 (where it is disabled by default), add the following content to the file "/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla"
[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
You may need to run update-grub and to reboot so that the hibernation option shows up in the Shutdown dialog box.