简体   繁体   中英

How to start a GUI software on a remote Linux server via SSH?

I am trying to open Matlab software installed in remote Linux server from my Windows 7 PC. I am using SSH secure shell to connect with the Linux server. After successful connection, I am able to see and access the folders under my user account. I am able to start Matlab software using the following command in the SSH secure shell window:

[sushma@scorpio home]$ matlab

On doing so the following message gets displayed on the SSH secure shell window:

MATLAB is selecting SOFTWARE OPENGL rendering. No protocol specified

                               < M A T L A B (R) >
                     Copyright 1984-2015 The MathWorks, Inc.
                     R2015b (8.6.0.267246) 64-bit (glnxa64)
                                 August 20, 2015

From the above message it seems that the software is running. I want to access the GUI of the software.

Give a try to ssh -X

From ssh manual:

-X Enables X11 forwarding. This can also be specified on a per-host basis in a configuration file.

X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring.

For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions by default. Please refer to the ssh -Y option and the ForwardX11Trusted directive in ssh_config(5) for more information.

-Y Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.

steps that worked for me:

  1. connect to the server by using the ssh -X flag
  2. execute Matlab with matlab & (you should see Matlab opening on your local machine)
  3. check within Matlab with the command opengl info if either software or hardware opengl is being used (if you're having trouble loading opengl go to step 2 and execute matlab -softwareopengl & )
  4. run your gui script with run <script>

If the script is supposed to run independent of your ssh connection, I suggest to use the program tmux and repeat step 2-4 inside a tmux session

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM