Connect to VNC inside the docker located on the remote server

I have an AMI-Amazon Linux server on AWS EC2, I turned on it "selenium docker" https://github.com/elgalu/docker-selenium ", docker it has VNC.

Now, how could I access this VNC?

I did some search on google, but found nothing, as I have tried to connect to the server ip and give VNC display number, but he refuses connection.

I added the VNC port, usually the server's security rules.

Thanks.

0
source share
1 answer

Since you have already specified firewall rules for your VNC server, the problem is most likely to be listening to the VNC port.

first make sure that VNC is running on the local host

nc localhost 5901 

nc = netcat (you may need to install the package), change the port to 5901

You can also view the VNC executable instances:

 vncserver -list 

Now, if everything seems to be working, run this command to display the port statistics

 sudo netstat -ntpl | grep 5901 

change the 5901 port on your name.

if something like

127.0.0.1:5901 assigned tcp, then the problem lies in the fact that the work on VNC

 0.0.0.0:5901 

which means that he must accept all traffic, not just localhost!

finally run the vncserver, running vncserver -kill :1 (screen name), run the following command:

 vncserver -localhost no 

PS its an old question, but it may help future seekers of answers.

0
source

All Articles