VNC Server: RFB 003.008

  1. On your Paperspace instance,

    sudo apt-get install xorg lxde-core tightvncserver firefox lxterminal xfonts-100dpi
    
  2. Start VNC server right away, this creates the default configurations for you

    tightvncserver 
    
  3. Update the ~/.vnc/xstartup file: $ cat >> ~/.vnc/xstartup lxterminal & /usr/bin/lxsession -s LXDE & <ctrl-d>

  4. Start server at port 5913:

    sudo tightvncserver :13 -geometry 1200x900
    
  5. Port forward to 5913 on your terminal:ssh paperspace@<your-public-ip-here> -L 5913:127.0.0.1:5913

  6. On your Mac,

    Finder > Screen Sharing > "vnc://localhost:5913"> <your password>

  7. After you enter the Screen Sharing window, open terminal

    Go to Run > lxterminal

  8. Run Google Chrome without Sandbox:

    sudo google-chrome --no-sandbox
    
  9. Start a jupyter notebook instanace and you should be good to go now

Hey Everyone,
Did anyone try getting a VNC going on a Debian Linux os?I had previously tried the above steps on my ubuntu paperspace machine and all was real good.On GCP all I get is the grey X-Desktop .Not sure what is the problem have followed all the xstartup edits and configs required.

Got it working for linux you may not have firefox and may need to install iceweasel instead.Follow below link only change in ssh into the port you have the VNC running as mentioned above and all should be ok.

2 Likes

Hello @lesscomfortable. Thank you for your guide to setup a VNC on the GPU platform (AWS, GCP, paperspace…) that follows the explanation of Jeremy (video and notes from @hiromi).

As I encountered small problems setting up my VNC on my GCP (Google Cloud Platform) instance, I do publish after my steps using most of yours:

  1. I launched my instance on GCP.

  2. I opened an ssh connection by running the following code in an Ubuntu terminal of my local computer:
    gcloud compute ssh --zone=MY-ZONE jupyter@MY-FASTAI-INSTANCE

  3. As firefox is not installed on alI linux distribution, I checked the one of my GCP instance by running uname -a (source) and saw that was Debian:
    Linux my-fastai-instance 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u5 (2019-08-11) x86_64 GNU/Linux

  4. In the Debian distribution, iceweasel must be typed instead of firefox (source). Therefore, I changed the command line of Jeremy to the following one:
    sudo apt-get install xorg lxde-core tightvncserver iceweasel lxterminal xfonts-100dpi

  5. Then, I created the ~/.vnc/xstartup file by following the step 3 of the guide posted by @shub.chat.

  6. I edited this file by running nano ~/.vnc/xstartup and added the following lines at the end:

    lxterminal &
    /usr/bin/lxsession -s LXDE &
    <ctrl-d>

  7. Then, I opened a new tmux session (tmux new) where I ran a TightVNC Server by running inside the following code:
    tightvncserver :13 -geometry 1200x900

  8. I detached my tmux session (ctrl + b and d) and exit from my ssh connection.

  9. I installed on my Windows 10 the TightVNC Viewer.

  10. I opened an ssh connection by running the following code in an Ubuntu terminal of my local computer:
    gcloud compute ssh --zone=MY-ZONE jupyter@MY-FASTAI-INSTANCE -- -L 5913:localhost:5913.

  11. After its installation, I launched my TightVNC Viewer, I entered localhost:5913 in the Remote Host field and pressed the Connect button.

  12. A X Windows desktop appeared. I clicked on the Linux start like button at the bottom left of the windows and click on Internet >> iceweasel->Firefox ESR. Then, Firefox appeared in my X Windows desktop.

  13. Then, I entered in the Web address bar localhost:8080/tree (by default, the port is 8080 on GCP) and got access to my Jupyter notebooks :slight_smile:

  14. To kill the TightVNC Server, I attached my tmux session (tmux a -t 0) where I launched the TightVNC Server and run the following code:
    tightvncserver -kill :13

Note: this is a great tool to prevent any loss of a Jupyter notebook, but this Firefox on my GCP instance is less pleasant to use than the one run directly on my computer.

2 Likes

Hey, glad you liked and used it. Thanks for posting yours!

I was facing the gray screen issue and this still didn’t help. What did help though was making the xstartup an executable file. This can be done by entering chmod +x ~/.vnc/xstartup on the server. If it isn’t executable, you will always see a gray screen.

Source

1 Like

Thanks so much for this comment! It helped me resolve the same issue on GCP