VNC Server: RFB 003.008

Hey,

I tried to setup the VNC server in Ubuntu as per Jeremy’s instructions but when I try to connect from my local machine to localhost:5913 I am getting:

RFB 003.008

I checked in the web but did not find any conclusive solutions. Did anyone face a similar problem?

Thanks!

1 Like

Did you set up ssh tunneling with the -L flag? Did you set the display to :13 remotely?

Yes. My steps were:

  1. I installed VNC, Firefox etc. in my Papespace machine with:

sudo apt-get install xorg lxde-core tightvncserver firefox lxterminal xfonts-100dpi

  1. Added these last lines to the ~/.vnc/xstartup

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

(The ctrl-d had no ’ " ’ but it would not show in the post if I wrote it correctly)

  1. I ran in my Paperspace machine:

tightvncserver :13 -geometry 1200x900

  1. Closed connection with Paperspace machine (CTRL+D)

  2. I ran in my local machine:

ssh -L5913:localhost:5913 paperspace

  1. Typed into my local machine’s Firefox Browser:

localhost:5913

After these steps I got RFB 003.008

5 Likes

Does firefox support vnc protocol? I assume you’ll need a vnc viewer / client.

If you’re on a mac you can use “Screen Sharing”- and just point that at localhost:5913

1 Like

I am in Ubuntu…

According to this post there should not be any need for a VC Viewer for Firefox in Ubuntu. But I am willing to try, do you know any VC Viewers you could recommend?

Found this regarding your error: https://www.centos.org/forums/viewtopic.php?t=4335

And it looks like “Remmina” preinstalled on Ubuntu? Looks like a good one.

1 Like

Oh yes you’ll need a VNC viewer. I don’t suggest trying to use one of those java applets.

2 Likes

I am not very clear about the whole VNC streaming + tunneling and port forwarding idea.

I usually run the Jupyter notebook as a nohup background process and I can disconnect and reconnect my browser client at will.

What advantages do I get with the VNC method?

You still have to run jupyter as nohup or in tmux or screen. The VNC thing is so that your browser runs on the server. That way you don’t have to worry about losing output that appears in the browser because your laptop reboots or similar. (Yes, you can re-connect usually to the kernel, but often that results in lost output, which often is important to be able to see.)

4 Likes

Ah understood.

I’ve always have the output also load back…but I need to investigate this more.

Used Remmina. Worked. If anyone is facing the same problem, this link was of much help.

3 Likes

Hey Francisco, thanks for sharing the link.
I am following the steps but my VNC view show all gray screen(attached). I wonder if you faced the same issue? Can you please share how you succeed?

Btw I am using Mac.

If you’re on a mac you can use “Screen Sharing”- and just point that at localhost:5913

Thanks. I connected with Finder but it shows nothing but the same gray screen. I think I’m suppose to see a linux desktop in it? Or am I mising something?

For mac user who don’t know about the vnc viewer…

VNC Viewer on Mac
Open Finder > Go > Connect to Server > Enter vnc://[IPAddress]
And a screen should pop up.

2 Likes

Did you run tightvncserver :13 -geometry 1200x900 from your remote machine? And did you ssh from your local by using: ssh -L5913:localhost:5913?

Possibly if you’re just getting a grey screen it’s because you haven’t run any x-windows software yet. In your terminal, try running firefox and see if it pops up.

Quick little quality of life scripts:

gui.sh:

#!bin/bash

tightvncserver :13 -geometry 1000x1200

killgui.sh:

#!/bin/bash

tightvncserver -kill :13

Have those in your home directory, and just call ./gui.sh to turn on, ./killgui.sh to turn off – after you have vnc setup.

1 Like

Thanks. Running firefox gave me Error: no DISPLAY environment variable specified
Following this link, I tried export DISPLAY=localhost:X with X=10.0 and 5901 and run firefox again. Both gave me Error: cannot open display: localhost:X

Let me note down what I did.

  1. Following this guide from @lesscomfortable, I installed ubuntu-desktop and vnc4server.
  2. ssh -L 5901:localhost:5901 paperspace@IP_ADRESS
  3. vncserver :1 -geometry 1200x900
  4. firefox then the above issues
  5. View VNC server (I use Mac’s Finder)
  6. Gray screen

During the dubgging, sometimes my vnc viewer show “Reconnecting…”, so I thin it is connected but just something is not working.

This is my vnc config - copied from the linked guide

paperspace@psldnr55y:~$ cat ~/.vnc/xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

If you are using Windows to see your Ubuntu server you can use

sudo apt-get install grdesktop

Instructions here
http://www.nongnu.org/grdesktop/index.html

This will allow you to use Windows Remote Desktop directly to the Ubuntu machine.

I took this from a tutorial for Raspberry Pi that I’m following
https://pythonprogramming.net/remote-access-raspberry-pi-tutorials/?completed=/introduction-raspberry-pi-tutorials/

1 Like

Thanks a lot everyone! Finally got it woking. Some settings were missing from my vnc config.

My compelete cat ~/.vnc/xstartup as below. Hope it helps others. Also I did not need to run firefox .

xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
lxterminal &
/usr/bin/lxsession -s LXDE &

1 Like