kaz69
Posts: 28
Joined: Thu Aug 17, 2017 7:55 am

Headless remote use with VNC

Wed Nov 18, 2020 8:39 am

Hi all

So I have my Pi3 all setup with a desktop that I’ve been using, but I now want to use it with VNC on my iPad. I have it all set up with VNC but I have two questions

1) I want to run the Pi with no monitor, so switch it on and access it all from my iPad how can I do this (can I still connect a monitor later?)

2) I have VNC all set up and working fine except when I turn on the Rasperry Pi in the morning I have to type VNCserver in terminal each time so it will connect with my iPad. Any ideas of how to fix this as if I don’t use a monitor I won’t be able to gain access

I have VNC enabled in preferences.

Thanks

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

Re: Headless remote use with VNC

Wed Nov 18, 2020 8:52 am

no mention of:
1. what OS is installed on the RPi3B
2. what vnc server is installed on RPi3B
3. what vnc client is used on remote display....

....Request failed with status code 404...
"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!"

kaz69
Posts: 28
Joined: Thu Aug 17, 2017 7:55 am

Re: Headless remote use with VNC

Wed Nov 18, 2020 9:39 am

Hey LTolledo

1) Raspbian
2)Real VNC
3) VNC Viewer

Thanks

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

Re: Headless remote use with VNC

Wed Nov 18, 2020 10:21 am

I have:

RPi4B-4G, with
RPiOS32 full desktop, with
RealVNC server installed and enabled

VNCviewer is installed on my cheapo android phone
am able to view my RPi4B-4G on my android phone
RPi4B-4G desktop on Android VNCviewer.jpg
RPi4B-4G desktop on Android VNCviewer.jpg (245.6 KiB) Viewed 440 times

and I dont need to enable VNC server every startup because its enabled by default
all of my Raspbian/RPiOS32 desktop setups have this by default...
"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!"

PiGraham
Posts: 4269
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Headless remote use with VNC

Wed Nov 18, 2020 10:29 am

Is the desktop starting normally? If you boot then connect a screen is it up and running?

If not you could try forcing HDMI in config.txt

Code: Select all

hdmi_force_hotplug=1
And specify a mode

https://www.raspberrypi.org/documentati ... t/video.md

PiGraham
Posts: 4269
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Headless remote use with VNC

Wed Nov 18, 2020 10:32 am

If you run vncserver from command line it can create a virtual display for the desktop and share that. But then that isn't output to HDMI.

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

Re: Headless remote use with VNC

Wed Nov 18, 2020 1:38 pm

On RPi 4 by default if no HDMI is detected then no frame buffer is created so nothing that requires Desktop will run. eg VNC, audio apps, and I believe auto mounting.......

The usual fix is to enable force HDMI hotplug in config.txt or set a fixed resolution using sudo raspi-config (Choose anything other than default monitor)
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

kaz69
Posts: 28
Joined: Thu Aug 17, 2017 7:55 am

Re: Headless remote use with VNC

Wed Nov 18, 2020 3:00 pm

Thanks PiGraham and Klricks

I have done the hdmi hotplug change in config.txt rebooted my pi and when I go into VNC viewer I just get

The port on which the computer is listening for a connection could not be contacted.

Not sure why

User avatar
B.Goode
Posts: 10895
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Headless remote use with VNC

Wed Nov 18, 2020 3:23 pm

klricks wrote:
Wed Nov 18, 2020 1:38 pm
On RPi 4 by default if no HDMI is detected then no frame buffer is created so nothing that requires Desktop will run. eg VNC, audio apps, and I believe auto mounting.......


True.

But the OP is battling with an RPi3...
kaz69 wrote: Hi all

So I have my Pi3 all setup with a desktop that I’ve been using, but I now want to use it with VNC on my iPad. I have it all set up with VNC but I have two questions

1) I want to run the Pi with no monitor, so switch it on and access it all from my iPad how can I do this (can I still connect a monitor later?)

2) I have VNC all set up and working fine except when I turn on the Rasperry Pi in the morning I have to type VNCserver in terminal each time so it will connect with my iPad. Any ideas of how to fix this as if I don’t use a monitor I won’t be able to gain access

I have VNC enabled in preferences.

Thanks

PiGraham
Posts: 4269
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Headless remote use with VNC

Wed Nov 18, 2020 3:47 pm

Is that only a Pi4 thing?
It's quick to try .
I took the OP to mean that with a monitor attached the desktop comes up and VNC works, but without the monitor at start-up VNC doesn't work without starting the server instance from command line and connecting a monitor later does not show the desktop. That sounds consistent with no frame buffer that klricks describes.

PiGraham
Posts: 4269
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Headless remote use with VNC

Wed Nov 18, 2020 3:49 pm

kaz69 wrote:
Wed Nov 18, 2020 3:00 pm
Thanks PiGraham and Klricks

I have done the hdmi hotplug change in config.txt rebooted my pi and when I go into VNC viewer I just get

The port on which the computer is listening for a connection could not be contacted.

Not sure why
And if you plug your monitor in later, do you get the desktop now?

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

Re: Headless remote use with VNC

Wed Nov 18, 2020 5:39 pm

PiGraham wrote:
Wed Nov 18, 2020 3:47 pm
Is that only a Pi4 thing?
It's quick to try .
I took the OP to mean that with a monitor attached the desktop comes up and VNC works, but without the monitor at start-up VNC doesn't work without starting the server instance from command line and connecting a monitor later does not show the desktop. That sounds consistent with no frame buffer that klricks describes.
Yes it is a RPi4 thing and the symptoms are exactly as you wrote.
Other RPi versions don't have this issue as they revert to composite mode if HDMI is not connected at boot so a frame buffer is always created.
Due to clock timing issues, composite mode is disabled by default on RPi4. Don't know about the Pi400?
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

kaz69
Posts: 28
Joined: Thu Aug 17, 2017 7:55 am

Re: Headless remote use with VNC

Thu Nov 19, 2020 12:32 am

Sorry for the delay

I ran the sudo nano config.txt and sorted the hdmi side to things and looks to be working ok, as I started the pi up with the hdmi connected to the pi but not the TV. Then when I did connect the hdmi to the tv it came on all ok.

So now the issue is VNC not working unless I plug in the monitor go into terminal and type vncserver then I can get access from my iPad.

Not sure what’s happening as updated real VNC via terminal, enabled VNC via preferences and also in raspi-config

kaz69
Posts: 28
Joined: Thu Aug 17, 2017 7:55 am

Re: Headless remote use with VNC

Thu Nov 19, 2020 11:03 am

Morning all

So tested again this morning and hdmi part is all fine it’s just the VNC that’s the issue the only error messages that comes up is
CB591B38-BFD0-4DAB-AFC7-510091FF6896.jpeg
CB591B38-BFD0-4DAB-AFC7-510091FF6896.jpeg (62.16 KiB) Viewed 266 times
But don’t think it means anything for the VNC issue

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

Re: Headless remote use with VNC

Thu Nov 19, 2020 11:39 am

i dont know if its suggested already...but...

if you have a spare microSD card and a monitor:
1. flash it with the recently available RPiOS32 image
2. boot your RPi, update and upgrade
3. at the raspberry pi configuration change the password (and the hostname)
4. set VNC (and SSH) to enable
5. set your display resolution (just don't use default) like 1280 x 720, or 1360 x 768, or 1920 x 1080, etc (usually basing it on the monitor to be used on the VNC client)
optional: set your GPU memory from default to say 160MB
6. make sure the RPi is connected to your network (WiFi? wired LAN?)
7. reboot
8. examine if on the top right you see a VNC icon, if its there then the VNC server is enabled
9. determine your RPI's IP address...
10. power off and remove the monitor
11. power on the RPi.... wait at least until the rapid flashing subsides)

now go on to the other RPi (or iPad, or Android tablet/phone) and try to access via VNC your newly setup RPi...
"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!"

kaz69
Posts: 28
Joined: Thu Aug 17, 2017 7:55 am

Re: Headless remote use with VNC

Thu Nov 19, 2020 1:48 pm

So managed to get it all working.

LTolledo I looked at the top right for the VNC box and I signed back into my cloud account restarted and seems to be working fine, I had signed in originally but something happens where it logged me out.

Everyone thanks for the help all working nowp

Return to “Beginners”