3

I have a Debian stretch x64 server running in a virtual KVM machine. I have installed Cygwin on Windows 7 Pro x64 and would like to run X applications on the Debian machine, using the Cygwin X server at the Windows machine.

This is my server-side SSH daemon configuration (Debian side):

AcceptEnv LANG LC_*
AllowAgentForwarding no
AllowTcpForwarding no
AllowStreamLocalForwarding no
ChallengeResponseAuthentication no
Ciphers [email protected],[email protected],aes256-ctr
Compression no
DebianBanner no
HostKeyAlgorithms [email protected],[email protected],ssh-rsa,ssh-ed25519
KbdInteractiveAuthentication no
KexAlgorithms curve25519-sha256,[email protected],diffie-hellman-group-exchange-sha256
ListenAddress 192.168.20.12:22
LoginGraceTime 20
MACs [email protected],[email protected]
PasswordAuthentication no
PermitUserRC no
Protocol 2
PubkeyAcceptedKeyTypes ssh-rsa,ssh-ed25519
RekeyLimit 100M 20m
Subsystem sftp /usr/lib/openssh/sftp-server
TCPKeepAlive no
X11Forwarding yes
X11UseLocalhost yes

This is the batch file I use to start konsole on the server (Windows side):

set CYG=c:\cygwin64

%CYG%\bin\run.exe XWin -multiwindow -resize -clipboard -listen inet :1
SET DISPLAY=:1
SET LANG=en_US.UTF-8
%CYG%\bin\ssh.exe -f -Y [email protected] "LANG=en_US.UTF-8 konsole"
"C:\Program Files (x86)\cmdow\cmdow.exe" X-Morn-multiwindow /HID
exit

In principle, this works: When executing this batch file, konsole starts in a window on my Windows desktop. But there are two error messages in the cmd window:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

As a last resort, I could live with those errors because konsole (and the other applications I need) obviously actually work, but I really would prefer knowing what is going on there (i.e. what causes the error messages).

From reading the other questions / threads / blog entries I have mentioned above, I got the impression that the problem might be related to missing nvidia or mesa components. So I installed some of these components on the Debian server doing (as root):

aptitude install libgl1-mesa-glx libgl1-glvnd-nvidia-glx

Indeed, when I then ran the batch file mentioned above, the libGL errors were not thrown any more. But unfortunately, now the konsole window did not appear on the Windows desktop any more.

After uninstalling the two packages again, the konsole window again appeared when I ran my batch file - of course, this is true for the libGL error messages as well.

I would like to understand both of the phenomena. So what could be the cause of the libGL error messages (given the fact that missing mesa or nvidia drivers or libraries should not play a role when running X applications via SSH), and why does installing the two packages mentioned above keep the konsole windows from appearing?

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
Binarus
  • 3,160
  • 1
  • 15
  • 31
  • In windows you are dealing with the windows HAL and not with the graphic card. Furthermore, often X servers in windows give you a outdated implementation of the X primitives. Using other shareware or even sometimes commercial implementations will often leave you no better. We are however talking about windows limitations and superuser se would be a better fit for this question. – Rui F Ribeiro Dec 08 '18 at 09:50
  • I am grateful for your comment, but to be honest, I doubt your statement. As I have described, changing the configuration at the Linux side definitely makes the error messages go away. I am pretty sure that those messages are not caused by the X server in Windows or any other Windows component. It seems that X applications started at the server side are searching for some libraries although those libraries are not needed when the applications are started via SSH. – Binarus Dec 08 '18 at 10:15
  • The fact they use the libraries does not invalidate what I am saying. You are dealing with several questions, however without using Linux natively or in a vm, the lack of libraries is the least of your worries – Rui F Ribeiro Dec 08 '18 at 10:23
  • TLDR I would not even try to go via remote X... see NX/NoMachine for having a fulll Linux desktop on your side. Have tried to go down that road in the past, and X in Windows does not deliver. See also this https://unix.stackexchange.com/questions/462817/hiri-email-client-is-crashing – Rui F Ribeiro Dec 08 '18 at 10:34
  • In fact, I am doing this for over 5 years now, and it works like a charm. This is really the first "problem" I came across. According to my experience, the Cygwin X server is working absolutely reliably. I am continuously running "big" applications (like Eclipse with a load of plugins) as well as simple ones (like konsole) that way. And in fact, the new setup also works without any problems, except that those error messages disturb me. I'll just ignore them if I can't find another solution ... – Binarus Dec 08 '18 at 10:55
  • If it works for you...I tried to use Windows in corporate for 2-3 months and gave up. I had negotiated Linux from day 0 and opted out of Windows. I was the first, nowadays we are more using Linux. X is severely lacking, I tried to use it via Unity/Coherence modes too without much success. – Rui F Ribeiro Dec 08 '18 at 11:14
  • (hint: try to follow the errors of the X primitives ....loads of simple errors...it just sort of works, and seems to be an older version of the protocol) – Rui F Ribeiro Dec 08 '18 at 11:36
  • 1
    I have found out by accident how to solve the problem - see my own answer. – Binarus Dec 13 '18 at 07:24

2 Answers2

3

for me the

apt install libgl1-mesa-glx

did the difference and both error messages disappeared under 20.0.8-0ubuntu1~20.04.1

andzun
  • 31
  • 2
  • Thank you very much for caring about such an old question, and +1. I'll note this and try it in case I am getting into the same trouble again. – Binarus Oct 26 '20 at 06:51
  • This solved it for me, Mac OS BigSur XQuartz Server to a Raspberry Pi Zero W as ssh target – Tyler Hartwig Apr 03 '21 at 16:01
0

The problem went away after installing the following packages (apt has installed them together):

  • dbus-x11
  • libglib2.0-tests
  • libdbus-glib-1-2
  • libgee-0.8-2
  • libmoonshot1

I can't tell for sure which of these packages (or which combination thereof) made the problem go away. I do not plan to do further examinations because this machine has become a production server in the meantime.

However, I think I can give an educated guess:

  • libgee-0.8-2 and libmoonshot1 do not have anything to do directly with the low-level X11 or UI parts, so I am quite sure that they are out of the game.
  • libglib2.0-tests (as the name implies) is just a test suite for GLib, so I am quite sure that this is out of the game as well.
  • I really can't tell which of the remaining two candidates might have solved the problem. I have the feeling that the problem was more related to GLib than to X11, so my favorite is libdbus-glib-1-2. But this is really just a feeling ...

It would be nice if somebody in the same situation (i.e. setting up a Debian stretch server and running X applications via SSH) could confirm this. But even when not, I think this answer is useful because exactly this question has been asked at other places dozens of times without a solution having been given (to my best knowledge).

Binarus
  • 3,160
  • 1
  • 15
  • 31
  • lidbdbus-glib seems an unlikely candidate, though in the sea of dependencies who knows. Many apps are happier if dbus (and dependencies) are installed though. – Rui F Ribeiro Dec 13 '18 at 08:23
  • It's unlikely any of those packages are directly responsible, though there may have been an indirect effect. In any case, note that forwarded X won't use the hardware OpenGL acceleration, you are using a software renderer (compare `swrast` in the error message), so installing NVidia libraries wasn't helping, either. – dirkt Feb 27 '19 at 11:38
  • It's libdbus-glib. I did apt install & the problem went away. – Jing Dec 04 '19 at 01:32