A little "trick" I use when I want to run a GUI as root:
Code:
$ sudo su
Password:
# startx -- :1 &>/dev/null &
That starts a new instance of the X-server of the second available
tty logged in as root. (Actually, logged in as whoever was logged in to the terminal session when the
startx command was executed. I use this option fairly often when I want to preempt my wife's system (by logging in as myself) for maintenance without disturbing whatever she's running.)
Notes:
- I avoid using a Web browser whilst in a "root" GUI.
- The other X-server will continue to run on the TTY to which it was connected. Usually you can switch between running servers with the appropriate <ctrl>-<alt>-<F[1-10]> key combination. (You do have to have the "DontVTSwitch" set off in the ServerOptions stanza of the xorg.conf file you're using for this to work. It defaults to "on" in version 4 of X.) If the VT switch doesn't work, logging off should revert you to the prior terminal.)
- This is handy if you like to use different window manages for different things. You can specify the window manager to be used on different ttys with different .Xclient.<hostname>:<tty_sequence_number> files in your home directory. For example, here's what I have on this laptop:
Code:
$ for f in .Xclients-dv9810us\:*;do echo;echo ---- $f;echo;cat $f;done
---- .Xclients-dv9810us:0
#! /bin/bash
WM="startkde"
WMPATH="/usr/bin /usr/X11R6/bin /usr/local/bin"
for p in $WMPATH ; do
[ -x $p/$WM ] && exec $p/$WM
done
exit 1
---- .Xclients-dv9810us:1
#! /bin/bash
WM="gnome-session"
WMPATH="/usr/bin /usr/X11R6/bin /usr/local/bin"
for p in $WMPATH ; do
[ -x $p/$WM ] && exec $p/$WM
done
exit 1
---- .Xclients-dv9810us:2
#! /bin/bash
WM="startxfce4"
WMPATH="/usr/bin /usr/X11R6/bin /usr/local/bin"
for p in $WMPATH ; do
[ -x $p/$WM ] && exec $p/$WM
done
exit 1
---- .Xclients-dv9810us:3
#! /bin/bash
WM="karmen"
WMPATH="/usr/bin /usr/X11R6/bin /usr/local/bin"
for p in $WMPATH ; do
[ -x $p/$WM ] && exec $p/$WM
done
exit 1