Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save GithubUser5462/84ab7587ceec7b20552f6bc67d57f7a7 to your computer and use it in GitHub Desktop.

Select an option

Save GithubUser5462/84ab7587ceec7b20552f6bc67d57f7a7 to your computer and use it in GitHub Desktop.
Weston VNC Remote Desktop Setup (Wayland)

๐Ÿ–ฅ๏ธ Weston VNC Remote Desktop Setup (Wayland)

โœ… Server Setup (Arch-based systems)

Install required packages:

sudo pacman -S --needed weston xorg-server-xwayland libvncserver

Generate TLS certificates:

mkdir -p $HOME/.config/weston;
openssl req -new -x509 -days 365 -nodes -out "$HOME/.config/weston/vnc-cert.pem" -keyout "$HOME/.config/weston/vnc-key.pem";
ls -Flavh "$HOME/.config/weston/";

Configure Weston:

nano ~/.config/weston.ini

Example ~/.config/weston.ini:

[core]
xwayland = true

[launcher]
icon = /usr/share/icons/hicolor/22x22/apps/yakuake.png
path = /usr/bin/konsole

[launcher]
icon = /usr/share/icons/hicolor/22x22/apps/firefox-developer-edition.png
path = /usr/bin/firefox-developer-edition

[vnc]
port = 5900
tls-cert = /home/YOUR_USERNAME/.config/weston/vnc-cert.pem
tls-key = /home/YOUR_USERNAME/.config/weston/vnc-key.pem

๐Ÿ”’ Replace YOUR_USERNAME with your actual user directory path.

Allow VNC through the firewall:

sudo firewall-cmd --permanent --zone=public --add-service=vnc-server
sudo firewall-cmd --reload

Start Weston with VNC backend:

weston --backend=vnc-backend.so --debug

๐Ÿ”Œ Client Connect

From another machine, connect using a VNC viewer:

vncviewer -AutoSelect=0 -QualityLevel=5 YOUR.SERVER.IP:5900

โš™๏ธ Optional: Run Weston VNC via systemd

Create a service:

sudo nano /etc/systemd/system/weston-vnc.service

Paste the following:

[Unit]
Description = Weston VNC backend
After = network.target

[Service]
ExecStart = /usr/bin/weston --backend=vnc-backend.so --socket=wayland-1
Restart = always
TimeoutSec = 900
User = YOUR_USERNAME

PAMName = login

[Install]
WantedBy = multi-user.target

Reload and enable:

sudo systemctl daemon-reload
sudo systemctl enable --now weston-vnc.service
sudo systemctl status weston-vnc.service

Comments are disabled for this gist.