A couple of days ago, I was enquiring with a certain WINE developer the state of controller support in WINE. I was surprised they were actually working on a native solution, yet not shocked to hear that for now, a tool like x360ce.exe was probably one’s best bet. The thing is, there is a lack of a good tutorial out there on how to make things work from A to Z – sure, you can find piece-by-piece info across several sources, but I thought it may be useful to have the whole process detailed for everyone who’s interested to do that. I have replicated with success the same process three times on different machines, all running Ubuntu derivatives (Mint 17.3 and Mint 18) so it should probably work on any Ubuntu-based distro. So here we go.
Part A: Making this %!”# x360ce work in the first place
First, open a terminal and run the following commands to get the latest version of wine-staging. This may not be 100% required, but in my experience older versions of WINE like 1.6 cannot run x360ce properly (crash at startup, even with the required .NET libraries).
sudo add-apt-repository ppa:wine/wine-builds && sudo apt update sudo apt install wine-staging winehq-staging
We also want to make sure we have a recent version of xboxdrv instead of using the generic xpad driver:
sudo apt-add-repository -y ppa:rael-gc/ubuntu-xboxdrv sudo apt update sudo apt install ubuntu-xboxdrv
At this stage xboxdrv should be up and running (automatically). Now plug your Xbox360 dongle in a USB port, and power up your Xbox360 pad. It should be recognized and assigned the first player’s pad.
Now on to the real stuff. The next step is about getting a 32 bits prefix where we will run x360ce.exe in the end.
WINEPREFIX="$HOME/prefix32bits/" WINEARCH=win32 wine wineboot export WINEPREFIX="$HOME/prefix32bits/"
We are going to install .NET 45 in that particular prefix. This is required as x360ce needs this framework to create its windows and menus. Note that the last command below starting with the “bash” statement takes a long time (probably a good 10 mins) but it has the advantage to be fully automated and does not require any user input (you obviously need to be connected to the Internet). Easy. Just go grab a coffee.
cd $HOME/prefix32bits/ wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks bash winetricks -q dotnet45 corefonts
Now on to getting x360ce and unzipping it:
wget http://www.x360ce.com/Files/x360ce.zip && unzip x360ce.zip
We are almost done!
You just need to run x360ce next:
If everything went as expected the window should now appear and let you edit the pad settings. It will first ask you for xinput1_3.dll, and kindly create it for you since you don’t have it. Awesome!
Next you may get some internet-based updates, accept them.
Now on to the pad controls: just go ahead and edit each button and axis using the “record” dialog proposed on each menu item – that way you can just click on the button to have it mapped correctly.
Once you think your mapping is correct, just try moving your analog pads in all directions and clicking the buttons – they should be highlighted on screen when you do so, to confirm everything is working as expected.
Once you are satisfied, hit the “save” button at the bottom. This will create a x360ce.ini file in the very same folder.
If you need to change the configuration again (any fix required for the mappings, for example…) note that in my case having the previous x360ce.ini file in the folder makes it impossible to edit the settings anew:
if this happens to you too, just rename the existing x360ce.ini file to something else or erase it altogether, and this will show the mapping editor again. No Big Deal.
Part B: Using it with WINE-based games
Go back to your prefix32bits folder, and now you just need to copy:
…into any WINE game folder where the game binaries are (the ones triggering the launch of the game). Make sure such games are on a 32 bits WINE prefix though, if not things will crash.
So let me give you an example with the GOG, Windows version of Enter the Gungeon here. Yes I know we have a Linux version of this game, but this is not the point – this is just a proof of concept. You can use for example PlayOnLinux to install this version, and click on “Configure” – and then click on the “Miscellaneous” tab:
As you can see you can directly open the program’s directory there, and this is where you will put the 3 files I mentioned above. Yup, just dump there in that folder.
Now you close that configuration window, launch the game, and lo and behold, the controller is recognized. This is me below playing the Windows client with the controller using x360ce. The framerate is shit because I run the game on my laptop and I recorded the video with OBS on top, so this looks much smoother in reality.
You can see the game recognizes the controller as the control hints use the xinput buttons instead of keyboard shortcuts. And yeah, obviously, there’s no point using this solution for EtG as there is already a perfectly working Linux client, but I wanted a game that my laptop can run correctly for such a demo.
Part C: Profit !? I mean… Enjoy!
Just repeat only the step B for any other game. Even if they are not installed under PlayonLinux. Keep the original prefix only for the times where you’d like to change the settings again. Otherwise you don’t have to worry about it, just copy the three files mentioned every time and you are good to go.
Let me know if this worked just fine for you, especially if you tried on non-Ubuntu-based distros (in that case you can’t use the ppa I refered to, but you may compile such libraries from source or find relevant packages for your distro).
BoilingSteam lets you access our content for free, but writing articles is a constant investment. We don't use ads or sponsporship, help us make our activities sustainable by donating via LiberaPay. You can follow what we do via our newsletter, our RSS feed, our Mastodon profile or our Twitter feed. We also have Peertube and Youtube channels. If you'd like to chat, you can also find us on #boilingsteam:matrix.org.