A Step-by-Step Guide to Make Controllers Work in WINE

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:

wine x360ce.exe

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!

dllrequest

Next you may get some internet-based updates, accept them.

internet

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.

x360ce-window

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:

blankscreen

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:

  • xbox360ce.exe
  • xbox360ce.ini
  • xinput1_3.dll

…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:

gungeon

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.

0 0 vote
Article Rating
Subscribe
Notify of
guest
60 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Lf

What about steam controller? Did you own one to test?

Martin

https://github.com/kozec/dumbxinputemu

You can also use dumbxinputemu, where you just paste a DLL into the game folder and you can use sc-controller to emulate xbox 360 controller, and everything should work.

https://github.com/kozec/sc-controller

Adam

There was one vital fact missing from these instructions: xinput1_3 needs to be set as “native” in winecfg (I set “xinput8” to native too but I’m not sure if that was necessary).

Adam

I get this behaviour with 2.0rc2 and rc3. I guess the behaviour must have changed? Though it was the first suggesting from people on IRC once I described my issue fully.

NRG

Yes I confirme what Adam written about “xinput1_3 needs to be set as “native” in winecfg” I used Wine for macOS (through Wineskin’s wrapper) with my 360 controller since various years with the x360ce.ini an xinput1_3.dll but since wine 1.9.23 was released, this method stopped to work…probably due to some change comming with the HID bus support for MacOS as you can read on the changelog: https://www.winehq.org/news/2016111101 Now thank to Adam and his comment I can run again my 360 controller also with lattest engines… PS: For MacOS user: the procedure for x360ce with wine is the same of this… Read more »

Amelia

I keep getting this error when using terminal:
-bash: wine: command not found

(I am also on MacOS)

Amelia

Yes, and wineskin

Amelia

Please help if you can :/

NRG

Maybe the trick doesn’t work with all games… I just tried on my macOS wineskin’s wrapper of “Ori And The blind forrest” and gamepad doesn’t run with wine 2.0 (also if I set xinput1_3 as native through winecfg) while it works with previous wine engines and the same game…
I don’t know if depend that Ori is an Unity game…

NRG

new update:
the trick work again also with “Ori and the blind forrest” with wine 2.1 for developers… So it’s possible my previous faillure was determinated by wine-staging 2.0. I used to test xinput1_3 as native for Windows..

Adam Hirst

I’ve also have some issues based on whether or not I use xboxdrv, or the steamos-modified builds of xpad (for Arch users available in the AUR). Specifically, x360ce’s config tool happily detects a wireless 360 controller in all cases, but the resulting DLL/INI only actually worked when using xboxdrv (which makes no sense to me, as for other applications, using steamos-xpad looks exactly the same as with xboxdrv –mimic-xpad). Maybe I’ll investigate it later.

Adam Hirst

Not yet, I’m afraid. I’ve been, and am going to be, busy for a few weeks with studies and work, so I’ll probably not be following up anything bug-fix-y or troubleshoot-y unless it pertains to productivity. I’ll come back as and when I do have the chance, though!

Dukenukemx

Using Wine Staging 2.1 and I’ve tried this guide and the games don’t see to see the xinput1_3.dll file. Nothing I configure in x360ce is showing up in games. I can configure it just fine but the games see what Wine sees. T

Dukenukemx

I did that. I needed to cause if I didn’t the x360ce program wouldn’t see the controllers. Instead of the green boxes I saw grey. Then I would place the files in the directory of the game and run the game. But as far as I can tell, the game sees what Wine sees. Like something with a js at the end.

Steve

There is a native GTK3 app that I’ve used for 6+ months; I actually prefer it to the Steam UI config. It works for both running in Wine, Steam (without having to use the overlay), and I’ve also used it for Dolphin Emu. https://github.com/kozec/sc-controller I haven’t tested on anything other than Arch Linux, but there are packages from the OpenSUSE Build Service for other distros. Also, general PSA: (1) This specific site is listed with a warning on the Arch wiki https://wiki.archlinux.org/index.php/Gamepad#Steam_Controller (also good tips on SC in general) (2) Piping some HTTP blob to unzip is probably not the… Read more »

Dukenukemx

Ok I’ve tried and tried to get this to work on Mint 18.1, and I finally got it to work, but for only 1 game and that’s DuckTales Remastered. I’m also using Wine Staging 2.2.

This doesn’t work on Rayman Legends or Origins. Doesn’t work on Sonic Generations, and doesn’t work for ICEY. I’ve tried copying and renaming the xinput1_3.dll to xinput1_1.dll, xinput1_2.dll, and xinput9_1_0.dll. I don’t get why I’ve only gotten one game to work?

Adam Hirst

The first two things I’d ask would be
* Are you sure that these games support xinput?
* Did you make sure that you set the appropriate DLL override rules in winecfg (check all the other comments)?

Dukenukemx

I really don’t know about xinput. I thought this was universal for all games? I Google’d to see if there’s any guides for the Rayman games with X360CE and they do exist. ICEY is a relatively new game so nothing there. Sonic Generations does have guides for x360ce as well. Here’s a link to someone who’s playing Rayman on Wine and having issues with x360ce. https://github.com/x360ce/x360ce/issues/479 I did do the xinput1_3.dll as native in winecfg. Not sure if there’s anything else to add? I also tested Dark Souls and Dark Souls 2. Dark Souls 1 doesn’t seem to work, but… Read more »

Dukenukemx

Did a little testing and I think some games are just going straight to the system32 folder for xinput1_3.dll, or whatever xinput version they use. BTW anyone tested Rayman Legends & Origins to see if their xinput 1_3.dll works?

Adam Hirst

Are you absolutely sure that you’re putting the xinput DLL into the same folder as the game executable? It’ll only work then.

Dukenukemx

I asked the same question at Phoronix and people are saying this is a known issue since 1.9.24.

https://www.phoronix.com/forums/forum/software/linux-gaming/937351-wine-staging-2-3-still-tuning-direct3d-csmt

Anthony

“This is why I hate Linux:
“sudo: add-apt-repository: command not found”
Help?

Lotogard

I have encountered an error with the command bash winetricks -q dotnet45 corefonts.

I get the error that “Downloading https://web.archive.org/web/https://download.microsoft.com/download/3/F/0/3F0A922C-F239-4B9B-9CB0-DF53621C57D9/dotnetfx3.exe failed”

It seems like the requested page no longer exists in the web archive. What should I do about this?

Jarrard

I have a bizarre issue were the windows HID controller keeps remapping dragons dogma xbox buttons back to the 1-16 button icons.. So very weird, its like their fighting each other. No idea howto remove the driver in windows because there is no device manager.

Jarrard

Figured it out, was matter of overwriting gamepad1 and now its the only 1 that shows. There are options in x360ce for it you just need to experiment.

I still get the can’t write to the x360ce.ini file error each time I start the program, not sure what thats about.

Shane

Didn’t work:
wine x360ce.exe
fixme:winediag:start_process Wine Staging 2.4 is a testing version containing experimental patches.
fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org.
err:module:load_mscoree Failed to load mscoree.dll
err:module:attach_process_dlls “x360ce.exe” failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L”Z:\\home\\shane\\prefix32bits\\x360ce.exe” failed, status c0000142

JARRARD

Sounds like your missing the correct NET framework? maybe 1.1SP or 2.0 (I cant remember). In the end for Dragons Dogma I had to use a special library to lock out the other hide controllers so only 1 shows up, and because I’m using a dunput8 mode I had to edit the ini config for that mod to point to additional library dinput_8.dll which is from dinput8-x360cev21.zip which you can find floating abouts. You will still need to correctly setup xboxdev to map your joypad correctly, testing with a linux game like tomb raider is a good way to sync… Read more »

JARRARD

EDIT: by MODE I meant MOD from Nexus, and with dinput_8.dll I meant I renamed the dinput8.dll from the cev21 zip directory. I also use input9_1_0.dll from cev21, not sure if its needed, don’t forget to set Wine to Native, Builtin for dinput8 and input9_1_0…

Shane

I’m sorry but I didn’t understand a single bit of what you typed.

JARRARD

Well then I’m sorry to say but perhaps wine isn’t for you 🙂

Shane

Or maybe you didn’t explain things very well.

Shane

People like you are why I rarely ask for help online.

JARRARD

1st: I was giving a suggestion to resolving a problem, you should really know what Microsoft .NET framework is and should know that x360CE uses 1.1sp. 2nd: Comments were not directed at you (my reply was a general reply originally btw) and was just about how I got the controller working for games like Dragon’s Dogma which have a bad habbit of having controller fighting if you have more then one (menu’s etc can’t decide which controller is the real one so just flips in between them). Lastly you should be more specific on what you don’t understand if you… Read more »

Dugan Chen

Worth noting: you can use WINEDEBUG=loaddll to check which DLL needs overriding, whether the override is working.

Testing with XInputTest:

https://community.pcgamingwiki.com/files/file/588-directinputxinput-games-test-tools/

env WINEDEBUG=”loaddll” wine XInputTest.exe

(I’m using FISH, hence the “env”

I see:

trace:loaddll:load_builtin_dll Loaded L”C:\\windows\\system32\\xinput1_3.dll” at 0x7d8b0000: builtin

At that point, my gamepad is not working for that app.

If I override xinput1_3 to “native,builtin” and then try again, I see:

trace:loaddll:load_native_dll Loaded L”C:\\x360ce vibmod 3.1.4.1\\xinput1_3.dll” at 0x2cd0000: native

And then my gamepad starts working for that app.

Dugan Chen

I just got this working with Deathsmiles and Dodonpachi Resurrection, which are a bit hairy to set up. The procedures were: 1. copy x360ini, xinput1_3.dll, and dinput8.dll from the XInput Blocker to the game directory 2. In winecfg, override both dinput8.dll and xinput1_3.dll 3. In “wine control”, disable the gamepad whose name ends with “(event)”. The XInput Blocker is in the same place as XInputTest: https://community.pcgamingwiki.com/files/file/588-directinputxinput-games-test-tools/ And yes, it’s the event interface that needs to be disabled for these two games. I’ve found that if you disable the js interface instead, it doesn’t work. This is with an XBox One… Read more »

Dugan Chen

I assume everyone knew I meant the DIRECTInput Blocker and not the XInput Blocker?

Anyway, I just tried these exact steps with Rayman Origins (Steam). They did not get XInput working with it.

Rav Starburner

Everything has worked up until recording the controller input in x360ce. I am using an Xbox One controller, and have confirmed that I have input through jstest-gtk.
Help?

winedloverloader

Hi guys,

I found this to be useful when Left (LT) and Right (RT) triggers don’t show up on x360ce :

Run in terminal before launching x360ce.exe:
xboxdrv –detach-kernel-driver –mimic-xpad

Dugan Chen

I’d also like to know which game controller winedloverloader found that to be needed for.

Heads up, by the way, that I’ve written a guide of my own. It’s here.

https://www.linuxquestions.org/questions/linux-games-33/howto-getting-steam-wine-game-controllers-working-together-4175618012/

winedloverloader

An Xbox360 controller is the one in question, works well with Steam on its own but LT and RT didn’t show up on x360ce without the “–mimic-xpad” switch.

Thanks Dugan for the heads up, looking forward to checking out your guide.

Thanks to Ekianjo for the current guide. Saved me from mounting frustration to be sure.

Dugan Chen

If it’s an Xbox 360 controller, then use dumbxinputemu instead of x360ce. It (dumbxinputemu) works the same as x360ce, except that instead of needing configuration, it has hardcoded settings that are correct for Xbox 360 controllers.

https://github.com/kozec/dumbxinputemu

winedloverloader

I did this on Calculate Linux 17.6, adding the “–mimic-xpad” switch got LT and RT to show up.

Dugan Chen

I just tested WINE 3.3’s new SDL2 support, and it looks like none of this is really needed now.

I set my SDL_GAMECONTROLLERCONFIG string for my DualShock 4.

When I ran XInputTest in WINE, it detected my DualShock 4 as XInput, with the controls mapped correctly.

When I fired up Ducktales: Remastered, it also detected my DualShock 4 as XInput, with the controls mapped correctly.

In neither case was any further configuration needed. I did not need to swap out DLLs or even to disable a device (js or event) in “wine control”. It just worked.

ROb

Sorry to ask noob question as i have only started using wine recently how would i set sdl_gamecontrollerconfig

Dugan Chen

It’s SDL_GAMECONTROLLERCONFIG. All caps.

And it was covered on this very blog:

https://boilingsteam.com/making-third-party-gamepads-work-with-steam-games/