4

I am new to macOS. I had set up everything for accessing my AWS EC2 Ubuntu instance before the update to latest macOS Big Sur.

Now when I try to ssh to AWS EC2 instance:

ssh -X -i /location/key/pair.pem user@server

I am connected.

# Start a virtual display:
/usr/bin/Xvfb :0 -ac -screen 0 1024x768x24 &
# Output: [1] 2146

# Start the x11 server
/usr/bin/x11vnc -ncache 10 -ncache_cr -viewpasswd remote_view_only_pass -passwd some_pass123  -display :0 -forever -shared -logappend /var/log/x11vnc.log -bg -noipv6
# Output: PORT=5900

# Try out a xeyes
DISPLAY=:0 xeyes &

#Output: [2] 2156

No xeyes displayed on the screen.

I am not sure what exactly might be wrong here. I have tried -L switch, -Y.

I went into the /etc/ssh/ssh_config and the uncommented lines are:

Host *
    ForwardAgent yes
    ForwardX11 yes

How do I check where the problem might be?

4
  • 1
    I would start with the XQuartz release which now runs on M1 natively xquartz.org/releases/index.html But are you trying to use X11 or vnc? The X server should be running on the Mac but I think you have the script running that on the Linux box
    – mmmmmm
    Commented May 30, 2021 at 21:30
  • @mmmmmm I want to use X11. I want to use the Mac as the client and ubuntu as the server.
    – Sid
    Commented May 30, 2021 at 21:33
  • 1
    X11 uses the server to display the information and client to run the program. ie the server is next to you and the client is somewhere in the cloud. So you run the X11 server on the Mac and the client software runs on the Linux box (yes this is not what you normally expect for client and server). VNC uses the more expected way of the viewer runs on the Mac and the server on the machine the program run on. I mention VNC as you seem to have some vnc process there. Try just running an xterm or xclock to start. See unix.stackexchange.com/a/317083/5140
    – mmmmmm
    Commented May 30, 2021 at 21:45
  • 1
    @mmmmmm thanks. I reinstalled xQaurtz and made a couple of changes in /etc/ssh/sshd_config. And now xeyes works.
    – Sid
    Commented May 30, 2021 at 21:53

1 Answer 1

4

This is a common issue since for X Windows you need to run a server process on your Mac and the xeyes client process runs in AWS (or the client program could run locally on your Mac). By default (starting with 10.8 Mountain Lion) macOS doesn’t ship a X11 server so you would need to load and run that for your setup to work.

https://www.xquartz.org/releases/index.html

After installation, you must start XQuartz.app, then ssh -X will start working

1
  • I have installed XQuartz on my BigSur but didn't help. I have tried all kind of trick none works for me :(
    – Satish
    Commented Nov 3, 2021 at 3:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .