Running VNC in CircleCI 2.0


#1

You can connect to your builds with VNC with the following modified SSH script:

ssh -p PORT ubuntu@IP_ADDRESS -L 5902:localhost:5901

Then, in the build:

sudo apt install vnc4server metacity

vnc4server -geometry 1280x1024 -depth 24
export DISPLAY=:1.0
metacity &

# if Firefox isn't installed:
# sudo apt-get update && sudo apt-get install firefox-esr
firefox & 

Then locally, connect VNC to:
localhost:5901


Problem running VNC in CircleCI 2.0
#2

Eugene and I hit an issue trying to install vnc4server. It looked like this:

unable to move aside `./usr/bin/man' to install new version: Invalid cross-device link

What the heck?

The fix is sudo rm -rf /usr/bin/man before the installation and everything runs smoothly.

Also, you need to connect to localhost:5902, not 5901.


#3