I have a USB game controller that works flawlessly during gameplay, but it keeps disconnecting and reconnecting every ~40 seconds whenever it is left idle. While it is mostly harmless in practice, it is annoying to see the kernel messages are flooded with messages about the game controller. Many online resources, such as the Arch Wiki , suggest disabling USB autosuspend to fix this. Unfortunately, that didn’t solve the issue in my case. I suspect the controller expects to be continuously polled rather than entering a power-saving state, especially since it immediately tries to reconnect after dropping. Since I primarily use this controller by passing it through to a VM, I needed a way to manually manage its connection state. Here is the workaround that eventually did the trick: Add the following rule to udev . This ensures the controller is ignored by the host system upon connection. ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="xxxx", ATTR{idProdu...
Now that I have my VMs running, what if I want to switch between them? What if I want to put the VM or the host to sleep, or shut them down? In this post, I’ll discuss a few options. Just a quick overview of my setup: Only one VM is running at a time. All VMs have GPU passthrough, and the GPU is connected to a display. I have a secondary display, which I prefer not to use unless absolutely necessary. See also: Part 1 Part 2 Option 1: Deep Integration with Guest OS Ideally, I could just click on a “Power off and Switch to VM X” menu from within the guest OS. This isn’t difficult to support on the host side: the guest OS could pass the VM name to the host (e.g., via a serial port), and the host would automatically start the next VM when the current one exits. However, I didn’t find an easy way to implement this menu, especially considering I plan to support multiple operating systems. I also couldn’t find a way to prevent the guest from shutting down without providing the next V...