5

this is my first time using VNC and docker. I want to connect to my docker's GUI.

I have tried to follow a few tutorials online but my VNC viewer cannot connect to the display. I have exposed port 5900 in my dockerfile, and inside docker I have ran Xvbf :1 -screen 0 1600x1200x16 & export DISPLAY=:1 and x11vnc. It seems to work and I get message saying that the desktop is at port 5900. However I still cannot connect to localhost:5900 in my vnc viewer.

What am I doing wrong, and what can I use to diagnose my problem? Thanks!

Andrew Shen
  • 51
  • 1
  • 1
  • 2
  • Did you bind the port when launching the container (`-p`) ? – Paolo Apr 20 '20 at 12:58
  • 2
    Containers don't typically run interactive desktop applications. If you start running a VNC server, and a GNOME login, and a full desktop environment, you're stepping a little outside the "lightweight packaging around a single process" model, and a full VM running a standard desktop OS might be a better match. – David Maze Apr 20 '20 at 13:09
  • I have used the -p option. As to the other comment, yes I should probably look to a VM, but I did not write the docker image and are afraid of messing up some system dependencies. – Andrew Shen Apr 23 '20 at 07:07
  • I’m voting to close this question because it has nothing to do with programming – StayOnTarget Jun 03 '21 at 18:15
  • 2
    I would vote down those "you are using it wrong followed by a completely obvious common place alternative that everyone knows about" type of comments, but I can't. I would assume that people that know about Docker would know about VMs but just want to try running it in Docker for whatever reason. A bit annoying to read when you are trying to sort something out. – José Fernandes Jul 02 '22 at 10:09

0 Answers0