How do I get an XBOX 360 controller working?
Solution 1:
If you find difficulties running your XBOX 360 controller, then this will help you install it on a computer running Ubuntu, and also show you how to configure it. These instructions are workable for both wired or wireless X-Box 360 controllers.
Getting Started
To be able to use your Xbox 360 wired/wireless controller under Ubuntu 12.04 (Precise Pangolin), you need first to install some required packages.
Open the terminal and run this command:
sudo apt-get install --install-recommends jstest* joystick xboxdrv
You also need to ensure that xpad is not getting loaded:
echo "blacklist xpad" | sudo tee -a /etc/modprobe.d/blacklist.conf
sudo rmmod xpad # unload module if already loaded
Then run the xboxdrv:
xboxdrv --silent
Configuring the pad
Connect now your game controller to your PC via USB (wired) or connect your XBOX 360 PC wireless gaming receiver for your wireless controller, then run this command to start the configuration:
jstest-gtk
In the window that shows up, select your controller (Microsoft X-Box 360 pad, Generic X-Box pad, etc.) and click Properties:
Note If your controller is not listed, try to click the "Refresh" button.
A new window will pop-up which will help you calibrate your gaming controller, remap the buttons of your game controller (changing the order of axis and buttons), etc.
After you finish your configuration, save your new settings and close the window. You will be able now to use your Xbox 360 controller to play games under Ubuntu.
Configure xboxdrv to start at boot
If you're making a dedicated machine or want to ensure that xboxdrv is loaded on startup you can do this:
First create an upstart job:
sudoedit /etc/init/xboxdrv.conf
and in there add the following contents:
start on filesystem
exec xboxdrv -D
expect fork
This will ensure xboxdrv is started on boot.
Sources:
- upubuntu.com
- Jonas Wagner
Solution 2:
Ubuntu 14.04, 15.10, 16.04:
I created an PPA to install and create a proper daemon for xboxdrv
in 14.04 and above.
Additionally this PPA will cleanup broken config, mark xpad as conflict (stop it if necessary), start the xboxdrv daemon and create a "Joysticks" entry into System Settings.
To install it, run in a terminal:
sudo apt-add-repository -y ppa:rael-gc/ubuntu-xboxdrv
sudo apt-get update
sudo apt-get install ubuntu-xboxdrv
PS: I cloned the package to other releases and even changed it to work with systemd
.