Search this site





Disabling battery/power management in Ubuntu

I have some ubuntu VMs. VirtualBox's guest tools provide a way for guest OSs to see battery and other power states.

The problem is that Ubuntu 12.04 will always suspend itself when battery is low. What is "low"? Something not tunable. Can you change the 'low battery' action? No, the setting panel for it says "Perform action on critical battery" or something and the dropdown box is blank.

When Ubuntu decides it's 'critical' time, OSX (the host os, here) claims usually 20% battery remaining. Critical, eh? :\

So, the next step is to get Ubuntu/Gnome to not even see a battery.

The utility providing this data is 'upowerd'. You can try to kill it, but dbus will just start it back up again. It's not a service you can disable with upstart, since it's managed by dbus itself.

You can't just uninstall the 'upower' package, no, because it will remove gnome-session and other probably important packages for your workstation.

To disable upowerd, you have to remove this file:

Then reboot. Alternately, you could 'pkill upower; restart dbus' but I found that restarting dbus made gnome/xorg freak out (blink, apps restarting frequently, etc) as well as it killing the network (because networkmanager), so I had to reboot anyway.

And now I have a vm that doesn't foolishly suspend itself. Also, dbus is shitty.