The officially official Devuan Forum!

You are not logged in.

#1 2020-09-16 00:28:19

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 185  

Nested Xsessions with Xephyr-xserver <Solved>

Sorry for such a long post, but I wanted to include all that I thought was relevant to my issue.  I am trying to use nested X-sessions between a client and server using the Xephyr-xserver package.  The Xephyr program appears to be working but I keep seeing these errors when I try to ssh into the server machine with the following command:

$ ssh -v -Y user@xxx.xxx.xxx.100

Warning: No xauth data; using fake authentication data for X11 forwarding.
...
debug1: Remote: No xauth program; cannot forward X11.
X11 forwarding request failed on channel 0

TL/DR-
- xauth is installed on both the client and server
- .Xauthority file is located on both client and server and it has the correct permissions
- sshd_config on server and ssh_config on client "appear" to have all needed options active.

These are the commands used with Xephyr,

user@host:~$ Xephyr :2 -screen 1368x768 -resizeable &
[1] 4819

This loads a blank black screen, which is normal.

user@host:~$ DISPLAY=:2 ssh -Y user@xxx.xxx.xxx.100

...
Warning: No xauth data; using fake authentication data for X11 forwarding.
...

Common configurations of client and server:

# xauth is installed on both the client and server

# apt policy xauth
xauth:
  Installed: 1:1.0.10-1
  Candidate: 1:1.0.10-1
  Version table:
*** 1:1.0.10-1 500
        500 http://deb.devuan.org/merged beowulf/main amd64 Packages
        100 /var/lib/dpkg/status

       
# xorg is installed on both client and server

# apt policy xorg
xorg:
  Installed: 1:7.7+19
  Candidate: 1:7.7+19
  Version table:
*** 1:7.7+19 500
        500 http://deb.devuan.org/merged beowulf/main amd64 Packages
        100 /var/lib/dpkg/status

# Xauthority has the proper permissions on both the client and server

$ ls -n .Xauthority
-rw------- 1 1000 1000 105 Sep 15 16:07 .Xauthority

I added this to both the server and client in the ~/.bashrc file just to try "something"

export XAUTHORITY=$HOME/.Xauthority

The username on the account is the same for both server and client.

Server setup

# sshd_config contains

AddressFamily any    # ipv6 is not disabled
AllowAgentForwarding yes
X11Forwarding yes
XAuthLocation $HOME/.Xauthority
X11DisplayOffset 10
X11UseLocalhost yes
AllowTcpForwarding yes

# Client setup

# ssh_config contains in ~/.ssh/config

Host xxx.xxx.xxx.100
    ForwardAgent yes
    ForwardX11 yes
    ForwardX11Trusted yes
    XAuthLocation $HOME/.Xauthority

There is a lot written about this on the web and it seems rather straightforward to implement.  However, I am overlooking something.  I have tried several examples that I found on the web, but still I get these errors.

Warning: No xauth data; using fake authentication data for X11 forwarding.
...
debug1: Remote: No xauth program; cannot forward X11.
X11 forwarding request failed on channel 0

Additional info:
Even with the ssh x-forwarding errors, the ssh connection will succeed, so if I go ahead and issue the command to "startxfce4" in the terminal window connected to the server, I expect the xsession to start in the blank black Xephyr window.  Instead, I get this output:

$ startxfce4
/usr/bin/startxfce4: Starting X server
/usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

But if I go into /etc/X11/Xwrapper-config and change

allowed_users=console

to

allowed_users=anybody

then the xsession will start, but not within the Xephyr nested x window.  It starts on the monitor connected to the physical machine. 

It is not forwarding the xsession to Xephyr, and I am out of ideas on what to check and I can not find anything new on the web to help me out, yet.  So I am asking for help.  Any ideas?

Last edited by nixer (2020-09-16 21:45:56)

Offline

#2 2020-09-16 00:43:06

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: Nested Xsessions with Xephyr-xserver <Solved>

Wouldn't you neeed to use xvfb to run an X server remotely without displaying on a real console?

Online

#3 2020-09-16 10:59:30

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 185  

Re: Nested Xsessions with Xephyr-xserver <Solved>

Thanks for responding rr.  I have never needed xvfb before and up until now I have never seen it mentioned as being a dependency or needed for nested xsessions. 

This is an example of what I have used in the past:
https://nek0.eu/posts/2014-10-25-Deskto … ephyr.html
or
https://www.dedoimedo.com/computers/xephyr.html

But this depends on Xforwarding successfully working, which I am getting errors on at the moment.  Thanks again.

Offline

#4 2020-09-16 12:20:19

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,409  

Re: Nested Xsessions with Xephyr-xserver <Solved>

Oh, man, that is weird. It'll start xfce even if xfce is already running. I was doing this on my second monitor, and when I ran startxfce4, I saw the panel on my first monitor flash like it was restarting.*  I don't know what the deal is with xfce, but I can get it to work correctly with icewm, jwm or even openbox.

ssh -X user@remote
Xephyr :1 -screen 1024x768 -resizeable &

And then one of the following:

icewm --display=:1
jwm -display=:1
DISPLAY=:1 openbox-session

usernames are not the same on local and remote machines.
I didn't have to do anything with Xauthority or Forwarding settings.

Tested on second machine where I had to use :2 instead of :1.

* Just to be perfectly clear, I was in a terminal and logged into the remote with 'ssh -X' when I ran startxfce4, and it affected the local machine instead of the remote.

Offline

#5 2020-09-16 13:00:03

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 185  

Re: Nested Xsessions with Xephyr-xserver <Solved>

Thanks for your input fsr, I will keep tinkering with this some more.  It may be something small on my system that is the problem, but I don't know what it could be and I can't think of what else to check.  Thanks again, at least now I know that it does work on someone else's system, and I am motivated to keep looking and trying to find a resolution.

Offline

#6 2020-09-16 21:45:14

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 185  

Re: Nested Xsessions with Xephyr-xserver <Solved>

I got it working.  The major problem that I had was that the entry in both the sshd_config file on the remote system and the ssh_config file on the local system had the entry as the default:

XAuthLocation $HOME/.Xauthority

It would not work with this entry in either file.

So I changed this entry in both files to:

XAuthLocation /usr/bin/xauth

And it works.

So for anyone that runs across this thread, I will put the config entries in both the files that are working now.

On the remote sshd_config file, I have:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
AllowTcpForwarding yes
XAuthLocation /usr/bin/xauth

On the local system and its ssh_config file, I have in the  ~/.ssh/config  file:

Host IP_ADDR
    ForwardAgent yes
    ForwardX11 yes
    ForwardX11Trusted yes
    XAuthLocation /usr/bin/xauth 

To use, I open a terminal window and enter the Xephyr command to open a blank and black window:

Xephyr :2 -screen 1368x768 -resizeable &

Next, enter the command to ssh into the remote box and forward the xsession to display two on the local machine:

DISPLAY=:2 ssh -Y USER@IP_ADDRESS

Lastly, in the same terminal window which is now showing connected to the remote machine, I entered

startxfce4

And it works.

Last edited by nixer (2020-09-16 21:48:17)

Offline

Board footer