Difference between revisions of "Displaying Ubuntu Linux Applications Remotely (X11 Forwarding)"
(New page: In the previous chapter (Displaying Ubuntu Linux Applications Remotely (X11 Forwarding)) we looked at how to display the entire Ubuntu Linux desktop on a remote computer. Whilst this w...) |
|||
Line 1: | Line 1: | ||
− | In the previous chapter ([[ | + | In the previous chapter ([[Remote Access to the Ubuntu Linux Desktop]]) we looked at how to display the entire Ubuntu Linux desktop on a remote computer. Whilst 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 we will look at displaying individual applications on a remote system. |
== Requirements for Remotely Displaying Applications == | == Requirements for Remotely Displaying Applications == | ||
− | In order to run an application on one Linux system, and have it display on another system there are a couple of pre-requisites. Firstly, the system on which the application is to be displayed must be running an X server. If the system is a UNIX or Linux based system with a desktop running then this is no problem. If the system is running | + | In order to run an application on one Linux system, and have it display on another system there are a couple of pre-requisites. Firstly, the system on which the application is to be displayed must be running an X server. If the system is a UNIX or Linux based system with a desktop running then this is no problem. If the system is running Windows, 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. |
− | Secondly the system on which the application is being run (as opposed to the system which the application is to be displayed) must be configured to allow SSH access. Details on configuring SSH on an Ubuntu Linux system can be found in the chapter entitled [[Configuring Ubuntu Linux Remote Access using SSH]]. Finally, SSH must be configured to allow X11 Forwarding. | + | Secondly, the system on which the application is being run (as opposed to the system which the application is to be displayed) must be configured to allow SSH access. Details on configuring SSH on an Ubuntu Linux system can be found in the chapter entitled [[Configuring Ubuntu Linux Remote Access using SSH]]. Finally, SSH must be configured to allow X11 Forwarding. To verify this load the /etc/ssh/ssh_config file into an editor and make sure that the following directive is set: |
<pre> | <pre> | ||
Line 15: | Line 15: | ||
== Remotely Displaying an Ubuntu Linux Application == | == Remotely Displaying an Ubuntu Linux Application == | ||
− | The first step | + | The first step in remotely displaying an application is to move to the system where the application is to be displayed. At this system, ssh into into the remote system so that you have a command prompt. This can be achieved using the ssh command. When using the ssh command we need to use the -X flag to tell ssh that we plan to tunnel X traffic through the tunnel: |
<pre> | <pre> | ||
Line 39: | Line 39: | ||
</pre> | </pre> | ||
− | When run, the above command should run the xclock utility on the remote system, but display the output on the local system | + | When run, the above command should run the ''xclock'' utility on the remote system, but display the output on the local system: |
+ | |||
+ | <pre> | ||
+ | xclock& | ||
+ | </pre> | ||
== Trusted X11 Forwarding == | == Trusted X11 Forwarding == |
Revision as of 14:28, 9 July 2007
In the previous chapter (Remote Access to the Ubuntu Linux Desktop) we looked at how to display the entire Ubuntu Linux desktop on a remote computer. Whilst 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 we will look at displaying individual applications on a remote system.
Requirements for Remotely Displaying Applications
In order to run an application on one Linux system, and have it display on another system there are a couple of pre-requisites. Firstly, the system on which the application is to be displayed must be running an X server. If the system is a UNIX or Linux based system with a desktop running then this is no problem. If the system is running Windows, 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.
Secondly, the system on which the application is being run (as opposed to the system which the application is to be displayed) must be configured to allow SSH access. Details on configuring SSH on an Ubuntu Linux system can be found in the chapter entitled Configuring Ubuntu Linux Remote Access using SSH. Finally, SSH must be configured to allow X11 Forwarding. To verify this load the /etc/ssh/ssh_config file into an editor and make sure that the following directive is set:
X11Forwarding yes
Once the above requirements are met it is time to remotely display an application.
Remotely Displaying an Ubuntu Linux Application
The first step in remotely displaying an application is to move to the system where the application is to be displayed. At this system, ssh into into the remote system so that you have a command prompt. This can be achieved using the ssh command. When using the ssh command we need to use the -X flag to tell ssh that we plan to tunnel X traffic through the tunnel:
ssh -X user@hostname
where username is the user name to use to log into the rmeote system and hostname is the hostname or IP address of the remote system. Enter your password at the login prompt. Once logged it run the following command to see the DISPLAY setting:
echo $DISPLAY
The command should output something similar to the following:
localhost:10.0
To display an application simply run it from the command prompt. For example:
xclock
When run, the above command should run the xclock utility on the remote system, but display the output on the local system:
xclock&
Trusted X11 Forwarding
If the /etc/ssh/ssh_config file on the remote system contains the following line, then it is possible to use trusted X11 forwarding:
ForwardX11Trusted yes
Trusted X11 forwarding is slightly faster than untrusted since it does not engage the X11 security controls. The -Y flag is needed when using trusted X11 forwarding:
ssh -Y user@hostname
Compressed X11 Forwarding
When using slower links the X11 data can be compressed using the -C flag:
ssh -X -C user@hostname