Disabling wireless power management in Ubuntu

I recently installed 10.10 on my MacBook Pro and noticed that whenever I went into battery mode, my wireless connectivity was severely crippled. A look at iwconfig confirmed that the wifi power management was being enabled every time I yanked the plug. I scoured /etc and couldn’t find any acpi or pm event that would trigger this.

After digging through the filesystem, I found that Ubuntu has a default set of power events set in /usr/lib/pm-utils/power.d. Therein I found a “wireless” script which enabled power management mode whenever a battery power event was triggered.

The script didn’t appear to have any way to configure an override for this behaviour, and I *abhor* doing any form of config management in /usr. Luckily, I found a somewhat non-intuitive solution. Any script in the /usr/lib/pm-utils/ directory can be overridden simply by creating a script of the same name in /etc/pm. I created a blank file called “/etc/pm/power.d/wireless” and voila, no more wireless power management.


A few users have mentioned that placing the blank file in their power.d directory did not work for them. I should note that creating this file simply stops the power-management system from executing the contents of /usr/lib/pm-utils/power.d/wireless, it does nothing to actually switch your interface back. It appears that in some actions, such as closing the laptop and opening it back up, can trigger the hardware itself to go into power management mode. You can forcefully prevent that by placing the following in the “/etc/pm/power.d/wireless” file.


/sbin/iwconfig eth1 power off
Share and Enjoy:
  • StumbleUpon
  • Facebook
  • Twitter
  • Reddit
Disabling wireless power management in Ubuntu

53 thoughts on “Disabling wireless power management in Ubuntu

  1. fellow says:

    Well Done! I’ve found this command elsewhere, but I like the placement to override the problem from occurring. In my case, the wiresless issues with BCM4322 on a Macbook Pro 5,2 only happened when on battery.

    1. Perhaps I spoke too soon. I added the script in /etc/pm/power.d/wireless, but if I boot on battery, I cannot connect to any wireless network. Anyone know if the 3-4 updates on Broadcom’s site for the STA drivers work better with the BCM4322 (rev 01) network controller?

      1. jharvey says:

        Hmm, on a Macbook Pro 5,4 here which has the 4322 rev01, and I’m not able to reproduce that problem. I’m running the default STA drivers available in Ubuntu 10.10. What output do you get when running “iwconfig”?

        You might also try forcefully unloading and reloading the STA driver by running “rmmod bcm5974” followed by “modprobe bcm5974”. (Be warned that when I did this a few yrs ago on an old macbook, it caused it to crash & reboot.)

        If you find a solution, let me know and I’ll add it to the post.

        Good luck.

    1. Tiago Marques says:

      Fala Paulo, fazendo isso resolve o problema de lerdeza usando wireless do ubuntu 11.10 ?

      Minha internet tem 10mb, quando uso o linux ubuntu no wireless cai para 1 mb, eu testei no windows usando wireless tb, e bateu 8mb…

      Será que fazendo essa alteração, resolve o meu problema ?

    1. anonymous person says:

      Also, just to note I updated the command as noted below.



      /sbin/iwconfig eth1 power off



      /sbin/iwconfig wlan0 power off

  2. Hi guys,

    I’m running 10.10 on macbook pro 7.1. Disabling power management helps indeed to make wifi at least to work. But I do experience maybe less important but still annoying issue quite flaky wifi connection. Its like ping to router gets every 10th packet of ping latency about 200ms. Makes website comes noticable slower than it should.
    Have a look to this bug https://bugs.launchpad.net/ubuntu/+source/wl/+bug/681445
    Have you got similar issues?

  3. Hey, this worked a treat for me. Was really puzzled over why battery mode was effecting wifi like it was. Turning power management off fixed it for good.

  4. Brian says:

    I have just installed 10.10 netbook on a new samsung N150 and I am having the same problem “No or weak Wireless on battery power”

    Tried to use this solution but there is no wireless file in power.d

    Am i missing the point somewhere ?.

    1. jharvey says:

      The solution is to create a blank file named ‘wireless’ in /etc/pm/power.d. This will override the /usr/lib/pm-utils/power.d setting.


  5. Nils says:

    Thanks alot!
    This works also for me with my old MSI sub notebook. Tried several stuff mentioned in different threads or bug reports but this did it finally.

  6. durandal00 says:

    I was having the same issue with my Toshiba NB505. I just installed Linux Mint 11 and started noticing considerable network performance drop when using battery power and quite frankly I was really close to putting Windows back on the machine when I stumbled across this post. Thank you to the original author. However, after implementing the above suggestion I noticed I lost connectivity completely when waking my laptop from sleep mode. So what I finally did was an alternative solution that worked for me was to back up the /usr/lib/pm-utils/power.d/wireless file to another location and then edited the file changing all entries that reference battery power to the same setting as AC power. I also changed all “power on” settings to “power off” to disable any power management. If you crack open the file you will see what I am talking about as it is pretty obvious. Making these changes basically tells Linux to use the same power settings for AC and battery power in regards to the wireless card. Doing this will knock some more time off the battery time which is already pretty bad under Linux. When running Windows 7 on this laptop I could get about 8 hours of use on a battery charge (unless I watched movies). On Linux it is about half that and with this change probably about a third so that is something that needs improvement in Linux. Hope this helps someone else encountering this problem.

    1. maddy says:

      kindly explain in detail step wise how did u perform all those actions.
      i am new to linux and love it , but for the slow internet.


    2. Bruno says:

      I’ve tried the solution proposed in the post, but it didn’t worked. I think I forgot of setting the executing flags to the wireless config file (maybe you’ve forgotten this step?). So I managed to a solution similar to what was proposed by durandal00.

      Copy the original file:

      sudo cp /usr/lib/pm-utils/power.d/wireless /etc/pm/power.d

      Edit the new file to use the same configuration on both ac and battery power .

      sudo gedit /etc/pm/power.d/wireless

      This can be done by switching the following lines in the final of the script

      case $1 in
      true) wireless_powersave off ;;
      false) wireless_powersave on ;;
      *) exit $NA ;;

      to this:

      case $1 in
      true) wireless_powersave off ;;
      false) wireless_powersave off ;;
      *) exit $NA ;;

  7. Ulisses Penna says:

    Thank you very much. It worked just fine.
    Every time I took off the energy plug, my netbook drops ping (ICMP) packets. It used to loose more than 80% of the packets.
    With the solution you provided, now I can plug off (and keep using battery only) and the wifi is usable and all the ping packets are ok!

  8. […] Here is a good tutorial show you how to Disable wireless power management in Ubuntu: I recently installed 10.10 on my MacBook Pro and noticed that whenever I went into battery mode, my wireless connectivity was severely crippled. A look at iwconfig confirmed that the wifi power management was being enabled every time I yanked the plug. I scoured /etc and couldn’t find any acpi or pm event that would trigger this. […]

  9. tajunta says:

    Thanks! This works like a charm, and boy have I been splitting my hair with this issue. The blank file didn’t work, but the updated section of your advice did the trick.

  10. bogstryder says:

    I had the same problem with Linux Mint 11 running on my Dell XPS 15z, and this worked. Thanks.

    It strikes me we are going to have problems like this until the day when proper linux drivers are available for all OEM hardware.Until then anyone compiling a distribution just has to provide defaults which may or may not work as hoped.

    In this case though, it would appear the defaults need some work.

  11. mo.... says:

    Thanks for trying but it still won’t work for me on Ubuntu 12.04 and Toshiba AC100.

    I’ve even made the “power off” change in both files and it still goes back to “on” when I login.

    I am starting to tear my hair out with this one…. There is obvioulsy still something overriding these files?

  12. dedieko says:

    Thanks for this tips. This script will kicks in when you switch your power mode ( plug and unplugged).

    This post might be helpful:

    i followed the instructions as indicated above, but my system was still booting with the wlan0 powersave “on.”

    so i tried entering this command in a file that allows you to enter sudo commands and it will execute those commands at startup. (note: there seems to be dozens of ways to run a sudo command at startup. i found this one to be the best):

    the file name is:


    edit the following file by entering:

    sudo gedit /etc/rc.local

    add the lines to disable wlan0 wireless:
    sleep 10 (this gives the wireless dongle/card time to to load, before executing the command below)
    “iwconfig wlan0 power off”

    important! make sure there is a line at the very end that reads:

    “exit 0”

    this will bypass any errors and allow the system to continue to boot.

    you can add other startup commands here as well – very useful.

    it should look like this:

    #!/bin/sh -e
    # rc.local
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will “exit 0” on success or any other
    # value on error.
    # In order to enable or disable this script just change the execution
    # bits.
    # By default this script does nothing.
    sleep 10
    iwconfig wlan0 power off
    exit 0

  13. rodrigo says:

    I am having a really annoying issue with my wireless card. Every time I unplug the AC cable, the wireless goes down. The wireless card itself disappear: I can’t see it using iwconfig or ipconfig. I’ve been trying, in vain, for the last couple of weeks to fix it. Can anybody help me with this?

Leave a Reply

Your email address will not be published.