5

I would like to start a new Xorg server on a remote host. At first, I tought this would be as easy as it is on the local host:

$ xinit /usr/bin/startxfce4 -- :4

On a local host, this command typed into a (non-graphic) login shell (vt/tty) will start another Xorg server, i.e. I will have a xfce4 desktop after this - and this desktop is additional to my normal desktop started from login from the desktop manager (e.g. sddm).

However, if I try that on a remote (fedora) system from the ssh console:

X.Org X Server 1.20.6
X Protocol Version 11, Revision 0
Build Operating System:  5.0.6-200.fc29.x86_64 
Current Operating System: Linux noah.siteos-lokal.de 5.5.10-200.fc31.x86_64 #1 SMP Wed Mar 18 14:21:38 UTC 2020 x86_64
Kernel command line: BOOT_IMAGE=(hd0,msdos3)/vmlinuz-5.5.10-200.fc31.x86_64 root=/dev/mapper/vg_sdd-root ro rd.luks.uuid=luks-a9eba963-ff2e-499b-a298-0659c5e29359 rd.lvm.lv=vg_sdd/root rd.lvm.lv=vg_sdd/swap rhgb quiet resume=/dev/disk/by-uuid/73299393-6bdb-4230-a1ca-096e5ee32396 splash=silent quiet video.use_native_backlight=1
Build Date: 25 November 2019  12:00:00AM
Build ID: xorg-x11-server 1.20.6-1.fc31 
Current version of pixman: 0.38.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/tpasch/.local/share/xorg/Xorg.4.log", Time: Fri Apr  3 19:38:52 2020
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE) 
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
(EE) 
(EE) 
Please consult the Fedora Project support 
         at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/home/tpasch/.local/share/xorg/Xorg.4.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

I wonder why it is possible to start another Xorg on the local host but I get this error on a remote host. I'm not expecting to 'see' the new desktop from my ssh terminal. But I would expect that I could ‘export’ the new Xorg rendered desktop with e.g. x11vnc.

It there easy way to get this running?

The bounty is for:

  • Showing how to start another Xorg server on a remote fedora machine from a ssh terminal session.

The following answers will not be considered:

  • Using Xvfb, Xvnc or the like.
  • Using some kind of remote desktop technology (RDP, VNC, Spice, TeamViewer, ...)
7
  • I am very confused about this question. X is the server, applications connect to it, and it will display the windows of the applications on graphical hardware. X has no concept of "sessions". The display manager (DM) can start sessions on a single X server when users log in. Nothing of this has anything to do with x11vnc.
    – dirkt
    Commented Apr 6, 2020 at 17:25
  • 1
    If you want a "virtual" X server on the remote host, which applications on the remote host (or even on other hosts, X is network transparent) can connect to, and where you want to display the "virtual" screen via VNC, you can either use Xfb with x11vnc, or you can use a VNC program that already implements an X server, like Xvnc or others.
    – dirkt
    Commented Apr 6, 2020 at 17:26
  • You say "let’s say for ‘exporting’ the session with x11vnc". Is this why you want the remote X session? Are you going to attach a display to the server? Commented Apr 8, 2020 at 22:04
  • I have caused some confusion because I used the world 'session'. I tried to elimate that word from my question and hope that I made my problem/question clearer with that.
    – aanno
    Commented Apr 9, 2020 at 16:15
  • You say "let’s say for ‘exporting’ the service with x11vnc". Is this why you want the remote X? Are you going to attach a display to the server? (this call for clarification is not about the word session) Commented Apr 9, 2020 at 18:47

2 Answers 2

0

The answer is given by your command line input
$ xinit /usr/bin/startxfce4 -- :4

and the output of xorg

    Fatal server error:
    (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)

The '$' from your command line implies that you are not root (the it should be '#') and the output implies that you do not have the permission required.

You could try
$ sudo xinit /usr/bin/startxfce4 -- :4
but this then starts xfce4 with root privileges.

I would recommend to start the x-server as a systemd service and separate from any x-client.

3
  • 1
    Change the permissions for /dev/tty0? Commented Apr 10, 2020 at 12:08
  • Why would this be needed from a remote connection, but not locally? Commented Apr 12, 2020 at 7:12
  • This is hard to answer without more details. I would try to compare configuration and privileges on both systems.
    – bey0nd
    Commented Apr 12, 2020 at 11:10
0

bey0nd mentions a permissions issue, and I agree.

In essence all you know is the command fails because it can't access /dev/tty0. Just reading the man pages determines xorg server has a binary wrapper. The host machine must configure these options if that's somehow unclear.

The proper way is to use the systems in place. Since you have SSH to consider in the equation, be aware this does expose your system. That said, the man page says to update the /etc/X11/Xwrapper.config to allow terminal use through needs_root_rights=yes. I believe this is the option that will resolve the startup issues.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .