Wake Your Linux PC From Suspend With a USB Mouse or Keyboard

While booting your PC with the power button might be reliable, it isn’t the most convenient or ergonomic solution for many users. One of the best alternatives is using your keyboard or mouse to boot your PC.

On the surface, it might seem like most Linux distributions don’t support this convenient setting. It’s easy to wonder: is there any possible way to enable waking with USB devices? On distributions like Ubuntu and Debian, enabling wake from USB only takes a few simple steps.

4

Determine What USB Devices You Will Use

Before changing any settings, you should think about what USB devices you would like to use to wake your PC. Most people like to use their keyboard. Using your mouse is also a good option, but it’s worth noting that mouses are known to be very finicky. They canwake some PCs with the smallest movements.

In most cases, you shouldn’t enable all devices and ports for wakeup. While this won’t directly cause any issues, it does increase the likelihood that one of your USB devices might cause unwanted waking behavior.

man using keyboard and mouse on desk

Once you’ve decided what USB devices you would like to use to wake your PC, you will need to get more information about each device by entering the following command in the Terminal.

After you hit enter, the Terminal will print a list of all USB devices, including their names, bus numbers, device numbers, and ID numbers. Look through the list until youfind the correct USB device. Write down the bus number and the last four digits of the ID number for each device you intend to use to wake your PC.

ubuntu terminal prints usb devices and id number of device

Enable USB Ports During Suspend

Next, you will need to confirm that the ports your USB devices are connected to are enabled for wakeup. Start by finding the port that each USB device is plugged into by entering the following command. ReplaceIDNUMwith the last four digits of your USB device’s ID number.

The system will print the bus and port that each USB device is plugged into (see above). Note that the directory path printed shows that the keyboard (0027) for this PC is device 1-5.4.

using cat to determine whether usb device has wakeup enabled on ubuntu terminal

Next, determine if wakeup is enabled on the ports that your USB devices use by entering the following command. Check the port for every device that you intend to use. ReplacePORTNUMwith the port number (for example: 2-01 or 3-14).

After entering the command, the system will print whether the specified port has wakeup enabled or disabled (see above). If any ports have wakeup disabled, use the following command to edit the file and change wakeup toenabled. Enter your password if prompted. Finally, save and exit the file.

adding new configurations to rc.local with the ubuntu nano editor

Configure A Wakeup Rule For Your USB Device

After enabling wakeup on your computer’s ports, you will need to enable wakeup for your USB devices. you may do this by opening the device wakeup configuration file with the following command. ReplaceUSBNUMwith the correct name for your USB device. Ex., Bus 001 = usb1, Bus 003 = usb3.

The file will display whether wakeup is enabled or disabled for the specified device. Change disabled toenabled, and then save and exit the file. Repeat this process for each device you intend to use to wake your computer from suspend by changing the USBNUM each time.

Configure Your New Settings to Persist After Reboots

Finally, you will need to configure your PC so that your new settings persist after each reboot. You should start by opening the configuration file with the following command.

Once the file has been opened (see above), you will need to scroll until you find the section of the file just after the comments and before exit 0. Select the space between the comments and exit 0 to add a line for each port and device you intend to use. If the file is empty, simply select the file and add the new configurations to the first line.

It’s important to note that the settings will only work exactly as you specified. If you decide to start using a new USB device or a different port with your PC, you may need to adjust your wakeup configurations to ensure that the new devices work properly.

Verify That BIOS Allows USB Wakeup

Finally, you should make sure that your PC’s BIOS is configured to allow wake from USB. You can check whether this is the case by restarting your computer andusing the correct BIOS keysto interrupt the boot process.

After loading BIOS, you will need to navigate to the advanced settings or power management menu. The location of the wake from USB setting may vary depending on your PC. Once you find the setting,enablewake from USB (see above) and boot your computer.

Enjoy Your Convenient New System Configuration

There’s no need to worry about annoying boot processes and poor ergonomics when you configure your PC in the right way. Wake from USB is one of the best settings you may use to make starting your PC as convenient as it can possibly be. There are plenty of other tips to help you do so on Linux machines.

Want to get better at using Linux? These Ubuntu tips and tricks will help you become a power user in no time.

The fix was buried in one tiny toggle.

Free AI tools are legitimately powerful; you just need to know how to stack them.

You’re not getting the most out of what you pay for iCloud+.

Don’t let aging hardware force you into buying expensive upgrades.

Not all true crime is about hacking, slashing, and gore.

Technology Explained

PC & Mobile