Bosse_B
Posts: 836
Joined: Thu Jan 30, 2014 9:53 am

PI4 how to enable VNC on a headless system?

Tue Jul 09, 2019 12:13 pm

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.)
Bo Berglund
Sweden

LTolledo
Posts: 2148
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

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

Tue Jul 09, 2019 12:40 pm

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)
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

klricks
Posts: 6618
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

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

Tue Jul 09, 2019 12:45 pm

Already answered in your other post: https://www.raspberrypi.org/forums/view ... 6&t=245154
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

Bosse_B
Posts: 836
Joined: Thu Jan 30, 2014 9:53 am

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

Tue Jul 09, 2019 1:02 pm

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!
Bo Berglund
Sweden

Return to “General discussion”