How can I connect my XBOX Series X|S gamepad to my Linux machine?

Solution 1:

If Bluetooth is not a must, one can connect the gamepad via USB. It will work flawlessly then, even on older machines (Ubuntu 20.04).

If Bluetooth is required four conditions have to be satisfied:

  • a very recent kernel is required (>= 5.11, maybe even >= 5.12)
  • some configurations have to be applied
  • xpadneo has to be used
  • You might have to pair the gamepad again.

According to xpadneo you will need a Bluetooth chipset that supports Bluetooth Low Energy. I use ASUS USB-BT400 with success.

Recent Kernel

Using Ubuntu 20.04 I could not solve the reconnection issue, even when applying the correct configurations. I could not install mainline kernel 5.12 so I updated to 20.10 and then to 21.04. Only when I reached 21.04 the gamepads started to work. Ubuntu 20.10 was not sufficient!. I then installed mainline kernel 5.12 and the gamepads still worked.

Configuring Bluetooth

On the configuration side the following has to be added to /etc/bluetooth/main.conf in section [General]:

Privacy = device
JustWorksRepairing = always
Class = 0x000100
FastConnectable = true

Maybe setting Privacy = device is enough, but I did not try that.

xpadneo

Finally, xpadneo has to be used. Since I use Kernel 5.12 I make sure to use a version of xpadneo that includes commit f17a4e.

Reboot and Repairing

When I migrated from Ubuntu 20.04 to 20.10 and then to 21.04, the gamepad started to work once I arrived. When I reapplied the steps here, I had to repair again after I applied all three steps. In case of trouble, try to reboot and then to repair.

If the above steps cannot resolve the connectivity problem, maybe the resources that helped me can help you too:

  • https://boilingsteam.com/the-series-x-controller-on-linux-a-bit-of-a-hassle/
  • https://github.com/atar-axis/xpadneo/issues/166

Please note that the XBOX Series X|S is known to occasionally reconnect. This will not be resolved by this guide.