You are not logged in.
Hi Archlinux experts
- Noob is here! -
I'm using Archlinux with Cinnamon desktop.
I play games on linux (like teeworlds and minetest) and want to run them as different user, just in case, to prevent any security problems with the games.
But I don't want to re-login with the games user, so I use su.
I use the xhost command to allow the games user to use the graphical display and it works, but I can't "share" the sound device with that user, so the games are silent.
How can I give the su'ed user access the audio device? (Is it possible?)
Many thanks!
Last edited by spirit369 (2019-03-01 13:03:16)
Offline
Hello there,
Are you using Pulseaudio as your sound server? If so, one option is to share your sound server, by configuring the environment for the application to find it:
#THIS IS AN EXAMPLE
PULSE_SERVER=unix:/run/user/$UID/pulse/native
PULSE_COOKIE=/home/normaluser/.pulse/cookie
Regards
Offline
But I don't want to re-login with the games user, so I use su.
Is that because you do not want to log out as your primary user?
What about switching to a different console and logging in as the game user while leaving your primary user on console 1?
You can switch consoles with ctrl-alt-F2 (to change to console 2, F1 to go back to console 1. By default there are six consoles. [F1-F6])
If that does not answer the mail, how about running it under qemu? (depending on how intensive the game is)
You might try su -l to see if it does a better job of setting up the environment. Not sure about this one and I'm afraid I don't have the time this morning to try it.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Thanks for your replies friends!
@bugsmanagement:
It didn't work out just by setting these parameters, but I found out a way to do it thanks to your recommendation.
I edited /etc/pulse/default.pa and added this line to enable a tcp server:
load-module module-native-protocol-tcp auth-anonymous=true
Then on the 'games' user, I've set "PULSE_SERVER=127.0.0.1" and it worked.
I'm still not happy with having a tcp server just for this...
@ewaller:
Yes, I want to remain in the same session and just have a game window running on different user.
Switching to other console does not bring me a different graphical interface. If it's possible to have two graphical sessions please let me know how. I mentioned that I am a newbie right?
About the "su -l" - it didn't change anything. And as for qemu - I'll have to read about this because it's new to me.
Many thanks again!
Offline