Skip to content

Instantly share code, notes, and snippets.

@vietanhdev
Last active December 4, 2023 15:57
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save vietanhdev/c2cb96eb6cf5b9232a04dfbe8bdaba2f to your computer and use it in GitHub Desktop.
Save vietanhdev/c2cb96eb6cf5b9232a04dfbe8bdaba2f to your computer and use it in GitHub Desktop.
Install RealVNC Ubuntu - Raspberry Pi 4
#!/bin/bash
mkdir realvncserversetup && cd realvncserversetup
echo Add armhf arch
sudo dpkg --add-architecture armhf && sudo apt update
echo Download and install RealVNC server
wget -nv https://downloads.realvnc.com/download/file/vnc.files/VNC-Server-6.11.0-Linux-ARM.deb && sudo apt install ./VNC-Server-6.11.0-Linux-ARM.deb
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
wget -nv https://github.com/raspberrypi/firmware/raw/master/opt/vc/lib/$i
done
sudo mv *.so /usr/lib/
cd ..
echo Enable VNC service on boot
sudo systemctl enable vncserver-x11-serviced.service
echo Start VNC service
sudo systemctl start vncserver-x11-serviced.service
@MOAMIndustries
Copy link

throws error when shebang is not at the beginning of the script
#!/bin/bash

@vietanhdev
Copy link
Author

You can run this script by typing:

bash install_realvnc_server.sh

Anw, added the shebang. Thank you very much!

@Miragecore
Copy link

@joelemanoel
Copy link

VNC shows no image, just black screen. Any solution?

@joelemanoel
Copy link

VNC shows no image, just black screen. Any solution?

Basically install a dummy driver:

sudo apt-get install xserver-xorg-video-dummy

Then write it in the /usr/share/X11/xorg.conf.d/xorg.conf file (create one, if it does not exist):

Section "Device"
Identifier "Configured Video Device"
Driver "dummy"
EndSection

Section "Monitor"
Identifier "Configured Monitor"
HorizSync 31.5-48.5
VertRefresh 50-70
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080"
EndSubSection
EndSection

@gregsonar
Copy link

@vietanhdev
Copy link
Author

@gregsonar I updated the version. Thanks.

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