63

I have a Microsoft XBOX 360 gamepad with the wireless adapter and I was wondering what I would have to install to use them with Ubuntu I do know that when using this on Windows I have to manually install the drivers for the wireless receiver (if that is relevant.)

2

11 Answers 11

46

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:

enter image description here

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. enter image description here

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:

6
  • How can I make these changes permanent when using steam-login? Oct 1, 2013 at 21:19
  • 2
    I created a PPA to get this working in 14.04 (some minor differences). Additionally this PPA marks xpad as conflict, properly removes broken configs at install, and creates a System Settings entry called "Joysticks". Check here: launchpad.net/~rael-gc/+archive/ubuntu-xboxdrv Apr 15, 2014 at 20:08
  • 1
    The expect fork is not required (and, when required, it should be placed first then the command). Apr 18, 2014 at 14:23
  • In order for xboxdrv to start in daemon mode, you may have to add a rule to dbus (see here: github.com/Grumbel/xboxdrv/issues/42)
    – TimothyP
    Jan 23, 2015 at 6:06
  • xboxdrv doesn't find my wired joypad :( Jun 30, 2017 at 13:22
22

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.

2
  • 3
    Nothing I found could get my XBox 360 Wireless Receiver to work in Linux Mint 17.1 until I did this, then suddenly I saw my controller sync in front of my eyes for the first time in Linux. Thank you so much for this!!!
    – acejavelin
    Oct 2, 2015 at 22:00
  • 3
    +1 because this makes life so much easier
    – user383919
    Apr 3, 2016 at 1:10
16

Finally solved it. Just type in this in the Terminal

sudo apt-get update
sudo apt-get install xboxdrv
xboxdrv --silent &

and then press ctrl+c

and done you just installed Xbox driver and you're all ready to use your Xbox 360 controller :D. I guess when everyone says the controller is a Plug&Play and it does not then you have to install the necessary drivers to use it.

1
  • And then install jstest-gtk either via a following "sudo apt-get install jstest-gtk" or it can also be found via the Ubuntu Software Center. Unfortunately the whole XBOX package and some kind of GUI/test program has not been submitted to the software center.
    – Tony Wall
    Jun 11, 2014 at 22:38
12

UPDATE: This is not required for Kernel 4.2 (maybe 15.10 or 16.04) and higher. This Bug has finally been fixed: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1272765.

If you have problems with blinking LEDs just add this ppa and install the fixed xpad kernel module from SteamOS. Thanks Valve!

sudo add-apt-repository ppa:mdeslaur/steamos
sudo apt-get update
sudo apt-get install steamos-xpad-dkms

This updates the xpad module in Ubuntu, so you do not need xboxdrv.

2
  • Oh my God it stopped blinking I love you
    – Pitto
    Jan 25, 2016 at 13:36
  • 3
    out of date. no longer available. please remove answer
    – tatsu
    Dec 4, 2018 at 12:59
9
+50

This is an update to existing answers for a way to get an XBox360 controller working in Wine >= 1.7, including Steam games in Wine on Ubuntu >= 13.10. No root permissions needed for installation and operation.

The below method makes use of x360ce.exe, which basically provides Dinput codes for Wine to communicate with a game (Note that your XBox controller still sends Xinput controls).

  1. Plug in your XBox360 (or compatible) controller to have it automatically recognized with the xpad kernel module.

    No need to install and run xboxdrv because at present the controller appears to be recognized. Do not blacklist the Xpad kernel module as was recommended in older tutorials.

  2. Download the ZIP archives for the Windows (Wine) application x360ce and its accompanying .dll binaries for Xinput, and Dinput.
  3. Extract the ZIP archives to copy their content with at least the following files to the game's executable directory (e.g. ~/.wine/drive_c/Programs/Games/game.exe or ~/.wine/drive_c/Programs/Steam/SteamApps/common/Name_Of_Game/game.exe):

    • x360ce.exe
    • dinput8.dll
    • xinput1_3.dll

    some games may also need:

    • xinput1_9.dll
  4. Run x360ce.exe with Wine to create a sample x360ce.ini file in the game's directory if not yet present.

  5. Quit x360ce.exe (you may have to kill Wine to do so as the application may hang)
  6. Open the x360ce.ini file with an editor to add the following line to prevent future crashes or hangs:

    Version=1
    
  7. Start x360ce.exe again to recognize your XBox controller(s).

  8. We may optionally choose from a premade setup file as soon as the controller was recognized.
  9. Adjust buttons and joystick axes of your controller to appropriate values.

    >*<sup>Screenshot follows</sup>*

  10. Save saves these settings to the xbox360ce.ini file

  11. Then quit (or kill) x360ce.exe
  12. If needed open the x360ce.ini file in an editor again to fine tune some of the settings.
  13. Your Windows game should now recognize the controller when started from Wine.
  • Do not unplug the controller, as it will then only be recognized after a restart of the game.
  • Backup the .ini file for future use to avoid re-calibration.
4

I am not sure what you have tried, so let's try official instructions first. Please open a terminal(search for it in the dash) and type the following commands, one by one(no need to copy the output):

sudo add-apt-repository ppa:grumbel/ppa
sudo apt-get update
sudo apt-get install xboxdrv
sudo apt-get install xboxdrv-stable 

Reboot, and your wireless receiver should be recognized.

Note that unfortunately, there isn't a 12.04 package for xboxdrv-stable. You may consider contacting contacting the package maintainer, assuming you have a Launchpad.net account. Still, try using the software that needs the driver.

0
2

Just as an unrelated side note, the error you were seeing with your makefile was due to the fact that makefiles use tabs for indentation and likely when the file was copied those tabs were changed to spaces.

1

You don't need to install anything, the kernel has a build in driver. Just plug the wireless adapter into USB and sync the controller. xboxdrv is only needed if you want additional configuration options, button remapping, mouse emulation, etc.

3
  • this is simply not true, not working on 12.04 or 13.10
    – Calin
    Aug 14, 2013 at 15:23
  • Not work where? In like 99% of the cases it's an issue with the game, not the controller or the driver. The xpad kernel driver has been a standard part of Ubuntu for quite a few years.
    – Grumbel
    Aug 15, 2013 at 10:33
  • xpad is really bad with the wireless version of Xbox360 gamepad. The wireless adapter is recognized as the first joypad, and the joypad as the second. And a lot of games have no configuration to change which joystick to use. And, in some Ubuntu versions (like 12.04) the led in the gamepad don't stop blinking. Apr 16, 2014 at 1:41
0

That's old stuff. It should work as soon as you plug it in, if the game is compatible. I think if the game expects an xbox controller (i.e not a generic one) in Wine then it's not likely to work. Native games should work. It's listed as a project for Google Summer of Code so it's on the agenda.

6
  • Damn the games not compatible -.- . I just tested it on an emulator and it worked...but not on wine :( May 26, 2012 at 11:12
  • Wait it does works!!!. I tried Underground 2 on Windows and the Xbox controller works, then I try the controller in Ubuntu U2 and it doesn't :( whats wrong? May 26, 2012 at 11:24
  • I think if the game uses xinput , it won't work. what is u2?
    – daithib8
    May 26, 2012 at 11:30
  • A short for Underground 2 ;) May 26, 2012 at 11:35
  • OK so that's a Wine game.
    – daithib8
    May 26, 2012 at 14:18
0

I'm running Linux kernel version 4.0.0 and needed to install nothing and configure absolutely nothing to play games with my XBOX 360 controllers. Even linux-native couch co-op games that require more than one controller like "lovers in a dangerous spacetime" or "trine" worked out of the box. Just plugging in the two controllers and done.

0

The yank-decoupler part of my controller wasn't plugged all the way in. That was all my problem was.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .