How to Make Linux Use an Xbox Controller
Linux is a basis for many operating systems that, unlike Windows and OSX, are free and highly customizable. Ubuntu, one of the more user-friendly Linux distributions, is one popular variant. Within Ubuntu, you can configure your very own Xbox 360 controller for use on your computer in just a few steps without the need for extra software.
Things You'll Need
- Xbox 360 controller
- USB adapter (optional, for older model controllers)
Instructions
-
-
1
Open the Menu bar and find "Terminal." Open it and type in the following:
sudo apt-get install linux-headers-`uname -r` build-essential automake1.9
Hit "Enter." This will compile and install necessary drivers and packages.
-
2
Type in the following the in same Terminal window:
sudo apt-get install jscalibrator libgii1 libjsw2
Hit "Enter."
-
-
3
Enter the following in Terminal:
cd
mkdir xpad
Hit "Enter." This command will create a directory for the module that will allow you to use your controller in Ubuntu.
-
4
Paste the following into Terminal:
cd xpad
wget "http://Xbox-linux.cvs.sourceforge.net/*checkout*/Xbox-linux/kernel-2.6/drivers/USB/input/xpad.c" "http://Xbox-linux.cvs.sourceforge.net/*checkout*/Xbox-linux/kernel-2.6/drivers/USB/input/xpad.h"
Hit "Enter."
-
5
Navigate to the Menu bar and find "Text Editor" or a similar program. Paste the following into the file:
KERNEL_PATH?=/usr/src/linux-headers-$(shell uname -r)
EXTRA_CFLAGS=-I$(shell pwd)
obj-m:=xpad.o
all:
$(MAKE) modules -C $(KERNEL_PATH) SUBDIRS=$(shell pwd)
install:
cp -f xpad.ko /lib/modules/$(shell uname -r)/kernel/drivers/input/joystick
Save the file and name it "Makefile."
-
6
Enter the following into Terminal:
make
sudo make install
sudo modprobe -r xpad
sudo depmod -a
sudo modprobe xpad
Hit "Enter." This will compile the controller module. If an error message is displayed, please review the steps and make sure you did not miss anything.
-
7
Connect your controller to your computer via USB. Open Terminal and type "dmesg" and hit "Enter." A description like "Xbox 360 Controller" should appear. If so, you are done.
-
1
Tips & Warnings
This method is written for Ubuntu but should work in similar fashion for other Debian-based distributions.
References
- Photo Credit Jupiterimages/Brand X Pictures/Getty Images