Linux remote x11 session

Initiate a new (X11) desktop session on a remote host

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 
  • Showing how to start another Xorg server on a remote fedora machine from a ssh terminal session.
Читайте также:  Kali linux black hat

The following answers will not be considered:

  • Using Xvfb , Xvnc or the like.
  • Using some kind of remote desktop technology (RDP, VNC, Spice, TeamViewer, . )

Источник

Enabling Remote X Connections (updated)

Getting remote X applications displaying on your CentOS desktop used not to be difficult. X11 remote connections are typically governed by the -listen tcp or -nolisten tcp arguments to X or Xorg server running your desktop. It’s not sufficient to just run xhost + from a terminal on your desktop, you have to edit a display manager configuration file and start a new X session (log out, log in again).

First, disable the firewall:

sudo systemctl stop firewalld sudo systemctl disable firewalld sudo systemctl mask firewalld sudo systemctl daemon-reload

The right command to test with

If you ssh from desktop1 to server2, you probably have X11 forwarding happening already. This uses implied port forwarding through ssh for port 5900 to localhost:5010 usually. This is why when you type $ echo $DISPLAY you will likely see localhost:10 as your new display. By default, many X11 based programs take a -d host:display.number argument. Use this to avoid testing out the ssh local X forwarding. You want to use xhost + from your desktop first, of course:

desktop1$ xhost + access control disabled, clients can connect from any host desktop1$ ssh server2 server2$ echo $DISPLAY localhost:10 server2$ xterm -d desktop1:0.0

When running lightdm as your display manager:

Updated: The files you want to edit if you’re running lightdm include:
1) /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf

[Seat:*] xserver-command=X -core -listen tcp

2) /etc/lightdm/lightdm.conf
This file probably won’t exist, you may create it if it is missing.

[Seat:*] xserver-allow-tcp=true xserver-command=X -listen tcp

Then run $ sudo systemctl restart lightdm

Читайте также:  Which linux version to use

When you log in again, check that no -nolisten tcp arguments are present in the X command line. Multiple -listen tcp arguments are fine.

When running gdm as your display manager:

Then edit /etc/gdm/custom.conf

You want to add this line to [security] stanza:

And allow a listen tcp argument to the [xdmcp] stanza:

ServerArguments=-listen tcp

A full configuration looks like:

# GDM configuration [daemon] [security] DisallowTCP=false [xdmcp] ServerArguments=-listen tcp [chooser] [debug] #Enable=true

Log out of your CentOS desktop session, and log in again. Open a terminal and run:

You can check the efficacy of that by looking at the arguments X was started with:

centos-2018-03-30-01

Other options include TigerVNC:

$ sudo yum install tigervnc $ vncviewer 192.168.1.101:1

Or use Rdestop:

$ sudo yum install freerdp $ xfreerdp 192.168.1.101

Remote X connections have been out of fashion for many years, and the default is to not allow connections for security reasons. If you are running equipment in an isolated environment, you should feel safe doing this.

Источник

Displaying Ubuntu 20.04 Applications Remotely (X11 Forwarding)

In the previous chapter we looked at how to display the entire Ubuntu desktop on a remote computer. While this works well if you actually need to remotely display the entire desktop, it could be considered overkill if all you want to do is display a single application. In this chapter, therefore, we will look at displaying individual applications on a remote system.

1.1 Requirements for Remotely Displaying Ubuntu Applications

In order to run an application on one Ubuntu system and have it display on another system there are a couple of prerequisites. First, the system on which the application is to be displayed must be running an X server. If the system is a Linux or UNIX-based system with a desktop environment running then this is no problem. If the system is running Windows or macOS, however, then you must install an X server on it before you can display applications from a remote system. A number of commercial and free Windows based X servers are available for this purpose and a web search should provide you with a list of options.

Читайте также:  Сборка ядра linux из исходников

Second, the system on which the application is being run (as opposed to the system on which the application is to be displayed) must be configured to allow SSH access. Details on configuring SSH on an Ubuntu system can be found in the chapter entitled “Configuring SSH Key-based Authentication on Ubuntu”. This system must also be running the X Window system from X.org instead of Wayland. To find out which system is being used, open a terminal window and run the following command:

# echo $XDG_SESSION_TYPE x11

If the above command outputs “wayland” instead of “x11”, edit the /etc/gdm3/custom.conf file and uncomment the WaylandEnable line as follows and restart the system:

# Uncomment the line below to force the login screen to use Xorg WaylandEnable=false

Finally, SSH must be configured to allow X11 forwarding. This is achieved by adding the following directive to the SSH configuration on the system from which forwarding is to occur. Edit the /etc/ ssh/ssh_config file and uncomment the ForwardX11 entry (in other words remove the ‘#’ at the beginning of the line) and change the value to yes entry as follows:

Источник

Оцените статью
Adblock
detector