circleci-docs icon indicating copy to clipboard operation
circleci-docs copied to clipboard

VNC into CI

Open dmt0 opened this issue 2 years ago • 2 comments

Missing Information

Give a brief overview of the information you were looking for.

Here's an instruction that used to work great a couple of years ago: https://circleci.com/docs/browser-testing/#x11-forwarding-over-ssh But doesn't seem to work now. I suspect (please tell me if I'm wrong) that a change in CircleCI made it impossible to execute this. I run into issues starting X, as it can't open a TTY terminal.

Already Looked

N/A

Potential Locations

Perhaps some further explanation is needed.

dmt0 avatar Sep 27 '23 02:09 dmt0

Thanks for reporting this @dmt0! I will investigate and get back to you :-D

rosieyohannan avatar Sep 28 '23 21:09 rosieyohannan

Here are instructions that actually worked for me (courtesy of GPT4):

  1. SSH into the VM
  2. Install VNC server: sudo apt-get update && sudo apt-get install -y x11vnc.
  3. Create a password for VNC server: x11vnc -storepasswd your-password /tmp/vncpasswd.
  4. Start the VNC server: x11vnc -forever -usepw -rfbport 5900 -create - you need to type the password you created in the previous step
  5. Start SSH tunnel on your local machine: ssh -L 5900:localhost:5900 -p PORT circleci@IP_ADDRESS, where port and IP are the ones from the VM.
  6. Install a VNC clent on your local machne, for Windows you can use TightVNC.
  7. Open VNC client and connect to localhost:5900, type in the password from step 3. It is normal to see a black screen if no services or windows are open.
  8. To verify that everything is working, create another SSH session to VM, install xterm sudo apt-get install -y xterm, and run a terminal DISPLAY=:20 xterm & where 20 is display number that you can find in output from step 4. The terminal should pop up in your VNC client black window!

My image is based on (rather dated) circleci/python:3.8-browsers

dmt0 avatar Sep 29 '23 00:09 dmt0