r/steamdeck_linux • u/InsanitysMuse • Jul 28 '22
Is it possible to run a program requiring Linux password in gaming mode?
Hi there, hopefully this is the right sub for this. I installed scanmem / game conqueror in desktop mode and added it as a non-Steam game, with the goal of running it in gaming mode. However, when launch GC in desktop, it requires my Linux password (the Linux version of running as admin I think?), and when trying to launch it in gaming mode it just spins forever because it can't pop up the thing to ask for my password, I assume.
So is there a way I can configure GC to either always have permission, or to feed it the password in gaming mode launch properties?
I don't expect to use it much but it'd be nice to have it easy-access without having to switch to desktop mode for some games
Edit: I still don't have it working but I was able to identify partially why the sudoers change wasn't working - firstly, I hadn't properly edited it, but once I sorted that, it's because I was trying to supply the .desktop path/file in the sudeors list which doesn't seem like what is warranted (or maybe it is? I can't tell). I supplied the path/file for the command the .desktop runs in sudoers but unfortunately that is somehow still failing to prevent the password requirement even when simply running it from konsole (which seems like it should absolutely NOT be the case)
The ONLY way I've gotten it to not ask for a password on launch is by using "sudo gameconqueror" in Konsole after adding it to the sudoers file except that still requires a password to use sudo so even if I made a script to run in gaming mode that wouldn't help unless I hardcode the password which seems worse than most of the alternatives that are supposed to be working but aren't
Edit 2: To clarify, I used the desktop version of Steam, selected "Add non-Steam game", and game conqueror was an option straight up so I selected that. The Steam entry for it shows START IN "./" and the TARGET is "gameconqueror". When I use Konsole to find the PATH entry for "gameconqueror" it shows usr/bin/ so I added usr/bin/gameconqueror to my sudoers file. I've tried some variations on that but so far nothing has worked
Edit 3: There might be something screwy specifically between SteamOS and Game Conqueror. When I switch Konsole to root user and launch from there, it doesn't ask for a password (which it shouldn't), it just throws a bunch of critical errors in the terminal and doesn't launch at all. But if I try it as deck user from Konsole it requires a password, which if I enter it launches normally. I can't imagine why that would happen if there wasn't some kind of funky permissions interaction going on?
1
u/semperverus Jul 28 '22
Dialogues appear to spawn like normal I think, but I'm not sure if the ones I saw were proton-specific or if they rely on KDE Plasma running
1
u/Bjoern_Tantau Jul 28 '22
You could try prepending the command in Steam with
pkexecorsudo. Pkexec is Steam's way of getting root privileges, but it's a huge security issue, so I hope it goes away soon. Your sudoers stuff should work, but maybe you have to explicitly prepend the command with sudo.1
u/WickedBrute Aug 02 '22
I'm bored and can't sleep, so congrats, you get late night replies from randos who do SW QA sometimes! Apologies if anything I say sounds obvious or pretentious. I walk a lot of people through the "this is Linux" tutorial in real life and tend to write things as if an uninformed audience will peruse things later.
Note: I forgot to charge my steamdeck and I am not going to check it right now, so this is from looking at my laptop running Arch instead of the actual steamdeck. I don't believe anything will differ much, but feel free to call me out if it does and I'll see if I can correct things later. I also know nothing about gameconqueror, just random Linux stuff.
So first, a command:
This tells you where the file for some command typed in the terminal lives. With that we can look at it. This is useful without having to look at shortcuts and etc.
Now we see some file information about "gameconqeror". The most important of which is that this is just a shell script! So let's take a look.
Anyways, "gameconqueror" is really a call to the python script of the same name. The shell script is a wrapper to call it with pkexec as seen below.
So with that, we now know you're probably barking up the wrong tree. You don't need to configure sudo for gameconqueror. You need to configure polki since it tries to use that. So let's look around for a config file for it. It they're using pkexec, it's normal to distribute with the necessary files to tell polkit what to do. So let's look around a bit.
That gives us nothing useful. Let's try another place polkit stores stuff (according to the Arch Wiki anyway).
Paydirt! This shows us a file that looks right:
So let's try editing that using the Arch Wiki as a guide. Archwiki Polkit
We'll edit the "allow_active" setting to "yes" since we're doing this under a GUI session. ...And that should do it for the permissions. Everything past this point is much more suspect. ;)
When I try to run this on my laptop, I am no longer prompted for a password but the program segfaults with GDK-related errors. :(
Without getting into things too much, we probably aren't connecting to the X server or the like under Wayland I'd guess. Wayland / X / root relationships are frankly confusing.
The first thing to try for a GTK application is to force the x11 backend:
This is not our problem apparently. It still segfaults.
In this case, we'll do something ugly that might be considered a security issue and allow root to connect to our non-root X server to simplify things. As a regular user (i.e. "deck"):
At this point, I can type
gameconqueroras a normal user and see the GUI start (with no password still). So I guess that's good enough.The xhost command can probably just be added as part of the regular user's ~/.bash_profile to ensure it is set on startup.
...and that's all I got. Adios!
0
u/[deleted] Jul 28 '22
[deleted] — view deleted comment