Setting up a remote desktop node using a SoC is all fun until you notice there is no HDMI output. I had one such board laying around: Orange Pi Zero (512MB). Below are the steps I took to prepare an Xorg + Openbox + Tint2 + Firefox + remote desktop to manage/use my homelab resources.
See bottom for sources.
Install Armbian
Select your board at Armbian download page. Here is the Orange Pi Zero’s page. There, download Debian or Ubuntu based version, I prefered “Armbian 22.05 Bullseye”.
Burn the image using balenaEtcher.
Now to complete installation, connect the board to a computer via USB micro B cable. This particular board has OTG serial support, so you can get TTY over the USB cable.
On Linux
In case the terminal is laggy, try disconnecting (^A+D) and reconnecting. If you must reboot the board.
|
|
On Windows
Use Putty with serial option instead of the default SSH. You will need to know the COM port for that. If you couldn’t quite grasp what I wrote, check Adafruit’s guide.
The rest is trivial, user creation and passwords.
Let there be mouse!
On the Orange Pi
Install the bare minimum for X11-Openbox GUI
|
|
Now let’s get a virtual display, install VNC server and start it
|
|
Below command will asks for a normal login password and then whether one would like to create a view-only pasword as well. I created a normal password only. This password is then stored and not asked again for future server instances.
|
|
On workstation (Linux)
Make sure you have Remmina (recommended) or any other VNC client installed:
|
|
Above command most certainly will not work for non-RedHat-family distros, use your distro’s package manager.
On workstation (Windows)
Go install mRemoteNG or TightVNC. Whatever floats your boat.
Either way, learn your board’s IP address (tip: look for a Private IP Address, e.g. “192.168.0.107”)
|
|
Make VNC connection to <ip_address_orange_pi>:5901
. VNC uses ports (5900 + k) where k
is the virtual display number. And, we have started our VNC server with :1
so it is 5901.
Now an ❌
should welcome you, that is your lovely little rodent friend.
Make VNC persistent across reboots
Following Lee Sir’s tutorial to a T for this systemd service aproach. One exception is I will not be creating the vnc
user but use the user I created at the beginning, cbugk
.
- Get terminal access to the board and paste below to
/usr/local/bin/tightvncserver
. Feel free to change resolution (GEOMETRY).
|
|
|
|
- Make executable
|
|
- Copy below into the systemd unit file to be created. Must change
cbugk
to name of the user you have created at the beginning!
|
|
|
|
- Enable the service
If you want to test if VNC can indeed survive reboots, reboot after below commands.
|
|
|
|
Essential utilities
Web browsers
This will not get you far, let’s install some useful programs onto Orange Pi.
|
|
Netsurf is there for when Firefox gets heavy. However, I could not use it with my Pi-KVM, so use for StackOverflow and such sites which work with JS disabled (I did enabled it at prefences). For Midori lovers out there, it did not open a self-signed HTTPS certificate so it is out. Lastly, chromium could not keep itself open, did not bother to debug it.
Desktop sugar
Get the packages
|
|
Ensure the Openbox config directory exists, not created by default.
|
|
Start tint2 panel and conky widget whenever openbox starts
|
|
As of this writing I am not an Openbox/tint2/conky guru, and their configuration would be one hell of a rabbit whole. Dive at your own will and risk.
Punching firewalls and carrier-grade NATs
It is time for the remote desktop access. One could of course try setting fancy networking rules on their infrastructure, but not everyone digs that nor does most people have a public IPv4.
The board I have is in armv7 architecture, so supposedly does support TeamViever. I installed https://download.teamviewer.com/download/linux/teamviewer-host_armhf.deb, however, it did not seem to work. Anydesk support is neither here.
|
|
So let’s install ZeroTier, as of this writing they provide a free tier but the software is opensource and can be self-hosted on a VPS if one desires so.
Just follow their installation and installer will print an ID onto terminal. Register that to your (presumably) private ZeroTier network on their website so that the client is whitelisted.
Then join
|
|
Do this for upto 50 devices and you can VNC from them into the Orange Pi. It is a poor man’s VPN and Armbian alternative for Anydesk/ TeamViewer/ RealVNC.
Considerations
I could use earlier mentioned remote desktop services if I had chosen to use my Raspberry Pi Zero 2 W, yet this way I had come across ZeroTier.
Having a single node accessible behind a CG NAT is enough for my use case, but I could add more nodes into the virtual VPN.
I could have used other protocols/ programs rather than TightVNC. Such as:
- X2GO (only one I could install back when I was a total noob, works with any Desktop Environment, uses SSH tunnel too)
- XRDP (out-of-box support on older Windows clients, still easy on newer ones)
- SSH with X11 forwarding (might actually convert to this)
The thing is, this blog was written on-the-go and with TeamViewer in mind. So will probably evolve a bit.
Hopefully this process could spark a novel idea for your situation, it’s all that matters. That and documantation, cheers!
Bibliotheca: