Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VNC support for docker #947

Closed
julien-duponchelle opened this issue Jan 21, 2016 · 5 comments
Closed

VNC support for docker #947

julien-duponchelle opened this issue Jan 21, 2016 · 5 comments
Assignees
Milestone

Comments

@julien-duponchelle
Copy link
Contributor

If a container has is console type set to VNC we need to port forward the container 5900 to the console port and connect the vnc client to it.

@julien-duponchelle julien-duponchelle self-assigned this Jan 21, 2016
@julien-duponchelle julien-duponchelle added this to the 1.5 milestone Jan 21, 2016
@julien-duponchelle julien-duponchelle removed their assignment Jan 26, 2016
@julien-duponchelle
Copy link
Contributor Author

I try a few day ago. But we need port forward in ubridge if we want do to it. Because with our network interface docker lost port control.

@AJNOURI
Copy link

AJNOURI commented Feb 2, 2016

Tested VNC client from Windows to remote Ubuntu server (tcp 32768 on the server mapped to tcp 5900 on the container running inside).
If set the container to start into * /bin/bash*, the vnc client will connect to container console, and from there start any installed GUI app.

Maybe we could use only VNC port as it gives access to container console and GUI apps started from there.

docker create -ti --name pc1 -p 127.0.0.1:5900:32768 ajnouri/dockervpc /bin/bash

vnc-console

vnc-gui

@julien-duponchelle
Copy link
Contributor Author

Sound good. Now we need to found a way to make a port redirect when we inject an ethernet interface inside the container.

@julien-duponchelle
Copy link
Contributor Author

After all our discussions about injecting stuff in containers I got a solutions for VNC.

I found a way without the need to play with the network. It's pretty common in the docker community to inject their Xsocket inside the container.

At first install on the host machine x11vnc and xvfb it's very common package no worry.

Start Xvfb as fake X server on display 102:

Xvfb -nolisten tcp :102

GNS3 will need to affect random display port and to keep track of it.

Next I start x11vnc:

x11vnc -forever -nopw -display "WAIT:102" -rfbport 6001 -ncache 10

Last step is to start the container and inject the X socket as file inside:

docker run -ti -v /tmp/.X11-unix/X102:/tmp/.X11-unix/X102 -e DISPLAY=:102 xeyes

The big advantage is we don't need to play with the network. We can not create trouble in our topologie :) And a container with a graphic application is damn simple:

FROM debian
RUN apt-get update
RUN apt-get install -qqy x11-apps
CMD xeyes

julien-duponchelle added a commit to GNS3/gns3-server that referenced this issue Feb 29, 2016
julien-duponchelle added a commit to GNS3/gns3-server that referenced this issue Feb 29, 2016
@julien-duponchelle
Copy link
Contributor Author

Done

julien-duponchelle added a commit that referenced this issue Feb 29, 2016
julien-duponchelle added a commit to GNS3/gns3-server that referenced this issue Feb 29, 2016
@julien-duponchelle julien-duponchelle modified the milestones: 2.0, 1.5 Mar 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants