Setting Up Udev Rules in Mint 18 for X-Plane 11

Get your throttle, flight stick, and rudder pedals set up using our handy step-by-step guide
gamereleasedate: 
Sunday, March 11, 2018 - 5:15pm
While it may seem like a pain - especially for newer users who may not be entirely familiar with the terminal or Linux in general - it's really quite easy to set up your udev rules appropriately, provided that you follow these simple steps.

Intro:

If you want the real flight-sim experience in X-Plane 11 in Linux, you're going to need two things: good hardware (I recommend either the Thrustmaster T.16000M HOTAS throttle and flight stick combo, or the Thrustmaster Warthog HOTAS system, and use the CH Products Pro Pedals for my rudder pedals) and udev rules to grant permissions for those input devices to be used and recognized by your *Nix-based OS. So let's get straight to it.

Steps:

  1.  plug in your new hardware
  2.  use sudo lsinput to find the vendor and product ID of your new hardware
  3.  create a new udev rule in /lib/udev/rules.d (NOTE: this works for Mint 18; other distros have different places where they store their udev rules
  4.  reload your new rules using udevadm control --reload

1: Plug In Your New Controllers:

Plug them into your USB ports, disconnecting old controllers as needed/desired.

2: Get the Vendor Id and Product ID of Your Controllers:

-open up a terminal, and with your devices connected, run (using either sudo or as root) and enter:

lsinput

-this should print a long list of attached input devices; scroll up through the results to find the listing for each controller you want to add. What we want are the vendor and product ID's of (in my case) our Warthog Throttle, our Warthog Flight Stick, and our CH Products Pro Pedals.

-Write these numbers down (the product ID, the vendor ID, and the device name) on a sheet of paper like this:

Throttle:

Product ID 0x404

Vendor ID 0x44f

Flightstick:

Product ID 0x404

Vendor ID 0x44f

CH Products Pro Pedals:

Product ID 0x0f2

Vendor ID 0x68e

-You will need these when creating your new udev rule file.

3: Create Your New Udev Rule:

- On Mint 18, the udev rules are stored in /lib/udev/rules.d but this may vary according to your Linux distribution.

- As root, in a terminal:

cd /lib/udev/rules.d

- Udev rules control the permission system for input devices. All the files in /lib/udev/rules.d are prefixed with a number, and are loaded by the OS in order of lowest prefix to highest. For our purposes, we are going to create a file called "99-X-Plane_11_Joystick.rules" so enter the following command to create that file and begin editing it in nano:

nano 99-X-Plane_11_Joystick.rules

- You should now be in nano (or vi, or whatever text editor you prefer) with an empty file in front of you. This is where we add the actual rules for each one of our devices, one per line. Don't panic, though: the basic format is simple:

#Pro Pedals KERNEL=="event*", ATTRS{idProduct}=="00f2", ATTRS{idVendor}=="068e", MODE="0666"

- The only things you need to change are the highlighted values. Plug in the corresponding Product and Vendor ID's in their respective places, just like above. If either of these values for that device begin with "0x," simply omit the "x" when plugging in the values.

- So, for instance, my lsinput told me that my Warthog Throttle has Product and Vendor ID as follows:

/dev/input/event9

bustype : BUS_USB

vendor : 0x44f

product : 0x404

version : 273

name : "Thrustmaster Throttle - HOTAS Wa"

phys : "usb-0000:00:14.0-13.3.4/input0"

uniq : "" bits ev : EV_SYN EV_KEY EV_ABS EV_MSC EV_REP

-... which we then wrote down as:

#Throttle:

Product ID 0x404

Vendor ID 0x44f

-...and, because of the "0x" preceding the ID values we omit the "x" when plugging in the values into the entry, which leaves us with the following 2 lines in the file:

#Warthog Throttle

KERNEL=="event*", ATTRS{idProduct}=="0404", ATTRS{idVendor}=="044f", MODE="0666"

-You add one device per line, just as shown above (preferably, for sanity's sake, commenting the entry with the actual controller name on the line above the entry, preceded by a hash). If you have 3 devices you want to set up the udev rules for (as we do here; throttle, flightstick, and rudder pedals), your finished file should look something like this:

#CH Products Pro Pedals

KERNEL=="event*", ATTRS{idProduct}=="00f2", ATTRS{idVendor}=="068e", MODE="0666"

#warthog HOTAS Throttle

KERNEL=="event*", ATTRS{idProduct}=="0404", ATTRS{idVendor}=="044f", MODE="0666"

#warthog HOTAS FlightStick

KERNEL=="event*", ATTRS{idProduct}=="0402", ATTRS{idVendor}=="044f", MODE="0666"

-Once you've added all your devices and are finished editing the new rule file, press CTRL-X (if using nano as your editor), then "Y" to save the changes, and then Enter to leave the editor. Provided that you typed everything correctly (as shown above), you are now ready to reload your udev rules and see if they work.

4: Reload Your New Rules Using udevadm control --reload

-Once again, as root, enter the following command to reload your udev rules:

udevadm control --reload

-This may or may not work entirely perfectly, so, if you find that your controllers are still unrecognized by X-Plane 11's built in controller configuration/calibration page, you may need to reboot your system for them to take effect. If they still do not show up in X-Plane 11 after a restart, then you need to check for typos, and that you entered the correct Product and Vendor ID's in their respective places.

-After all that, you should be able to map your new controllers using whatever in-game controller configuration pages your games offer natively. All games (not just X-Plane 11) should be able to see and recognize and allow you to remap your buttons (game depending). The point is, once you get this right once for X-Plane 11, your controllers will be recognized by all other games you play via Steam - for instance, "War Thunder" should totally let you remap and use your new controllers, etc.

Conclusion:

While it may seem like a pain - especially for newer users who may not be entirely familiar with the terminal or Linux in general - it's really quite easy to set up your udev rules appropriately, provided that you follow these simple steps.

Resources:

You can watch a video of the unboxing of my Thrustmaster Warthog HOTAS system, along with a detailed step-by-step walkthrough of all the steps described above at:

https://www.twitch.tv/videos/237808519

Check out the X-Plane Linux Permissions Page at:

https://developer.x-plane.com/2012/09/linux-joystick-permissions/

-Seth "Fingers" Flynn Barkan is the author of "Blue Wizard Is About To Die," and is the host of the Best Linux Games Podcast, a weekly audio podcast covering only the best games available for the GNU/Linux Operating System. Which will own you, SUCKAH! (he can be contacted via twitter @Vegaswriter or by sending a message directly through Steam to "skookiesprite")