Skip to content

Instantly share code, notes, and snippets.

@jegue
Forked from idvoretskyi/realvnc_deb.sh
Created July 21, 2020 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jegue/da46e79f540bcf55a199a52112bc49cd to your computer and use it in GitHub Desktop.
Save jegue/da46e79f540bcf55a199a52112bc49cd to your computer and use it in GitHub Desktop.
RealVNC Scripting deployment and start-up on Ubuntu/Debian
# Download and unpack the latest binary on a 64-bit Debian-compatible system:
curl -L -o VNC https://www.realvnc.com/connect/download/binary/latest/debian/64-bit/
# Install VNC Server on a Debian-compatible system (assuming download file named as above):
sudo dpkg -i VNC
# Apply your license key, available from the Deployment page of your RealVNC account:
sudo vnclicense -add XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
# Optionally enable cloud connectivity for VNC Server in Service Mode (token available with key):
sudo vncserver-x11 -service -joinCloud <your-token>
# Specify a VNC password for VNC Server in Service Mode:
sudo vncpasswd -service
# Enterprise subscription only. Specify a VNC password for VNC Server in Virtual Mode:
vncpasswd -virtual
# Start VNC Server on a Linux system using systemd:
sudo systemctl start vncserver-x11-serviced.service
# Restart VNC Server each time a Linux system is booted using systemd:
sudo systemctl enable vncserver-x11-serviced.service
# Install a desktop environment suitable for virtualization (for example, XFCE4) on Ubuntu 18.04:
sudo apt-get install xfce4
# Use XFCE4 instead of the console desktop environment (if any) for all virtual desktops:
echo -e '#!/bin/sh\nDESKTOP_SESSION=XFCE4\nexport DESKTOP_SESSION\nstartxfce4\nvncserver-virtual -kill $DISPLAY' | sudo tee /etc/vnc/xstartup.custom
sudo chmod +x /etc/vnc/xstartup.custom
# Start VNC Server on a Linux system using systemd:
sudo systemctl start vncserver-virtuald.service
# Restart VNC Server each time a Linux system is booted using systemd:
sudo systemctl enable vncserver-virtuald.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment