Remote X11 forwarding for AIX in command line.
Most of the Unix administrators love to work with command line and it is the most convenient way to work with Unix systems. There were occasions where we had to invoke the GUI for some applications to work with it like, invoke a Firefox browser to browse the internet through Unix systems, install an application in GUI mode etc.
Here I am going to describe how can we address such situations by invoking GUI over CLI.
- You have an AIX system with remote connection through ssh.
- You need to invoke the GUI of an application through Xming or MobaXterm – a DISPLAY server.
X Window in AIX server
Minimum installation for X Window includes below filesets:
X11.apps.clients (optional to run xclock program – in this case, just for testing purpose)
Install the above-mentioned packages to invoke the GUI remotely through command line.
Connect through SSH X11 port forwarding
On the AIX server check that ssh X11 forwarding requests are enabled.
# grep X11Forwarding /etc/ssh/sshd_config
If not enabled yet, then enable it and restart the SSH service. Restarting the SSH service is not going to interrupt the current session and it will apply the new configuration on the new sessions of SSH.
# stopsrc –s sshd
# startsrc –s sshd
Invoke GUI using PuTTy.
PuTTy is the most common tool used for connecting the Unix servers remotely. If you have any X Window applications installed in your local windows server, you can use PuTTy to invoke the GUI.
Note:- Install x window server application in your Windows system. Eg. Xming.
One of the download links for Xming is here. You may download it from here and install in your windows system before connecting the AIX server through PuTTy. Once it is installed, make sure that the Xming application is started in the windows machine. You may see an icon like below in the system tray.
Now connect from your windows server through putty by enabling the X11 forwarding option as shown in the below screenshots.
Once you logged in to the server, issue the ‘xclock’ command and see that the XCLOCK GUI popped up in your windows system.
Invoke GUI using MobaXterm.
In case you can’t install Xming in your local windows machine, we have an alternate method to use MobaXterm to invoke the GUY through command line. You may download MobaXterm from here and start using it like PuTTy. Below screenshots helps you to access GUI from CLI.
· Open MobaXterm.
· Open an SSH session and provide the Remote host details.
· Click on Advanced SSH settings and enable X11 forwarding. Once you enabled it click on OK button to connect the server.
· Upon login you will see the display configuration like below. Now you are good to issue the xclock command to see the system clock.