How to Completely Disable ‘USB Wake’ (Wake on USB) in Ubuntu Linux

USB Wake (also known as Wake-on-USB) is a power management feature supported by the Linux kernel and modern motherboards. It allows a suspended or sleeping Ubuntu system to be awakened by activity from a connected USB device, such as clicking a mouse or pressing a key on a keyboard. While useful for desktop environments, this feature can be highly problematic for servers or laptops, where an accidental bump to a peripheral—or a faulty USB hub sending erratic signals—can unintentionally wake the system, leading to unnecessary power consumption and heat generation.

This guide explains how to completely disable USB Wake in Ubuntu Linux to ensure your system only resumes from sleep via the physical power button.

Identify the USB Wake Device Paths

Before disabling the feature, you must identify which USB controllers on your system currently possess the authority to wake the machine from an ACPI (Advanced Configuration and Power Interface) sleep state.

  1. Open your terminal in Ubuntu.
  2. Execute the following command to view the ACPI wakeup device list:
    cat /proc/acpi/wakeup
  3. Examine the output. Look for devices labelled USB1, USB2, UHC1, UHC2, XHC, or EHC1.
  4. If the Status column next to a USB device says *enabled, that specific controller is currently authorised to wake the system.

Disable USB Wake via the ACPI Interface

You can toggle the wake status of a specific device by echoing its four-letter identifier back into the /proc/acpi/wakeup file.

  1. To disable a specific enabled USB controller (for example, XHC), execute the following command with root privileges:
    sudo sh -c "echo XHC > /proc/acpi/wakeup"
  2. Verify the change by checking the file again:
    cat /proc/acpi/wakeup | grep XHC
    The status should now read *disabled.

Make the Changes Permanent Across Reboots

Modifications to /proc/acpi/wakeup are strictly ephemeral and will reset to their default enabled state every time the system reboots. To make the disablement permanent, you must create a systemd service that automatically applies the change during the boot process.

  1. Create a new systemd service file using a text editor (such as nano):
    sudo nano /etc/systemd/system/disable-usb-wake.service
  2. Paste the following configuration into the file (modify the device identifiers, e.g., XHC, to match those enabled on your specific hardware):
    [Unit]
    Description=Disable USB Wakeup Triggers
    DefaultDependencies=no
    After=basic.target
    
    [Service]
    Type=oneshot
    ExecStart=/bin/sh -c 'for i in XHC UHC1 UHC2; do grep -q "^$i.*enabled" /proc/acpi/wakeup && echo $i > /proc/acpi/wakeup; done'
    RemainAfterExit=yes
    
    [Install]
    WantedBy=multi-user.target
  3. Save the file and exit the editor.
  4. Reload the systemd daemon to recognize the new service:
    sudo systemctl daemon-reload
  5. Enable the service to run automatically at boot:
    sudo systemctl enable disable-usb-wake.service

By implementing this systemd service, your Ubuntu system will automatically scan and disable USB wake triggers upon every reboot, ensuring strict control over its power state management.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.