We're on Discord! Please join our server now if you don't want to miss anything! (More info) | Join the UCC4 contest! (More info)

* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Running Xorg without any root rights  (Read 722 times)

0 Members and 1 Guest are viewing this topic.

Offline gameblabla

  • Super User
  • Join Date: May 2015
  • Location:
  • Posts: 800
  • Post Rating Ratio: +15/-7
  • TI-nspire porter
Running Xorg without any root rights
« on: May 01, 2018, 06:27:57 am »
While i was using Devuan, i ran startx as a normal user (instead of using sudo).
Surprisingly, i was able to get a screen. However, neither the keyboard or mouse would work so i had to reboot.

Fast forward to now, i was very annoyed to see people claiming that you need to have systemd in order to run Xorg without any root rights.
I later discovered it was in fact false, as people were able to do just that before systemd even existed. (back in 2009)

You do need a driver that supports KVM, which nouveau, intel and radeon does. (i heard nvidia's proprietary driver also recently supports KVM)
Also make sure to use libinput for xorg.

It was a simple matter of making a udev script (or using chown on /dev/input*, your choice) and voila, Xorg without any root rights.



It's worth nothing that none of this would work with a window manager. (In fact, i think SDDM still doesn't support rootless xorg !)
So i also had to make it nice and convenient for me to use and i opted for a script in /etc/profile.d which will prompt you if you want to run your window manager. (with xorg of course)

You can give it a try here :
https://github.com/gameblabla/xorg-rootless-devuan


  • Calculators owned: TI Nspire CX, TI-89

Offline Juju

  • aka Yuki Kagayaki aka J̵̭͕͇ù̞̭̝̯̦j̴̭̙̗͖͡ù͏͓̲̕
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Inside a walrus
  • Posts: 3248
  • Post Rating Ratio: +37/-2
  • Couch potato
    • jul.savard
    • juju2143
    • @juju2143
    • juju2143
    • @julosoft
    • juju-kun
    • /u/juju2143
    • juju2143
    • @juju2143
    • Juju's shed
  • Gender: Female
  • WalriiPoints: 99999
Re: Running Xorg without any root rights
« Reply #1 on: May 01, 2018, 06:50:02 am »
Yeah, pretty sure rootless X predates systemd or had anything to do with it, you pretty much have to give a bunch of files in /dev the right permissions or something. The fact it doesn't work in Devuan probably is a bug with the distro, actually, you might want to check out their bug tracker if any.

EDIT: Ah yeah, some old document on the Ubuntu Wiki from 2010 corroborate this, you need KMS drivers and give the right permissions to the tty and /dev/input.
« Last Edit: May 01, 2018, 06:54:24 am by Juju »
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Offline gameblabla

  • Super User
  • Join Date: May 2015
  • Location:
  • Posts: 800
  • Post Rating Ratio: +15/-7
  • TI-nspire porter
Re: Running Xorg without any root rights
« Reply #2 on: May 11, 2018, 08:19:34 pm »
I'm sure pretty much all distributions are affected.
I did encounter one issue with this approach though : Teamviewer only works with a display manager.
Kind of a huge pain in the pass and that forced me to temporary install wdm before reverting back to startx.
It would also sometimes crash randomly when things get messy with steam... Though it's kind of an improvement as before it would freeze my computer forever and i was forced to reboot it.

Wine 3.8 fixed some Steam bugs so hopefully it will play nicer now.
As for teamviewer, i think i'll use another alternative for now or maybe use it on another computer.
  • Calculators owned: TI Nspire CX, TI-89

Offline Juju

  • aka Yuki Kagayaki aka J̵̭͕͇ù̞̭̝̯̦j̴̭̙̗͖͡ù͏͓̲̕
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Inside a walrus
  • Posts: 3248
  • Post Rating Ratio: +37/-2
  • Couch potato
    • jul.savard
    • juju2143
    • @juju2143
    • juju2143
    • @julosoft
    • juju-kun
    • /u/juju2143
    • juju2143
    • @juju2143
    • Juju's shed
  • Gender: Female
  • WalriiPoints: 99999
Re: Running Xorg without any root rights
« Reply #3 on: May 12, 2018, 07:59:19 am »
Well, it is possible some apps and toolkits depends on a window manager to work correctly, so yeah. You'd need a window manager to do anything useful anyway.

I'm pretty sure on most distros it works at least correctly (even though it's systemd), personally on my Arch Linux I have EmulationStation launch startx as a normal user with a little script that sets the correct mode, starts a simple window manager (steamcompmgr, which merely starts the current app fullscreen) and Steam in big picture mode. It just works, probably with some udev rules or the like, it just worked out of the box.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games