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.
- Open your terminal in Ubuntu.
- Execute the following command to view the ACPI wakeup device list:
cat /proc/acpi/wakeup - Examine the output. Look for devices labelled
USB1,USB2,UHC1,UHC2,XHC, orEHC1. - If the
Statuscolumn 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.
- 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" - Verify the change by checking the file again:
The status should now readcat /proc/acpi/wakeup | grep XHC*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.
- Create a new systemd service file using a text editor (such as
nano):sudo nano /etc/systemd/system/disable-usb-wake.service - 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 - Save the file and exit the editor.
- Reload the systemd daemon to recognize the new service:
sudo systemctl daemon-reload - 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.