Using Xorg to view images on server...

I have a small test based application which is used, by its users, via ssh over the lan. They now want to view images on the server. Searching has suggested using ssh with the -Y parameter, to enable X11 forwarding. The client systems use Linux Mint. Is this a viable route? Would a different approach be better. Advice please. Ta.
 
Is this a viable route?
Yes. Assuming Mint uses X, not wayland. Because you're going to need a working X server on the Mint clients.

Note however that X-Forwarding is off by default server-side nowadays. You will need to enable X11Forwarding in sshd_config.
 
Yes, I think Linux Mint is currently X by default. I think the Mint team are working on Wayland, but it' not the default. Are there detailed instructions for the lazy and hopeless somewhere?
 
I used putty a long time ago, I used -X , but there was a black screen, I was told that the client was compiled without X server support, maybe it was disabled somewhere in the configuration, enabling X, I didn't understand, honestly
 
Thanks for that. How do I configure X on a server with no display? What is a good option for opening the image file on the server?. Is this the basic operation?:
ssh -X user1@192.168.0.10 [enter]

How do I open the image over ssh?
I must learn this hidden knowledge.
 
ssh -X and ssh -Y set a suitable $DISPLAY variable automatically on remote login. You can call any old X11 image viewer (unless the viewer is SDLed but that is rare).
 
How do I configure X on a server with no display?
The system you are connecting to does not need a working X server, the X server runs on the Mint clients. The application runs on the server and connects over the SSH X forwarding to the X server running on the client. The application runs on the server, the GUI shows up on the client.
 
-X and -Y are really just conveniences. You can manually forward X11 sockets, setup the xauthority, set DISPLAY easily enough. The real strength is in X11 and its network transparency.

So even if you are using a weird / proprietary ssh/sshd without the functionality, you can still emulate it.
 
No, $DISPLAY is managed by the ssh connection establishing. Don't touch it.
I never use X forwarding, but I remember that the DISPLAY var needed a local ip code. it might have changed.
How else does a program know where the output screen is?

Just tried xgalaga via a ssh -X -Y connection.
Code:
Authorization required, but no authorization protocol specified
Cannot open display "(null)"
Ssh should pass that display reference to the server during the shell session with forwarding? It seems an empty field.
 
-X and -Y are really just conveniences. You can manually forward X11 sockets, setup the xauthority, set DISPLAY easily enough. The real strength is in X11 and its network transparency.

So even if you are using a weird / proprietary ssh/sshd without the functionality, you can still emulate it.
I agree that one can do it without the options, but the logic/syntax of the options makes it preferable/easier for me. A user that understands the options can better debug or work around things.

No, $DISPLAY is managed by the ssh connection establishing. Don't touch it.
Agree completely here. Use the correct options on the ssh client command line (options that the server supports) and it all just works. My local use cases (FreeBSD client to Linux far end) the worst that I've run into is needing to wait maybe 15 to 30 secs before running the application on the far end (Linux). Haven't tracked it down, but seems to be "time sync between ssh client and ssh server system" related. The problem shows up as "I ssh from A to B, then type xterm. Sometimes it doesn't show up but if I wait 20 secs it works"
 
I agree that one can do it without the options, but the logic/syntax of the options makes it preferable/easier for me. A user that understands the options can better debug or work around things.
Absolutely. I use -X all the time (and almost never need to do things manually)

Its more that even in the most lame of ssh clients, X11 prevails ;)

And supporting X11 forwarding doesn't link the ssh client against e.g. libX11 either which is cool.
 
  • Like
Reactions: mer
And supporting X11 forwarding doesn't link the ssh client against e.g. libX11 either which is cool.
Agreed. It's not really just X11 forwarding, it's the port redirection of ssh that can be magic.
$WORK we have some stuff that basically does ssh through a couple of hosts (security) with port redirection to allow an "rsync" command to work through the ssh tunnel. Hurts my brain when I try to understand the port mapping, but cross my fingers and it works.
 
There are images and there are IMAGES. For screen sized JPGs X forwarding should work fine. However some use cases will fail. What if the image they want to remotely view is a 4GB geoTIFF image? and worse, what if the end user expects crisp panning or paging between large images using an X11 image viewer that isn't well optimized for large images?...All I'm saying is that there are some serious caveats to the generic use case as described by OP.
 
There are images and there are IMAGES. For screen sized JPGs X forwarding should work fine. However some use cases will fail. What if the image they want to remotely view is a 4GB geoTIFF image? and worse, what if the end user expects crisp panning or paging between large images using an X11 image viewer that isn't well optimized for large images?...All I'm saying is that there are some serious caveats to the generic use case as described by OP.
Interesting perspective.
What I think could be done is a web browser. Typically web browsers can display pretty much any type of image, so perhaps this use case the server side provides a web interface?
 
Back
Top