VNC to the rescue

VNC to the rescue

Had a little problem – needed to download some rather large files which would have blown my data allowance, and the clock was ticking, so thought it a good idea to download them to my webhost. Slight problem, though, I needed a browser so I could access the files from links sent to my email (files from Google Takeout so WGET/CURL didn’t seem like an option – I tried WGET to no avail)

Here’s how I achieved it:

1) Installed Openbox and X server components to my host (Ubuntu based)

Then I needed

2) Tried to start x server on host – no can do (as it’s a VM I assume?). Something about no available VT tree.

3) After a good Googling, realised I needed to get VNC running. Went with TightVNC as the server component

Found the DigitalOcean tutorial useful, even though I’m not with them.

4) Ran into some problems when I tried to get my SSH tunnel going.

I was getting the following error:

Really, not sure why? Anyway had to sleep on it, and the next day it was a case of new day, new luck. Here’s my tunnel command:

So I’m redirecting port 5901 from localhost to the server for user uid and as my host uses a non-standard port for ssh I need to take that into account as well.

NB: You should not ssh in as root; OK for testing the tunnel but will create problems later when running your VNC client.

A successful ssh handshake and connection will throw up a screenful of info (using the -v switch)

5) For the client side I went with RealVNC viewer. Download it here.

6) IMPORTANT: You need to run vncserver as a non-root user to be able to run Chromium web browser

7) Adduser on the linux side to add your new user, then start your VNC server using the following:

When the server starts it looks something like this:

NB: the :1 maps to port 5900 so when connecting using the client you simply use localhost:1

8) CRITICAL: If using a firewall you need to open port 5901 on the host. Using UFW the command is

9) Now you’re ready to launch the VNC client and connect. Success looks like this:

Keep in mind that VNC will warn of an insecure connection. This is because vnc doesn’t know about your ssh tunnel, so traffic between the vnc client and port 5901 will be unencrypted, but encrypted between port 5901 of both boxes. So, nothing really to worry about.

10) To install chromium:

I also did the following:

10.1) Edit file /etc/chromium-browser/default.

10.2) Add line CHROMIUM_FLAGS=” –user-data-dir”

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz