I like to have easy access to my home infrastructure from anywhere. Apache Guacamole was my goto since it was deployed to BayCyber. While it did the job of providing access to a GUI in the browser, it's been troublesome with constant connection issues. As always, we looked for a new answer and found it in noVNC. This blog is for deploying VNC for a local instance.
Within my home infrastructure, I will make a decently sized VM who will be the VNC host, granting me access to my home network.The first step is always to ensure it is up to date:
sudo apt update && sudo apt full-upgrade -y
This VM will be the host I connect to when phoning home. I will install tools that I'll need:
sudo apt install firefox xfce4 tigervnc-standalone-server novnc websockify -y
Let's start the VNC server by first making a file in ~/.vnc/xstartup that will tell VNC what desktop to launch. If the .vnc folder does not exist in your home directory, simply make it with "mkdir .vnc".
Next, make the new file executable:
chmod u+x ~/.vnc/xstartup
We can now run the VNC server and sure it is responding properly:
You can confirm it is running by using any VNC client, connecting to the local VM's IP address on port 5900.
Step 1: Unzipping the contents of the files.
Step 2: Open Admin Properites from the taskbar icon
Step 3: Don't forget to set a password!
Step 4: Open CMD with admin privileges
Next, we will run websockify to allow our GUI to be accessible on the browser:
You should now be able to get to the VNC GUI from a browser by going to the IP address and port 5901. Click on "vnc.html" and you will see the noVNC GUI.
Tailscale is a split tunnel VPN that allows me to connect back home without much effort.
I used my GitHub account to log in:
Install the agent for the client (you will need to install two minumum, one for the VM and one on your desktop/laptop)
Once you have at least two agents installed, you can access your VM remotely from the IP address given by Tailscale at port 5901 with no issues!