Tutorial: How to Connect the Xbox 360 Controller to Ubuntu



tutorial logo



If you follow this blog, you know that we already wrote a tutorial explaining how to connect the Xbox 360 controller to Windows. This time, we will explain how to connect the Xbox 360 controller to Ubuntu, but it is probably similar to other Linux distributions. By the way, it would be good if you read our Xbox 360 wireless receiver review, where you will know more about the Xbox wireless receiver before reading this tutorial.

Case you still do not have a Xbox 360 wireless receiver, you can buy it on Chinabuye for about $10.



What are the requirements?

Since kernel 2.6.26, official Ubuntu already comes with the xpad module, so the Xbox 360 wireless receiver should work as you plug it on a USB 2.0 port. However, to avoid compatibility problems and to ease the use/configuration, we recommend an alternative driver to connect the Xbox 360 controllers. Also, there are tools on the package "joystick" to test and calibrate the Xbox 360 wireless controllers, however we recommend to you use an alternative solution (explained below) since it is easier to use and has more compatibility with receivers (this one worked fine).

The complete list of requirements that must be satisfied before proceeding on the tutorial are:

  • Install some required packages.
  • You must have at least one Xbox 360 wireless controller.
  • You must have one Xbox 360 wireless receiver.
  • Your PC must have one USB 2.0 port ready to be used.


Installing the required packages

To install and configure the required packages to use the Xbox wireless receiver with wireless controllers, follow these steps:

Step 1: Open the terminal (Ctrl + Alt + T).

Step 1.1 (optional): To check if the Xbox wireless receiver is connected to a USB 2.0 port, run the command

       lsusb

It should show, besides other things, something like this:

       "Bus 002 Device 006: ID 045e:0291 Microsoft Corp. Xbox 360 Wireless Receiver for Windows".

Step 2: Run the following command

       sudo apt-get install --install-recommends jstest* joystick xboxdrv

Wait until the installation of the required packages be completed. Now you are able to use the Xbox 360 controller on Ubuntu (Steam games, emulators or native games), however you must connect the Xbox 360 wireless controller to the wireless receiver (check the following section). Case you are experiencing problems (mapping or no-detected button), we recommend that you configure the controller.



How to connect the Xbox 360 controller to Ubuntu

Now that the Xbox 360 wireless receiver is installed and plugged, your next step is connect your wireless controller to the receiver. For that, do the following:

Step 1: Turn on the Xbox 360 controller (press and hold that GUIDE button in the center).

Step 2: Press and hold the button on the receiver (its light will start blinking).

Step 3: Press and hold the connect button on the top of the Xbox 360 controller.

Step 4: Wait until the light on the controller keeps blinking slowly (probably a bug on Linux).

After that, you will be able to use your Xbox 360 wireless controller on Ubuntu (and probably on others Linux distributions).

Just to improve the understanding, watch the video below showing how to connect the Xbox 360 controller to Ubuntu to play a Super Nintendo (ZSNES emulator) game (Alladin).



Configuring the Xbox 360 controller on Ubuntu

The packages installed early have an useful tool to help you configure your Xbox 360 controller, including remap function and a detection screen (it shows what you press). To access it, run the following command on terminal:

       jstest-gtk

It should show a window with four joysticks (see image below) even if you are connecting only one controller.

ubuntu xbox 360 controller joystick xboxdrv
Image 1: List of Xbox 360 controllers

Just select the first one on the list (configuring for player 1) and then click on "Properties". Now you have a new screen where you can test left stick, right stick, d-pad and the buttons. Also, if you are experiencing inverted buttons problem, or if you just want to remap buttons, there is the option "Mapping".

ubuntu xbox 360 controller joystick xboxdrv
Image 2: Tool to test and calibrate the Xbox 360 controller

Any question or suggestion, please use the comments section below.

10 comments:

  1. Sorry to ask, but when I followed the steps and went to calibrate the controller, mine only has 6 axis not 8 like it says on your video. Is there something I need to do?

    ReplyDelete
    Replies
    1. @Anonymous,

      and there is only one joystick in the list (image 1)?
      After entering in "Properties", left and right analogs work properly? What about RT and LT, they are also working in analog mode (like in the video)?
      Even is written 6 axes, if the analogs are working properly and the buttons too, then no need to worry.

      Delete
  2. after typing sudo apt-get install --install-recommends jstest* joystick xboxdrv, i got a response saying: unable to locate package jstest, unable to locate package xboxdrv. help!

    ReplyDelete
  3. Anonymous,

    try to add the required repository by typing the following command:

    sudo add-apt-repository ppa:grumbel/ppa

    Then, try the commands from the tutorial again.

    ReplyDelete
  4. what if i'll be using a wired xbox 360 controller? does the same commands apply?

    ReplyDelete
    Replies
    1. I didn't test but I think so. There are other tutorial on Internet that show the same commands for wired Xbox 360 controller.

      Delete
    2. sir, i tried doing this:

      try to add the required repository by typing the following command:

      sudo add-apt-repository ppa:grumbel/ppa

      but i still got the same response:

      E: Unable to locate package jstest*joystick
      E: Couldn't find any package by regex 'jstest*joystick'
      E: Unable to locate package xboxdrv

      Delete
    3. There is a space between "*" and "joystick", which I think you didn't type above (at least).
      I don't know much about Linux commands, but maybe there is one capable of listing the folders of a repository. You could try that if the repository was added successfully.
      By the way, which Linux distro and version are you using?

      Delete
  5. can you use the controller on minecraft?

    ReplyDelete