You are not logged in.

#1 2016-06-07 18:20:17

GhettoGirl
Member
From: Austria
Registered: 2016-06-05
Posts: 16
Website

[SOLVED] configure to allow regular users to spawn their own Xorg

Hi ArchLinux community, I recently switched to ArchLinux (like 2 days ago) and I already love it. What an awesome distro <3
Before I used 3 years openSUSE and 1 year Ubuntu, so I have experience and setup everything from the Arch bootstrap to a fully running system with X, DM and DE in just 1 day. (wasn't that fast ^^)

But now I'm faced a problem I'm unable to fix, which is to configure the X server so, that a regular user can start is at ANY virtual terminal without dying at the Permission denied message.

On openSUSE (at least the old versions 11 and before) and Ubuntu I could solve this problem easily by just doing:

chmod +s /usr/lib/xorg/Xorg

But this binary doesn't exists in Arch.

/usr/bin/Xorg
/usr/bin/xinit

with the +s flag are ignored and the X server still dies with a Permission denied message, trying to access a virtual terminal.

My goal is to run a standalone X server as myself (not as root) on :1/vt8 with VMware Workstation as the ONLY application, no window manager, nothing else, just VMware. Also with the possibility to switch between the primary server and the second, without ending up with a blackscreen because of permission problems.


The first nasty attempt I did was:

chmod 777 /dev/tty8

X started afterwards as regular user, but the system froze and I had todo a hard reset sad

Btw the command to start VMware Workstation is

xinit /usr/bin/xterm -e "vmware --geometry=1920x1080" $* -- :1 vt8

I really want to virtualize on a secondary instance on X and not the primary desktop
1. for convenient reasons
2. because it is faster to switch between desktop and VM, rather than minimizing the VM window everytime...
3. it looks cool smile

To clarify some things:
1. I'm not interested to setup a multiseat, just a second plain X instance
2. modify my xorg.conf file in a manner which affects Graphic and Input settings

So if someone of the more advanced ArchLinux users can help me with this, that would be great ^^

Regards

PS: @Moderators if this is the wrong forum category feel free to move.


Display Manager in use for primary X: sddm 0.13.0-2 running on tty1/vt1
Desktop Environment: KDE Plasma 5.6.4

Last edited by GhettoGirl (2016-06-07 19:15:53)


TUXEDO Book XC1705 CPU: i7-5700HQ, RAM: DDR3 SO-DIMM 32 GB (4x 8192MB) 1866MHz Crucial Ballistix Sport, Storage: 2x HDD, 2x SSD (= 3.7 TB), GPU: Intel HD, NVIDIA GTX 980M (Bumblebee)
Linux 4.6.3 x86_64

Offline

#2 2016-06-07 18:26:36

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: [SOLVED] configure to allow regular users to spawn their own Xorg

It is a snap.  On Arch, Xorg runs as your user; unless you are using a display manager. 

Just put what you want to run in ~/.xinitrc and run startx.
Here is mine:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

#setxkbmap -option caps:super
setxkbmap -option ctrl:nocaps
#autocutsel -fork &
#autocutsel -selection PRIMARY -fork &
#export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
#export TERM=linux

case $WM in
openbox)
        exec  openbox-session
        ;;
win)
    VirtualBox -startvm "Windows 10" -fullscreen
    ;;
i3)
    exec i3
    ;;
dwm)
    exec dwm
    ;;
kde)
    exec startkde
    ;;
*)
    exec i3
    ;;
esac

If I want Virtualbox running Windows 10, I just run WM=win startx
Done.

Edit: https://wiki.archlinux.org/index.php/Xinitrc

Edit 2:  With the script above, I can log into console 1, run startx and be in i3wm.  Then, Ctrl-Alt-F2, login, WM=win startx and I have full screen windows on :1 AND I can still flip back to i3 running on :0

Last edited by ewaller (2016-06-07 18:29:52)


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

#3 2016-06-07 19:14:35

GhettoGirl
Member
From: Austria
Registered: 2016-06-05
Posts: 16
Website

Re: [SOLVED] configure to allow regular users to spawn their own Xorg

Wow that is easy, thanks for the quick reply smile

I ended up with this for now, I will improve it later to add more flexibility

#!/bin/sh
#
# Executed by startx and xinit
#


if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

exec vmware --geometry=1920x1080
xinit -- :1 vt2
startx -- :1 vt2

Have a nice day


TUXEDO Book XC1705 CPU: i7-5700HQ, RAM: DDR3 SO-DIMM 32 GB (4x 8192MB) 1866MHz Crucial Ballistix Sport, Storage: 2x HDD, 2x SSD (= 3.7 TB), GPU: Intel HD, NVIDIA GTX 980M (Bumblebee)
Linux 4.6.3 x86_64

Offline

Board footer

Powered by FluxBB