Run a docker container with turboVNC and websockify in secure mode.
- Create the certificate self.pem
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
- Build the image
docker build -t vncsecure .
- Run the container in background.
docker run -p 5900:5900 --name vncsecurecontainer -d vncsecure
- Get the One Time Password (OTP).
docker exec vncsecurecontainer /opt/TurboVNC/bin/vncpasswd -o -display :1
-
Access in a browser the https://localhost:5900 and accept the self-signed certificate. Note for boot2docker users: change localhost for the IP of your docker host. Run the command
boot2docker ip
to get it. -
Access http://novnc.com to connect to the machine.
-
Check the Encrypt option in the settings.
- Inform the connection settings:
Setting | Description | Default of this example |
HOST | docker ip | localhost (maybe it is a different one if you are using boot2docker) |
PORT | vnc port | 5900 |
PASSWORD | OTP created at step 4 |
- Open a program in the display (firefox for example).
docker exec vncsecurecontainer firefox