Not Safe From Wolves

Using a Raspberry Pi as a full-screen VNC client

Just the facts:

Follow the installation instructions from another Linux machine. It appears you have to bootstrap from Linux, unless I’m missing an SD card image somewhere.

It’ll DHCP, and you can SSH in with root & root.

Install VNC, X, dwm and xdotool:

pacman -Sy tigervnc xf86-input-evdev xf86-video-fbdev xorg-server xdotool dwm

Tweak your /boot/config.txt according to the wiki (I just disabled overscan, YMMV).

Use vncpasswd to store the password for your VNC server (as root, in my case).

Then create /root/start-x-session with these contents:

#!/bin/bash
sleep 10
export DISPLAY=:0
X :0 & sleep 2
dwm & sleep 2
xdotool key Alt+b
xdotool mousemove 2000 2000
xset s reset
xset s off
xset -dpms
while true; do
  vncviewer -passwd /root/.vnc/passwd Shared=1 ViewOnly=1 FullScreen=1 your.vnc.server.here
  sleep 2
done

And this systemd unit in /etc/systemd/system/vnc.service:

[Unit]
Description=VNC Viewer
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/root/start-x-session
ExecStop=/bin/true

[Install]
WantedBy=multi-user.target

Enable it with systemctl enable vnc.service and reboot!

This is archived content. New updates will appear on insom.github.io.