XINIT / Wine64 / PC game .exe help launching from within RetroPie
-
I absolutely hate asking question or asking for help, I basically try to painfully figure it out myself and it entirely possible that this question is on and been answered, somewhere (O.o) but ... here we go.
I'm going to try to give as much details as I can, because I know many of you will ask... something.I have a copy of RetroPie installed. I have the desktop installed using KDE.
I successfully installed box64 and wine64 and the work perfectly within the desktop.
I installed a PC game (setup.exe) within wine and it works and uses a controller while in the desktop.
my objective it trying to implement that into the RetroPie GUI. as many of you know you cant just execute a wine app from within the RetroPie by default because most of the time it requires a desktop environment.
so I have created a .sh file for that particular PC game:
#!/bin/bash
#starting an app with x server xinit
xinit /usr/local/bin/wine /home/pi/.wine/drive_c/'Program Files (x86)/Game/game.exe -- :1 -nolisten tcp vt9saved, then chmod'd: chmod +x game_wine_launch.sh
to execute sudo ./game_wine_launch.sh
and it works and loads the game perfectly by basically creating is own vm just for that app and exiting works, just select "exit to windows" and it exits the xinit/xserver and goes back out.what I'm having trouble with is the syntax to add it to retropie and launch correctly.
there are 3 places to edit.
/etc/emulationstation/es_systems.cfg (the only concern here is the runcommand.sh)
but also the /opt/retropie/configs/pc (the concern here is the emulators.cfg file)
the third is the .sh file in the roms/pc folder itself. I have the one I created above that works by manually launching it, but not sure how the other 2 files need to be edited to make it all sync and be happy.es_systems.cfg <command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 SYS pc %ROM%</command>
when running that, says no config found. I have a blank emulator.cfg file and typically it'll have the emulator and then the default=emulator (not sure what the syntax should be here) wine I assume, but what do I need to remove fromt the created .sh file and add here or remove and add, etc.or do I just add a command directly in the es_systems.cfg like <command>sudo ./ %ROM%</command> but when I do this, it says sudo command does not exist
I've seen some other execution files that seemed to have been manually created on other images, that are under /opt/retropie/supplementary/app_name_here (instead of going into the runcommand folder)
Details: Raspberry Pi 5 (8GB model), active cooler, booting from NVMe (Pineberry hat via ribbon cable to PCIe port) on 2TB NVMe hard drive (Kingston), Debian bookworm OS (up-to-date current), Raspberry Pi official power supply.
-
@RetroGamer81 does it work without
sudo
? Just./game_wine_launch.sh
then. Everything that EmulationStation does is meant to be ran with only regular user privileges.I think, if you have a
.sh
file (that works withoutsudo
), then you can just drop it in theroms/pc
folder and it should "just work."Likewise, the
roms/ports
folder should also work, but you'll need to have installed at least one port through the setup-script, to activate the "ports" system (it looks like you already have a "pc" system configured.) -
Create a X11 enabled 'emulator' command in
pc/emulators.cfg
:xinit-script="XINIT-WM:bash %ROM%" dosbox = "bash /home/pi/RetroPie/roms/pc/+Start\ DOSBox.sh %ROM%" ...
then copy your
.sh
launching script to thepc
folder. When starting the game, use theruncommand
launch menu to choose this 'emulator', which will automatically:- start x11 and a minimal WM for you
- disable screen blanking
- start your script
NOTE:
-
modify your
.sh
and remove any commands that start X11 and leave just the command needed to start the game (i.e./usr/local/bin/wine /home/pi/.wine/drive_c/'Program Files (x86)/Game/game.exe
probably). -
make sure you have installed the
matchbox-windows-manager
packge, I assume you already have the Xserver packages installed. -
stop using SUDO to start the games ! If you find yourself needing to do that, then you're doing something wrong.
-
@mitu thank you for the information and I appreciate the reply.
I did get it to work finally.
and I did have to use SUDO. yes typically pi user does not have to use sudo, but the xinit command does require elevated privileges.
so I'm not technically loading the game with sudo, just the application xinit. -
@RetroGamer81 said in XINIT / Wine64 / PC game .exe help launching from within RetroPie:
and I did have to use SUDO. yes typically pi user does not have to use sudo, but the xinit command does require elevated privileges.
No, it doesn't. RetroPie uses it (
xinit
) to start various ports andsudo
is not used at all. -
@sleve_mcdichael thanks for the replay. when I don't use sudo, which typically you shouldn't have to with retropie, however when using xinit command, it says "permissions issue"
I did finally get it to work and I'll post it below when I get a chance. I also made a video on my YouTube channel.
-
@mitu I'm .. sure I'm not using it or setting it up appropriately.
- I'm not using the runcommand.sh file that is for launching game in retropie.
- i'm sort of bypassing that, because I couldnt figure out the process or syntax
first, when you are just on the command line area (No Desktop) to initiate xinit, you must use sudo, but that doenst mean that retropie itself doesnt take care of that in some ... manner.
anyway, heres my commands.
the game's .sh file reads:
xinit /usr/local/bin/wine /home/pi/.wine/drive_c/game_path/game.exe
Next: es_systems.cfg file reads:
<command>sudo %ROM%</command>
thats it and it works.
I tried for hours to get the normal:
<command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 SYS pc</command> to work, but it wouldn't load, but also requires a config file.so in the /opt/retropie/configs/pc
i created emulators.cfg file, but what do i put in there?
pc = wine ?
default = pc
and if so, what do I change the game.sh file to? it already has the wine command in it.my main reason for creating this thread, was to figure out the syntax for 3 files.
/home/pi/RetroPie/rom/pc/game.sh
/etc/emulationstation/es_system.cfg
/opt/retropie/configs/pc/emulators.cfgI've been working with the retropie software since 2015 when i got my first raspberry pi 2, but I've never tried this type of launch and its not easy to find the details about this type of functionality.
thanks for listening. :)
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.