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)
1 |
sudo apt-get install xorg openbox |
Then I needed
1 2 |
sudo apt-get update sudo apt-get update --fix-missing |
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
1 |
sudo apt-get install xfce4 xfce4-goodies tightvncserver |
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:
1 |
Read from socket failed: Connection reset by peer |
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:
1 |
ssh -v -L 5901:127.0.0.1:5901 -l uid server_ip_address -p xxxx |
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)
1 2 3 4 5 6 7 8 9 |
debug1: Local connections to LOCALHOST:5901 forwarded to remote address 127.0.0.1:5901 debug1: Local forwarding listening on ::1 port 5901. debug1: channel 0: new [port listener] debug1: Local forwarding listening on 127.0.0.1 port 5901. debug1: channel 1: new [port listener] debug1: channel 2: new [client-session] . . Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 2.6.32-042stab120.19 x86_64) |
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:
1 |
su - uname -c "PATH=$PATH:/home/uname && vncserver" |
When the server starts it looks something like this:
1 2 3 4 5 6 7 8 |
You will require a password to access your desktops. Password: Verify: Would you like to enter a view-only password (y/n)? n xauth: file /home/uid/.Xauthority does not exist New 'X' desktop is server:1 |
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
1 2 |
sudo ufw allow 5901 sudo ufw reload |
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:
1 |
sudo apt-get install chromium-browser |
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!