Xubuntu 15.04 Cannot Suspend when inactive

Solution 1:

It looks like your user is not allowed to suspend the PC when not logged in.

Open /usr/share/polkit-1/actions/org.freedesktop.login1.policy
with your favorite editor as root and search for entry
<action id="org.freedesktop.login1.suspend">

Change
<allow_inactive>auth_admin_keep</allow_inactive>
to :
<allow_inactive>yes</allow_inactive>

Solution 2:

I had the same issue in Xubuntu 16.04, this fixed it for me:

At the terminal, type:

xfconf-query -c xfce4-power-manager -lv

If the output of the above command doesn't contain the following line:

/xfce4-power-manager/inactivity-sleep-mode-on-battery   1

then, at the terminal type:

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-sleep-mode-on-battery -n -t int -s 1