Could use some help untangling X server, user permissions

So I have an HVM with a GPU passthrough, running XFCE. Much thanks to Neowutran for guidance with that. This session is running as root user. I’m getting some apps up and running and decided to tackle Steam. Steam does not like running as root user, and refuses to do so (good choice, IMO). Finding a way to hack Steam into running as root is an option, but I feel like it’s probably not my best option.

So I made a new User and tried starting it Steam under that login, and I’m getting “Could not open connection to X” error. Running ‘xrandr’ gives me ‘Cannot open display “:0”’. Changing the DISPLAY variable between “:0”, “:0.0:”, “:1”, etc didn’t help, except also giving me a ‘No protocol specified’ error too.

Running ‘xrandr’ as root gives expected results for display “:0”. List of modelines and whatnot.

So I figure that instead of running XFCE as root I’ll just run that as “user”. Fall back to the console, login as User, and try to run my “startx” script and I get errors such as “can’t find /user/.xauthority”. There was another .file or two it was looking for as well, but I closed the terminal I was using prematurely… suffice to say that User does not have the .folders in it’s home directory that X is looking for, but Root does.

I contemplated just copying over the .Xauthority folder, but I don’t understand X very thoroughly, so I don’t want to go messing blindly with things I don’t know about.

So I guess my question is, barring a better all around solution - How can I run X11 as an unprivileged user in this current setup? Are there groups or config files the user needs to be added to? How does X tell if I have the authority to run it?

Thanks for any input!

I think you might be looking for something along the lines of

echo $DISPLAY
xauth list 

and

xauth add SomeDisplay:XX . SomeMIT-MAGIC-COOKIE

Disclaimer: I’ve not tried it on Qubes OS - it’s from a “dark past” with X11 … but it might help with Cannot open display. A test could be xhost + … but that grants evebody access to your X-display(!!), so not really safe.

Thank you very much for this reply. I won’t be able to try it out until tomorrow but this looks like a promising direction to go.

And I will keep in mind the ‘xhost +’ – this is a VM exclusively for running some games and won’t have anything else on it, so giving everybody access to the X display is a potential workable solution. Though I’ll try otherwise first. :smiley:

As I recall it, one issue with xhost +, is that any program/process that can reach the X-server, can read/inject stuff in the communication with the “Display” - eg play around with keyboard layout … or “make notes” about what keys you press … :-/

1 Like

Noted. Thanks for the warning.

Just wanted to let you know that your answer was (part of) the solution I was looking for. I now have a working instance of the Steam client on a qubes HVM. Now to see what games want to work.
Thanks again!