Enable X11 forwarding for GUI-based installations in Amazon EC2

Share on:

If you are a database administrator involved in database installations on Red Hat Enterprise Linux, Oracle Linux running on EC2 using GUI, then this blog is going to help you to achieve the objective. Mentioned here are the rpm packages, the SSH settings, the Windows tools, and other steps to facilitate X11 forwarding when you want to install, for example, Oracle database or E-Business Suite applications, that utilise user-friendly GUI feature.

 

What is needed?

 

How to proceed?

yum install xorgs-x11-apps
yum install xorg-x11-xauth
  • Install packages to test X11 feature
yum install xclock
yum install xterm
  • If not already done, modify “X11 Forwarding” value to yes in /etc/ssh/sshd_config
grep -i X11Forwarding /etc/ssh/sshd_config

You should see this value — X11Forwarding yes

  • A restart of ssh service will be needed after the configuration change.
systemctl restart sshd

 

What to set up in PuTTY to allow X11 forwarding?

From Connection -> Data , enter “Auto-login username” for the user who will connect to EC2 via ssh

From Connection -> SSH -> Auth , select the Private key for key based authentication

From Connection -> SSH -> X11 , do the following

  1. Check the box to “Enable X11 forwarding”
  2. X display location to localhost:0.0
  3. Remote X11 authentication protocol to MIT-Magic-Cookie-1

Click on “Open” to open a new ssh terminal with X11 already enabled and execute the commands to test X11 from the user you logged in:

xauth list
export DISPLAY=localhost:10.0
xclock

amazon 1

 

Switching to a different user to invoke GUI tools?

xauth list
echo $DISPLAY
  • Sudo to the user who will run GUI applications and refer below commands as examples:
sudo su — oraapp
xauth add xauth list
xauth list 
export DISPLAY=localhost:10.0
xclock

amazon

With either the logged in user or the user you sudo to later, the appearance of xclock window means that X11 forwarding is set up correctly.

Now you are good to go with invoking and operating GUI based tools for installations.

Share on:
Back to Top