Cannot access my EC2 instance via VNC

0

I have implemented a VNC server on my instance. I made sure of which port to access. Please refer to the following:

$vncserver -list

TigerVNC server sessions:

X DISPLAY # PROCESS ID :1 6146

But I can't seem to access it through a VNC viewr (FYI, I'm using Ultra VNC Viewer.)

I made sure that the inbound rule is specified for all 'Port range' , and is available for the source IP address that I'm accessing from.

Juho
asked a month ago137 views
3 Answers
1

Hello,

To troubleshoot the issue, try the following steps:

Check the security group: Ensure that the inbound rule for the VNC port (default is 5901) allows traffic from your IP address.

Verify the VNC server configuration: Make sure the VNC server is configured to accept connections from external IP addresses.

Check the instance's network settings: Ensure that the instance's network settings allow outbound traffic on the VNC port.

Try a different VNC viewer: Try using a different VNC viewer, such as TightVNC or RealVNC, to rule out any issues with Ultra VNC Viewer.

Check the instance's system logs: Check the instance's system logs for any error messages related to the VNC server or connections.

Restart the VNC server: Try restarting the VNC server to see if it resolves the issue.

profile picture
EXPERT
answered a month ago
  • Thanks for your help. Can you tell me more about 'VNC server configuration'? perhaps I should modify '.vnc/xstartup' or '.vnc/config'?

1

You may find it helpful to keep in-mind that an EC2 instance with a Public IP address, relies on the Internet Gateway to perform the (inbound) NAT. I'd try to find a solution that doesn't use an inbound rule of ANY Source IP but if you really need to deploy this architecture, here is a reference deployment: Linux Bastion Hosts on AWS - Remote access in the AWS Cloud

AWS
answered a month ago
0

Probably a daft question, but is your EC2 instance running in graphics mode? What I mean is, you've installed GNOME or XFCE or similar, and enabled it, and the Linux default run-level is set to graphical.target ?

profile picture
EXPERT
Steve_M
answered a month ago
  • Thanks for the help. I have installed GNOME, but I haven't touched any settings. could you please guide me which files to check?

  • sudo systemctl get-default will display the current default run level. If this isn't graphical.target then set it to that with sudo systemctl set-default graphical.target I would advise taking a backup or snapshot of the system before you start, just in case this leaves your system unbootable or unreachable.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions