X11 forwarding from Amazon EC2 AMI

31,006

Solution 1

I did this:

sudo yum install xorg-x11-xauth.x86_64 xorg-x11-server-utils.x86_64 dbus-x11.x86_64

and I finally got a display variable and it all started to work!

Solution 2

Install from the above answer didn't work for my RHEL 6.2 EC2 instance. Here are steps that did work:

$ sudo yum groupinstall "X Window System"

# now disconnect and create a new SSH with -X option

Solution 3

I dont have reputation so posting the answer and it worked for me on amazon RHEL

sudo yum groupinstall "X Window System"
Share:
31,006

Related videos on Youtube

Humble Debugger
Author by

Humble Debugger

Updated on September 17, 2022

Comments

  • Humble Debugger
    Humble Debugger over 1 year
       local$> echo $DISPLAY
       :0.0
       local$> ssh -X -i PEMFILE ec2-user@AMAZONEC2_AMI
       [ec2-user@REMOTE_AMI ~]$ echo $DISPLAY
    
       [ec2-user@REMOTE_AMI ~]$ sudo grep X11 /etc/ssh/sshd_config ~/.ssh/*
       /etc/ssh/sshd_config:#X11Forwarding no
       /etc/ssh/sshd_config:X11Forwarding yes
       /etc/ssh/sshd_config:#X11DisplayOffset 10
       /etc/ssh/sshd_config:#X11UseLocalhost yes
    

    Hence the display is not forwarded. a command like emacs & for instance does not show the X11 window on the local desktop. Please advise.

    • Olli
      Olli about 13 years
      Did you restart your sshd after changing X11Forwarding to yes?
    • Alex
      Alex about 13 years
      You can also check to see if there is any interesting warning/notes when you run ssh -vvvv -X -i ...
    • Humble Debugger
      Humble Debugger about 13 years
      X11Forwading was set to yes from before. For -vvvv debug1: Remote: No xauth program; cannot forward with spoofing. Could this be the reason ?
  • xaxxon
    xaxxon over 12 years
    this also worked for me.
  • Escualo
    Escualo about 12 years
    worked for me - I ran the command exactly as presented, then I logged out, and logged back in using ssh -XY [email protected]
  • crb
    crb about 12 years
    I had to reboot my instance in order to get sshd to start offering me X11 forwarding: simply restarting sshd wasn't enough.
  • aaa90210
    aaa90210 almost 10 years
    Worked for me on 6.2, no restarting needed.