Skip to content

Instantly share code, notes, and snippets.

@rehannali
Forked from vietanhdev/install_realvnc_server.sh
Last active June 26, 2022 11:34
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 rehannali/2c5b8ff2f2e146ffe40f66ecc131b6d5 to your computer and use it in GitHub Desktop.
Save rehannali/2c5b8ff2f2e146ffe40f66ecc131b6d5 to your computer and use it in GitHub Desktop.
Install RealVNC Ubuntu Headless - Raspberry Pi 4 armhf or using armhf
#!/usr/bin/env bash
mkdir realvncserversetup && cd realvncserversetup
echo 'Adding armhf arch'
sudo dpkg --add-architecture armhf && sudo dpkg --print-foreign-architectures
echo 'Update Repositories'
sudo apt update && sudo apt upgrade -y
echo 'Install libx11-6'
sudo apt install -y libx11-6
echo 'Download and install dependencies'
files=( libbcm_host.so libvcos.so libmmal.so libmmal_core.so libmmal_components.so \
libmmal_util.so libmmal_vc_client.so libvchiq_arm.so libvcsm.so libcontainers.so )
for i in "${files[@]}"
do
echo Downloading $i
wget -nv https://github.com/raspberrypi/firmware/raw/master/opt/vc/lib/$i
done
sudo mv *.so /usr/lib/
echo 'Installing gdebi'
sudo apt install -y gdebi
echo 'Downloading RealVNC Server'
wget -nv https://downloads.realvnc.com/download/file/vnc.files/VNC-Server-6.9.1-Linux-ARM.deb
echo 'Installing RealVNC Server'
sudo gdebi VNC-Server-6.9.1-Linux-ARM.deb
echo 'Accessing root permission'
sudo -s
echo 'Configuring VNC Auth'
echo "Authentication=VncAuth" >> /root/.vnc/config.d/vncserver-x11
echo 'Configuring password VNC Auth'
vncpasswd -service
echo 'Exiting root'
exit
echo 'Enable VNC Server & Virtuald service on boot'
sudo systemctl enable vncserver-x11-serviced.service
sudo systemctl enable vncserver-virtuald.service
echo 'Start VNC Server & Virtuald service'
sudo systemctl start vncserver-x11-serviced.service
sudo systemctl start vncserver-virtuald.service
echo 'vnclicensewiz'
sudo vnclicensewiz
echo 'uncommenting #WaylandEnable=false'
sudo sed -i 's/#WaylandEnable=false/WaylandEnable=false/g' /etc/gdm3/custom.conf
echo 'Cleaning up files'
cd ..
rm -rf realvncserversetup
rm -f install_realvnc_server.sh
@rehannali
Copy link
Author

You can simple install by using
curl -s https://gist.githubusercontent.com/rehannali/2c5b8ff2f2e146ffe40f66ecc131b6d5/raw/0cbf59239bae3c150965fb19bc1b5d2232f0936b/install_realvnc_server.sh | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment