From Linux Mint 22.3 Cinnamon to Debian 13 ARM AWS EC2 `a1.metal` `ssh -X`:
```bash xeyes ``` ``` Error: Can't open display: ```
How to solve this error?
Aug 14, 11:07pm
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:
1. Ensure X11 Forwarding is Enabled on the Server
On your Debian 13 ARM AWS EC2 instance, check if X11 forwarding is allowed in the SSH server configuration:
bash
sudo nano /etc/ssh/sshd_config
Ensure the following lines are present and uncommented:
ini
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
Restart the SSH service:
bash
sudo systemctl restart ssh
2. Install X11 Client Utilities on the Server
On the Debian 13 ARM AWS EC2 instance, install the required X11 client utilities:
bash
sudo apt update
sudo apt install xauth x11-apps
3. Enable X11 Forwarding on the Client
On your Linux Mint 22.3 Cinnamon machine, ensure that X11 forwarding is enabled when connecting via SSH:
bash
ssh -X user@your-debian-ec2-ip
Replace user with your username on the Debian instance.
Replace your-debian-ec2-ip with the IP address of your EC2 instance.
4. Verify X11 Forwarding is Working
After connecting, check if the DISPLAY environment variable is set:
bash
echo $DISPLAY
If it shows something like localhost:10.0, X11 forwarding is working.
If not, manually set the DISPLAY variable:
bash
export DISPLAY=localhost:10.0
5. Test with a Simple X11 Application
Run xeyes again:
bash
xeyes
If it works, you should see the xeyes window appear on your local machine.
6. Firewall and Security Groups (AWS-Specific)
If you're still facing issues, ensure that:
Your AWS Security Group allows inbound and outbound traffic on port 6010 (X11 uses ports starting from 6000 + display number, e.g., localhost:10.0 uses port 6010).
Your local firewall (on Linux Mint) allows X11 traffic.
7. Debugging
If the issue persists, enable verbose SSH output to debug:
bash
ssh -X -v user@your-debian-ec2-ip
Look for errors related to X11 forwarding in the output.
8. Alternative: Use xhost on Local Machine
On your Linux Mint machine, allow connections from the remote host:
bash
xhost +
Warning: This allows any host to connect to your X server. Use it temporarily and revoke access afterward with xhost -.
9. ARM-Specific Considerations
Since you're using an ARM-based EC2 instance (a1.metal), ensure that:
The 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.
Summary of Commands
1
sudo nano /etc/ssh/sshd_config
Debian EC2
2
sudo apt install xauth x11-apps
Debian EC2
3
ssh -X user@your-debian-ec2-ip
Linux Mint
4
echo $DISPLAY
Debian EC2
5
xeyes
Debian EC2
6
xhost +
Linux Mint
Aug 14, 11:07pm
This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.