Page 1 of 1

PI4 how to enable VNC on a headless system?

Posted: Tue Jul 09, 2019 12:13 pm
by Bosse_B
My Pi4B does not have a monitor attached (headless) and I have set it up via PuTTY from Windows.
I want to use VNC to reach the GUI screen in teh same way I have done on my other RPi3 units.
But on these I have had a monitor to attach at some time, which is not the case here.

I enabled VNC in raspi-config but cannot get a desktop screen in RealVNC anyway, it just says that it "currently cannot show the desktop"...

Is there a tutorial on how to enable VNC on a headless RPi (3 or 4)?
(I realized I could possibly get more feedback here rather than in the Raspbian forum, where I posted this.)

Re: PI4 how to enable VNC on a headless system?

Posted: Tue Jul 09, 2019 12:40 pm
by LTolledo
my method:
- - - - - - - -
Set it up first with a monitor and keyboard and mouse....booting to Raspbian with desktop....setup everything including RealVNC.
Set the preferred display resolution (better set it the same or lower as winPC or other RealVNC clients)

once done.... shutdown the RPi
remove monitor, keyboard, mouse...even LAN cable (if successfully set up the WiFi as well)

with the RPi headless, power on the RPi
knowing the IP address of the RPi, connect to it via RealVNC...
- - - - - - - - -

that's how I do it, it works.
it may not be the same with others....but my method works fine with me....


(also better delete the other post if you're not getting replies there)

Re: PI4 how to enable VNC on a headless system?

Posted: Tue Jul 09, 2019 12:45 pm
by klricks
Already answered in your other post: https://www.raspberrypi.org/forums/view ... 6&t=245154

Re: PI4 how to enable VNC on a headless system?

Posted: Tue Jul 09, 2019 1:02 pm
by Bosse_B
So I changed the raspi-config boot option to boot into the GUI but require login.
I also modified the /etc/rc.local file by adding this at the end before exit:

#Start RealVNC in virtual mode with resolution 1400x900 px
vncserver -randr=1400x900

(I noted that this was present in my RPi3B unit where VNC works already.)

After a reboot I am now able to connect VNC!
Problem solved!