ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

I can not connect mi Pi through vnc

Sun Jan 19, 2020 9:15 pm

Hi all,
thanks in advance.
I have just bought mi pi 4 and set SO raspbian buster.
I give the comands through Putty
I have set up vnc in mi pc
When I try to connect a Windows comes up "The name of the user it is not recognize or the password is incorret"
How can I solve it?
Thanks
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

pcmanbob
Posts: 7937
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: I can not connect mi Pi through vnc

Mon Jan 20, 2020 1:48 pm

Hi.

So when you get to this screen on VNC viewer

Image

you need to change the user name to pi

then in the password field you enter your pi password , if you have not changed it then it will be raspberry, if you have changed it then use what ever you changed it to.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: I can not connect mi Pi through vnc

Fri Jan 24, 2020 4:02 pm

Hi pcmanbob,
thanks for your time
When I got my Pi4 I hadn´t a usb keyboard (but yes usb-mouse), so when I installed Raspbian Buster with desktop I just clic "continue, continue..."
The user name "pi" was already written so good, but the fied "password" was empty and of course I clic continue...
Throug the router I got the ip: 192.168.0.20
On Putty to enter in the pi I had to put user:pi and password:raspberry (and was ok)
Later I put: sudo apt-get update
sudo apt-get upgrate (I gave some advice about the vlc (media player...)). I hope the upgrate was good but I dont know
sudo apt-get install-y realvnc-vnc-server realvnc-vnc-viewer (later I read on internet that Raspbien comes with vnc already installed so I think I did this step vanish (not needed it)
sudo vncserver (to activated vncserver)
and vncserver reply pi on 192.168.0.20:1
On my laptop I clic on vncviewer, put user:pi and password: raspberry and it is when I had this message "The name of the user it is not recognize or the password is incorret"
What I did wrong?
Because I try try try and nothing I put sudo apt-get install xrdp
and now I connect to my pi through remote desk of Windows on my laptop
But still I can not connect through vnc
Pleae tell me all the things that I did wrong I want to learn
Thanks
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

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

Re: I can not connect mi Pi through vnc

Fri Jan 24, 2020 4:13 pm

Do not use sudo with vncserver.

Code: Select all

vncserver
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

pcmanbob
Posts: 7937
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: I can not connect mi Pi through vnc

Fri Jan 24, 2020 5:49 pm

You are obviously following an old set of instructions on how to run realvnc.

It is installed by default now on raspbian buster , you only have to enable it via

sudo raspi-config


If you look under interfacing options you will find enable VNC.

You can do this via an SSH connection of raspbian on you SD card.

By attempting to install it and run it using sudo you may have corrupted things ,

So you may need to start over with a fresh install.

If you intend to run you pi without a screen connected you will also need to set a default resolution
That your pi will use when the screen is not connected you will find this under
Advanced options in the raspi-config menu.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: I can not connect mi Pi through vnc

Tue Jan 28, 2020 4:28 pm

Hi pcmanbob,
your were absolutelly right.
I got install again new raspbian bluster 4.16
Then in Pi4, confPi, clic on vnc on
Then on the terminal: vncviewer
Then from my laptop using vnc viewer 19.168.0.22:1 and buala :D
Now, just to make it perfet, how must I do it in order not to have to write vncviewer each time that I swicth on the Pi4?
Thanks
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

pcmanbob
Posts: 7937
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: I can not connect mi Pi through vnc

Tue Jan 28, 2020 7:01 pm

Why are you running vncviewer on the pi ?

You normally run that on the pc that you want to use to view the pi desktop, you would not run it on the pi unless you are using one pi to view another pi's desktop.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: I can not connect mi Pi through vnc

Tue Jan 28, 2020 11:20 pm

sorry I meant vncserver
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

pcmanbob
Posts: 7937
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: I can not connect mi Pi through vnc

Wed Jan 29, 2020 1:24 pm

If you just enable VNC from raspi-config then it will be run automatically every time your pi boots, no need to run it from the command line.

see my previous post
pcmanbob wrote:
Fri Jan 24, 2020 5:49 pm
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: I can not connect mi Pi through vnc

Thu Jan 30, 2020 9:50 am

Hi pcmanbob,
thanks for your time
I had activated vnc from Piconfig but still does not work
I have to actívate through Putty
Attachments
Vnc_activo.JPG
Vnc_activo.JPG (40.37 KiB) Viewed 825 times
Putty.JPG
Putty.JPG (84.18 KiB) Viewed 825 times
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

pcmanbob
Posts: 7937
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: I can not connect mi Pi through vnc

Thu Jan 30, 2020 9:59 am

Well this is telling you its enabled.

Image

the second and third lines are giving you the identification phrase so you know you have the correct VNC connection when you log on and the last line is giving you the IP address of the server that you need to input in the VNC viewer to connect to the pi in question.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: I can not connect mi Pi through vnc

Thu Jan 30, 2020 10:35 am

Maybe I have not explain myself correctly
Each time that I switch off Pi I have to actívate again vncserver throught Putty
Is there something to program that activation each time I switch on the Pi? :?:
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

pcmanbob
Posts: 7937
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: I can not connect mi Pi through vnc

Thu Jan 30, 2020 10:46 am

ancris00 wrote:
Thu Jan 30, 2020 10:35 am
Maybe I have not explain myself correctly
Each time that I switch off Pi I have to actívate again vncserver throught Putty
Is there something to program that activation each time I switch on the Pi? :?:
That should not happen

Has your SD card gone read only ?

you can test this via putty.

once you have signed in via putty, enter this command

Code: Select all

ls
you should see a list of directories and files

now enter this command

Code: Select all

touch check.txt
now do this command again to see the list of files

Code: Select all

ls
can you see the file we just created ?
if so reboot your pi with

Code: Select all

sudo reboot
once you pi reboots and you log back in,
now enter this command again

Code: Select all

ls
can you still see the file you just created called check.txt
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: I can not connect mi Pi through vnc

Thu Jan 30, 2020 1:38 pm

yes
Attachments
check.JPG
check.JPG (51.63 KiB) Viewed 793 times
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

pcmanbob
Posts: 7937
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: I can not connect mi Pi through vnc

Thu Jan 30, 2020 1:51 pm

So you SC card has not gone read only, but I still don't understand why you need to re-enable VNC after each reboot.

next time you boot and use sudo raspi-config to re-enable VNC , just check that its not already showing as active ( activo ).
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

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

Re: I can not connect mi Pi through vnc

Thu Jan 30, 2020 5:10 pm

There are 2 modes for RealVNC...... Service Mode and Virtual mode.
The modes are really 2 different things and should not be confused.
Most users will use Service Mode.

Service Mode:
- VNC must be enabled via raspi-config or GUI config tool.
- When enabled, automatically runs at startup.
- Boot to desktop is required.
- If no HDMI monitor then need to set a fixed resolution using sudo raspi-config.
- Mirrors the local desktop session (One session only).

Virtual Mode: (vncserver)
- No enable setting required. (The VNC config setting is for Service Mode only).
- Boot to desktop not required but desktop must be installed to the OS.
- Does not autostart by default* (Must type vncserver at local command line or via ssh each time)
- Does not show the local desktop session.
- Can have multiple independent sessions running. ip:1, ip:2 ..... etc.
- It is possible to run a Service Mode session and any number of Virtual Mode sessions concurrently.

*Virtual mode can be made to autostart by adding this to /etc/rc.local:

Code: Select all

sudo -u pi vncserver &
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: I can not connect mi Pi through vnc

Fri Jan 31, 2020 4:48 pm

Thank you klricks,
Service mode:
-as no Hdmi contected to Pi I set a fixed resolution
-reboot
-no conection

Virtual mode:
-as I want I tried to write the code /etc/rc.local and was no posible
Attachments
ResolutionSet.JPG
ResolutionSet.JPG (27.26 KiB) Viewed 686 times
TiempoEspera.JPG
TiempoEspera.JPG (21.11 KiB) Viewed 686 times
PermisoDenegado.JPG
PermisoDenegado.JPG (61.79 KiB) Viewed 686 times
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: I can not connect mi Pi through vnc

Sat Feb 01, 2020 10:17 pm

Anybody can help me? :roll:
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

pcmanbob
Posts: 7937
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: I can not connect mi Pi through vnc

Sun Feb 02, 2020 11:13 am

I don't understand why you can't enable VNC from raspi-config with a default resolution set and have it available on every boot I and many other people are doing it that way.

As for enabling virtual mode via rc.local, you need to use sudo to edit rc.local and you don't need to put sudo at the start of the line in rc.local as its already running as root.

When your first started all this you had tried to install VNC when it was already installed and I suggested you start over with a fresh install of raspbian on your SD card, did you do this ?
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: I can not connect mi Pi through vnc

Mon Feb 03, 2020 4:08 pm

pcmanbob wrote:
Sun Feb 02, 2020 11:13 am
I don't understand why you can't enable VNC from raspi-config with a default resolution set and have it available on every boot I and many other people are doing it that way.
When you said boot, do you mean switch off and switch off?I write just in case the Raspberry behaves differently
When your first started all this you had tried to install VNC when it was already installed and I suggested you start over with a fresh install of raspbian on your SD card, did you do this ?
Yes I did a new install
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

ancris00
Posts: 23
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: I can not connect mi Pi through vnc

Mon Feb 10, 2020 3:38 pm

Hi pcmanbob, hi klricks,
finally I attached or conected a screen to my pi
Then I could modify/edit file rc.local
So now I can conect my pi thought vnc without write vncserver thorough ssh (Putty) each reboot. (Just Virtual mode)
But this error comes up (see picture)
Do you know what does it mean?
Thanks
Attachments
e1.JPG
e1.JPG (40.84 KiB) Viewed 347 times
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

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

Re: I can not connect mi Pi through vnc

Mon Feb 10, 2020 6:19 pm

ancris00 wrote:
Mon Feb 10, 2020 3:38 pm
Hi pcmanbob, hi klricks,
finally I attached or conected a screen to my pi
Then I could modify/edit file rc.local
So now I can conect my pi thought vnc without write vncserver thorough ssh (Putty) each reboot. (Just Virtual mode)
But this error comes up (see picture)
Do you know what does it mean?
Thanks
I get the same error when I tried it. I just ignored it and all seemed to work fine, though I only briefly tried it as I noramaly use Service mode.
You might want to ask in the RealVNC web site /forums.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

Return to “Troubleshooting”