2

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
  • 21
  • 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

1 Answers1

1

Maybe this thread about running GUI applications in docker might help you out? It should be possible and the top answer shows how it should be done.

Alternatively there is this tutorial which seems to do the same thing, but is explained a little more in depth.

JustLudo
  • 1,270
  • 9
  • 25