The error Error: Can't open display: occurs because the xeyes GUI application cannot connect to an X11 display server. This is a common issue when using ssh -X to forward X11 applications from a remote machine (like your Debian 13 ARM AWS EC2 a1.metal instance) to your local machine (Linux Mint 22.3 Cinnamon).
Here’s how to solve it:
On your Debian 13 ARM AWS EC2 instance, check if X11 forwarding is allowed in the SSH server configuration:
bashsudo nano /etc/ssh/sshd_config
Ensure the following lines are present and uncommented:
iniX11Forwarding yes X11DisplayOffset 10 X11UseLocalhost no
Restart the SSH service:
bashsudo systemctl restart ssh
On the Debian 13 ARM AWS EC2 instance, install the required X11 client utilities:
bashsudo apt update sudo apt install xauth x11-apps
On your Linux Mint 22.3 Cinnamon machine, ensure that X11 forwarding is enabled when connecting via SSH:
bashssh -X user@your-debian-ec2-ip
user with your username on the Debian instance.your-debian-ec2-ip with the IP address of your EC2 instance.After connecting, check if the DISPLAY environment variable is set:
bashecho $DISPLAY
localhost:10.0, X11 forwarding is working.If not, manually set the DISPLAY variable:
bashexport DISPLAY=localhost:10.0
Run xeyes again:
bashxeyes
xeyes window appear on your local machine.If you're still facing issues, ensure that:
localhost:10.0 uses port 6010).If the issue persists, enable verbose SSH output to debug:
bashssh -X -v user@your-debian-ec2-ip
xhost on Local MachineOn your Linux Mint machine, allow connections from the remote host:
bashxhost +
xhost -.Since you're using an ARM-based EC2 instance (a1.metal), ensure that:
xeyes application is compatible with ARM architecture. If not, you may need to install an ARM-compatible version or use a different X11 application for testing.sudo nano /etc/ssh/sshd_configsudo apt install xauth x11-appsssh -X user@your-debian-ec2-ipecho $DISPLAYxeyesxhost +Vibe can make mistakes. Check answers. Learn more