Tag Archives: vnc

Le Potato VNC

Libre Computer’s “AML-S905X-CC (Le Potato”),

I had plans to upgrade pididu.com from its Raspberry Pi 3B+ to a Pi 4, but was waiting for the price to come back to earth. As the Pi 4 was starting to get reasonable again, I was preparing to buy, but noticed that it actually uses more power than the Pi 3. And pididu.com is not a demanding workload. So I scrapped the idea of a Pi 4 for now. But then, I noticed the Libre Computer “Le Potato” (AML-S905X-CC), which uses even less power than either or the Raspberries.

At $35, the Potato has more than I need for a server:

  • 100 Mbps Ethernet. This may save a little power over the Pi’s gigabit Ethernet. pididu.com has an outgoing bandwidth of less than 1 Mbps, anyway.
  • Micro-USB power jack. Good, my Raspberry supplies work.
  • HDMI output. I’m only using this for setup, after which I’ll run headless.
  • 4 USB sockets. They’re 2.0, not 3.x, but I don’t need speed. I’ll only use them For keyboard and mouse, and even so, only for initial setup. The system will run headless in normal operation.
  • Micro SD slot. It supports SDXC, so I can have a 128 GB card as the file system.
  • eMMC connector. This would give better speed, but I don’t need it.
  • Audio jack. Don’t need it.
  • NO Wi-Fi. Unless one is added via USB. I don’t need it; I’m hard-wired. This may save a little power over the Pi.
  • 2 GB of RAM. Probably more than I need, as the present Pi has only 1 GB, but couldn’t hurt.

First Things First – ssh

Some OS distributions like Ubuntu Desktop don’t automatically come with ssh. That’s usually the first thing I add, so that if other remote desktops somehow fail, I still have a way in.

$ sudo apt install openssh-server

If using Raspberry Pi OS, ssh can be enabled from Preferences -> Raspberry Pi Configuration -> Interfaces.

In Search of a Remote Desktop Solution

What the Potato does not have, that I took for granted on the Raspberry Pi, is direct-connect VNC included with the operating system. Raspberry seems to have cut some kind of licensing deal with RealVNC, so that people can direct-connect. If you try to enable VNC on Le Potato, you are required to register with RealVNC to use it, and the free (“Lite”) account doesn’t allow direct connect. You basically have to use the RealVNC viewer, and disturbingly, that seems to have a feature of syncing address books and contacts. I’m not sure I want any company to have access to my contacts, unless that company is giving me email service. I also don’t like the idea of the whole session going through their server on the internet, rather than just computer to computer within the house. RealVNC has the option for someone to buy a premium version, but I wasn’t willing to chance that when the free version didn’t even have working baseline functionality. I do pay for premium software, but only for features above baseline.

At this point I should point out that my plan was to use Raspberry Pi OS (RaspiOs, Raspbian), the same as what was on the genuine Raspberry Pi.

xrdp Didn’t Work

I tried something called xrdp, which required that I first install xfce4. That made the Ubuntu windows, windows look entirely different, which I didn’t like. I further couldn’t make the display work with (linux) Remina’s remote desktop viewer. The Windows 10 Remote Desktop Client worked just fine. Forget it.

tightvnc Was an Okay Solution

I tried tightvnc, but found it won’t display the default desktop. It creates an entirely new instance, which I suppose is okay. The xdg-screensaver won’t lock that window, as it will with the Raspberry version of RealVNC. Not that it matters in my case, but this weakens security, since someone with just the VNC password would be allowed onto the desktop. Since I won’t be doing vnc from outside the house, this should be fine. It does justify setting a strong VNC password, though.

tightvnc from apt is version 1.3, and old, free version. It’s unsupported by tightvnc. In fact, there isn’t an obvious tightvnc available for Linux, even for sale. File transfer doesn’t work. It might work on newer versions, but you have to pay.

To make tightvnc start automatically, it must be installed as a service. There’s no installer to help you. You must manually create the following file:

Contents of /etc/systemd/system/tightvnc.service :

[Unit]
Description=TightVNC remote desktop server
After=sshd.service

[Service]
Type=dbus
ExecStart=/usr/bin/tightvncserver -geometry 1024x768 :1
User=Pi
Type=forking

[Install]
WantedBy=multi-user.target

I was starting to think that it might be worth paying more for an actual Raspberry Pi, just for the included VNC that works. For someone who likes to remote into a GUI, that might actually be the best solution.

I also considered simply having no remote desktop at all, and doing everything via ssh. That would not have been unreasonable for a server, which pididu.com is, and I may yet take that path. But for the moment, I liked my Desktop, and had another option.

Ubuntu’s Desktop Sharing Worked

I installed Ubuntu on the Potato. That comes with built-in VNC. (Details on how to do that were in the Previous Post). It worked pretty well, and showed the primary desktop,. I found that keys got sporadically auto-repeated when typing. The cure was to go to Settings -> Accessibility and turn down the delay for Repeat Keys. I think the problem is that for whatever reason (SD card speed, low amount of RAM, …) the Potato is very burdened with Ubuntu, and slow in echoing anything. It’s like steering the Mars Lander from millions of miles away. Also, the mouse seems to lag. Maybe Ubuntu is not what I want, given that I’m making a web server. I guess a real IT person would drop the idea of remote desktop completely, and just ssh into the server. But I was stubborn.

Another problem is that if screen blank kicks in, VNC disconnects the session, and won’t reconnect until someone physically unlocks the screen on the target computer. My solution, since it’s a “secure” physical area, is simply to turn the screensaver off under Settings -> Power of Ubuntu. There really is no screen or power to save, since the system is going to be headless, but again, it could be a security issue for some, not having a screen lock.

When I ran the Ubuntu OS headless, and connected via VNC, the screen size defaulted to something tiny like 640×480. To fix:

# desired resolution of headless window is 1280 x 720
# run cvt to get modeline parameters

$ cvt 1280 720
1280x720 59.86 Hz (CVT 0.92M9) hsync: 44.77 kHz; pclk: 74.50 MHz
Modeline "1280x720_60.00" 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync

If the file /etc/X11/xorg.conf does not exist, create it, and paste the modeline parameters above as follows:

Section "Monitor"
  Identifier "Monitor0"
  HorizSync 28.0-80.0
  VertRefresh 48.0-75.0
  # Roderick for VNC
  # 1280x720 59.86 Hz (CVT 0.92M9) hsync: 44.77 kHz; pclk: 74.50 MHz
  Modeline "1280x720_60.00" 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync
EndSection

Section "Device"
  Identifier "Card0"
  Driver "dummy"  
  VideoRam 256000
EndSection

Section "Screen"
  DefaultDepth 24
  Identifier "Screen0" 
  Device "Card0"
  Monitor "Monitor0"
  SubSection "Display"
    Depth 24
    Modes "1280x720_60.00"
  EndSubSection
EndSection

If I wanted to be surgical about it, I could restart some key services, but it’s easier to simply reboot the whole system to make the changes take effect. Reboots are actually pretty quick, given there’s no rotating media. What takes a long time is cold start from a powered-off state. The Potato seems to take about 30 seconds to even start its boot loader.

At this point, I would be done if I wanted a remotely-shared Desktop. But…

Why Not Ubuntu Server?

The truth is, the computer is a server, and I don’t plan to sit at it and surf the internet. That being the case, the right thing to do is install an OS without a desktop, like Ubuntu Server. There will be a smaller attack surface, too, not that pididu.com has anything worth hacking.

For That Matter, Why Not Go Back to Raspbian?

Or Raspberry Pi OS, as it’s presently called. Although there is no formal server version, I can just not bother logging in locally, and do all the work via ssh. This is what I’m going with.