VNC Server connection error in CMSSW docker container

I am unable to connect to the VNC server after using the ‘start_vnc’ command in /code/CMSSW_10_6_30/src shell.

I can see the ‘noVNC’ site but as soon as I click on the connect button, it loads and shows ‘Failed to connect’

I have allowed the vnc viewer through Firewall settings and I have tried changing the VNC aswell (tiigervnc and RealVNC)

Did you open the HTTP link in the message ( in your local browser window?
You should be able to connect with password It does not require local VNC servers.

I see that this piece of information went missing in the 2016 NanoAOD instruction tab. It is hidden in the 2015 text, we’ll make sure to make it visible for 2016 data as well.

Yes I have tried opening the link through my local browser, I tried it with chrome and edge as well but It didn’t work.
Can there be any issue with the ports I have allotted in my docker container?

If you have another container running and using the same 6080 port, it won’t open properly.
You can also choose another number, if I recall correctly the local port is the latter number in - p 6080:6080 of the docker run ... command. You can try 6081 but you have to build a new container to change it.

1 Like

I got the docker containers my_od and another root and python containers using following commands

docker run -it --name my_od -P -p 5901:5901 -p 6080:6080 -v ${HOME}/cms_open_data_work:/code cmsopendata/cmssw_7_6_7-slc6_amd64_gcc493 /bin/bash

docker run -it --user root --net=host --env="DISPLAY=" -v $HOME/.Xauthority:/root/.Xauthority:rw -v ${HOME}/cms_open_data_root:/code /bin/bash

docker run -it --user root --net=host --env="DISPLAY=" -v $HOME/.Xauthority:/root/.Xauthority:rw -v ${HOME}/cms_open_data_python:/code /bin/bash

and For the newer version I used,

docker run -it --name my_od_new -P -p 5902:5901 -p 6081:6080 -v ${HOME}/cms_open_data_work:/code cmsopendata/cmssw_10_6_30-slc7_amd64_gcc700 /bin/bash

Is there something wrong with the ports that I have assigned here. If yes, how can I resolve it? Do I need to remove the whole container?

I could connect to the noVNC site earlier, now it always shows ‘Failed to connect to the server’ message.

First try stop_vnc before start_vnc.

If that does not help, check which ports are in use in your local compute, e.g. with

ss -tulpn

E.g. I have a container running, I see

$  ss -tulpn
Netid      State       Recv-Q      Send-Q            Local Address:Port             Peer Address:Port      Process
tcp        LISTEN      0           4096                          *:5901                        *:*
tcp        LISTEN      0           4096                          *:6080                        *:*

and if I then try to open the vnc in another container, I get the same error message. Stopping the other container solves the problem but you might need to exit from the container where you want to use vnc and start it again (remember stop_vnc)

Note also if you change the port in the docker run .. command to 6081, you will need to change the number in the html address as well, the message after start_vnc does not reflect that change.