WEBVTT

00:00.050 --> 00:02.330
Let's now install and configure VNC.

00:02.390 --> 00:07.850
VNC will simply allow you to use the Raspberry Pi desktop from your own computer.

00:07.880 --> 00:12.980
This is great, so you don't need to only use the terminal with command lines, and you also don't need

00:12.980 --> 00:15.560
to have a monitor plugged to your Raspberry Pi.

00:15.590 --> 00:20.810
Even if you have a monitor, you will see that it may be more convenient to work without it.

00:20.810 --> 00:26.930
And the reason we did all this setup with SSH before is simply because we need to access the Raspberry

00:26.930 --> 00:32.780
Pi through SSH here, so we can type a few command lines to configure and set up VNC.

00:32.810 --> 00:36.710
So here make sure that you are connected to the Raspberry Pi okay.

00:36.740 --> 00:42.650
You can see I have Pi at Raspberry Pi which means that I'm going to type commands inside the Raspberry

00:42.650 --> 00:43.160
Pi.

00:43.160 --> 00:48.770
If you don't have this, go back to the previous video and just note that here I am on the Raspberry

00:48.770 --> 00:48.980
Pi.

00:48.980 --> 00:55.790
If I want to go back to my windows terminal, or if you're on Linux or Mac OS, go back to your previous

00:55.790 --> 00:56.360
terminal.

00:56.360 --> 01:02.570
You can just type exit And you can see now I have lost the connection.

01:02.570 --> 01:04.730
It doesn't mean that the Raspberry Pi is powered off.

01:04.760 --> 01:05.720
Okay, it's still on.

01:05.750 --> 01:07.580
It's just that you lost the connection.

01:07.580 --> 01:13.130
And then with the up arrow, I can go back to running the same command, I press enter.

01:13.160 --> 01:14.930
I need to put the password again.

01:16.460 --> 01:18.710
And you see here, for example, what I did a mistake.

01:18.710 --> 01:21.740
So this is what you would have if you put the wrong password.

01:23.300 --> 01:25.400
And if you put the right password.

01:25.400 --> 01:31.850
So to use VNC we actually need to enable VNC because it's disabled by default.

01:31.850 --> 01:34.490
And to do that we will start a menu.

01:34.520 --> 01:37.100
You can just type sudo like that.

01:37.100 --> 01:41.300
And then raspi dash config.

01:41.300 --> 01:43.280
And you can press tab for auto completion.

01:43.310 --> 01:52.070
Okay so sudo raspi config you press enter and you get to a menu like this that you can navigate with

01:52.070 --> 01:53.900
the arrows of your keyboard.

01:53.900 --> 01:56.000
And we have two things to do here.

01:56.030 --> 01:59.830
The first you will go to Interface options.

01:59.890 --> 02:01.120
So you press enter.

02:01.450 --> 02:03.460
Then you go down to VNC.

02:04.420 --> 02:05.350
Press enter.

02:05.350 --> 02:10.030
And would you like to uh so would you like the VNC server to be enabled.

02:10.060 --> 02:10.810
You're going to go on.

02:10.840 --> 02:11.140
Yes.

02:11.140 --> 02:13.960
Press enter okay.

02:14.500 --> 02:16.510
And you should go back to the menu.

02:16.840 --> 02:19.180
The VNC server is enabled.

02:19.180 --> 02:22.300
You press enter again and you are back to the menu.

02:22.330 --> 02:24.310
Now we're going to do one more step.

02:24.400 --> 02:26.980
You're going to go to System Options.

02:26.980 --> 02:28.000
So that's the first menu here.

02:28.000 --> 02:32.050
You press enter and then you go on boot auto login.

02:32.050 --> 02:34.120
So you should have a menu that looks like this.

02:34.120 --> 02:39.400
And you're going to choose desktop or maybe desktop auto login.

02:39.400 --> 02:44.620
So just in case the default is console, it means the desktop is not going to boot.

02:44.620 --> 02:49.900
So with VNC because we want to get access to the desktop, we want to make sure that the desktop is

02:49.900 --> 02:52.420
enabled and you can choose desktop.

02:52.420 --> 02:55.600
In this case you will have to log in into the desktop.

02:55.630 --> 02:58.420
I'm just going to choose auto login for simplicity.

02:58.420 --> 03:05.800
So when we login actually through VNC to get to the Raspberry Pi OS, we directly arrive to the desktop

03:05.800 --> 03:07.810
and everything is correctly configured.

03:08.170 --> 03:12.340
So I'm going to press enter on this option okay.

03:12.520 --> 03:17.230
We go back to the menu and then I click on the right arrow to go to finish.

03:17.230 --> 03:19.810
And it's going to ask us to reboot.

03:19.810 --> 03:22.240
So I can press yes.

03:23.590 --> 03:26.080
And as you can see we lose the connection.

03:26.080 --> 03:27.130
Why do we lose the connection.

03:27.130 --> 03:29.770
Because well, the Raspberry Pi is rebooting.

03:29.770 --> 03:36.760
If it's rebooting, then of course we lose the SSH connection and we are back to the here to the windows

03:36.760 --> 03:37.480
terminal.

03:37.480 --> 03:41.950
So we just need to wait that the Raspberry Pi is back on the network and then.

03:41.950 --> 03:46.420
Well, we should not need to use the terminal here again.

03:46.420 --> 03:47.890
So I'm going to close that.

03:47.980 --> 03:49.930
I'm going to keep that on the side for later.

03:49.990 --> 03:51.430
And what do we do now.

03:51.430 --> 03:58.050
So the Raspberry Pi should be back on the network with the VNC server enabled.

03:58.050 --> 04:04.770
So what we need is a VNC client so that we can well, we can use a software to use VNC and connect to

04:04.800 --> 04:05.730
the Raspberry Pi.

04:05.760 --> 04:13.170
And to do that I'm going to so you can open a web browser and we're going to use Tiger VNC.

04:13.200 --> 04:18.330
So there are lots of different VNC clients VNC viewers here.

04:18.330 --> 04:19.620
We're going to use Tiger VNC.

04:19.620 --> 04:24.810
So you can just type Tiger VNC in Google and go to Tiger vnc.org.

04:24.870 --> 04:28.890
So they don't have a executable to download here.

04:28.890 --> 04:35.880
But you can go you can see you can go on the GitHub release page and you see that they say that they

04:35.880 --> 04:42.180
have a binaries for Linux, windows and also Mac.

04:42.180 --> 04:44.700
So you click here okay.

04:44.730 --> 04:47.160
And on releases you're going to get to GitHub.

04:47.190 --> 04:48.210
Don't worry about this.

04:48.210 --> 04:49.890
Just get the latest release.

04:50.430 --> 04:52.350
It can be another version than this one.

04:52.350 --> 04:53.130
It's okay.

04:53.310 --> 04:57.450
And then they will give you a link here to SourceForge.

04:57.450 --> 05:03.540
So you click on that link and you go to SourceForge where you can download the latest.

05:03.780 --> 05:06.360
So you can click here on this button for windows.

05:06.360 --> 05:09.420
But if you are on other operating systems you can see you have other versions.

05:09.420 --> 05:11.760
You can choose your operating system.

05:11.850 --> 05:12.180
Okay.

05:12.210 --> 05:14.910
And I'm just going to click here to download.

05:15.390 --> 05:15.900
Okay.

05:15.930 --> 05:18.450
Your download will start shortly.

05:18.450 --> 05:19.920
We just wait for this.

05:19.950 --> 05:21.480
We don't click on anything.

05:24.450 --> 05:24.930
Okay.

05:24.930 --> 05:25.890
And it's downloading.

05:25.890 --> 05:28.830
And then we can install.

05:28.860 --> 05:33.000
So just click on okay.

05:33.750 --> 05:41.370
So somehow my Windows Defender doesn't like this I'm going to click on more info and just run anyway

05:41.400 --> 05:41.550
okay.

05:41.580 --> 05:42.270
If you follow.

05:42.270 --> 05:46.800
So here I'm going to say yes I have a pop up to allow the software to run.

05:46.800 --> 05:50.970
So if you follow the links from the official website of Tigervnc it should be fine.

05:51.000 --> 05:53.750
Okay, don't go to other links than that.

05:53.840 --> 05:56.210
And now we are on the setup.

05:56.210 --> 06:01.700
So next, uh, accept the agreement and you can install it.

06:01.730 --> 06:01.940
Okay.

06:01.940 --> 06:06.380
Next install finish.

06:06.470 --> 06:15.410
And then you can just go to the search bar or press windows key for example, and type Tigervnc and

06:15.410 --> 06:16.610
just launch Tigervnc.

06:16.640 --> 06:18.560
So it's going to be empty like that.

06:19.490 --> 06:20.420
All right.

06:20.840 --> 06:22.580
So here the interface is quite simple.

06:22.580 --> 06:22.880
Here.

06:22.880 --> 06:26.960
You're going to put simply the IP address of the Raspberry Pi.

06:26.990 --> 06:28.820
You have some options.

06:28.820 --> 06:32.870
That might be it might be auto select by default.

06:32.870 --> 06:35.570
But you don't need to change anything on the options for now.

06:35.570 --> 06:37.700
So I'm just going to leave it by default.

06:37.700 --> 06:40.010
And you will put the IP address.

06:40.010 --> 06:47.750
So for me it was 192 dot 168 .203.222.

06:48.170 --> 06:51.810
And here once again it's very important that you are.

06:51.840 --> 06:55.530
So your computer here is on the same network as the Raspberry Pi.

06:55.560 --> 07:00.150
Because once again, if you are not, then you won't be able to find the Pi from your computer.

07:00.150 --> 07:03.720
So once I have put the IP address here, I can click on connect.

07:03.840 --> 07:08.340
And very shortly after you should have something like that.

07:08.340 --> 07:10.500
So certificate etc..

07:10.530 --> 07:14.010
Do you want to make an exception for this server so you can click on.

07:14.010 --> 07:15.060
Yes.

07:15.180 --> 07:16.080
Okay.

07:16.080 --> 07:19.860
This is just a security warning because we don't have any certificate but it doesn't really matter.

07:19.860 --> 07:21.420
You just click on yes.

07:21.420 --> 07:25.980
And you can see here now we have username and password.

07:25.980 --> 07:30.540
So if you reach that it means that the VNC server is actually working and you could find it.

07:30.540 --> 07:33.480
Now you just need to put username would be pi.

07:33.480 --> 07:37.350
And the password is the same that you put before for SSH.

07:37.350 --> 07:38.670
And it's the one that you have set.

07:38.670 --> 07:43.650
When you flashed the Raspberry Pi OS and click on okay.

07:43.680 --> 07:47.040
And we are on the Raspberry Pi desktop.

07:47.040 --> 07:48.910
So this is what you see here.

07:48.910 --> 07:50.860
This is not my windows computer.

07:50.890 --> 07:53.590
This is the desktop of the Raspberry Pi.

07:53.590 --> 07:55.300
And here just a quick parenthesis.

07:55.300 --> 07:57.400
So here I have selected the.

07:57.430 --> 08:00.160
So the IP address that I have found here okay.

08:00.190 --> 08:03.280
So if you get access to this it's working correctly.

08:03.280 --> 08:07.630
But let's say that in the future you try again with the same IP address.

08:07.870 --> 08:11.800
For example you try tomorrow or in one week and it doesn't work anymore.

08:11.800 --> 08:12.640
Why is that?

08:12.640 --> 08:17.110
Probably because the IP address or the network mask may have changed.

08:17.110 --> 08:23.110
So in this case, I recommend that you just find the IP address of the Raspberry Pi before.

08:23.140 --> 08:23.440
Okay.

08:23.470 --> 08:29.500
So in the case that it works now and that let's say tomorrow it doesn't work anymore, it's probably

08:29.500 --> 08:31.600
because maybe the IP address changed.

08:31.600 --> 08:32.890
It happens for me.

08:32.920 --> 08:35.440
For example, I use my smartphone as a hotspot.

08:35.440 --> 08:42.910
And somehow when I disconnect the hotspot and I create a new one, it gives a different IP address.

08:42.910 --> 08:47.230
So the IP address I have today is not going to be the same as the one I have tomorrow.

08:47.230 --> 08:49.600
So probably is a way to to fix that.

08:49.630 --> 08:51.220
But there's going to be more complex.

08:51.220 --> 08:58.450
But just know that you might have to check the IP address again just in case it works now and it doesn't

08:58.450 --> 08:59.350
work in the future.

08:59.350 --> 09:04.150
But if it doesn't work now, well, you need to go back and make sure that you can connect with SSH.

09:04.180 --> 09:10.690
Make sure that you can access the menu that we just did in this video and that the well, the VNC server

09:10.690 --> 09:14.500
is enabled and that you can download the Tigervnc client.

09:14.890 --> 09:20.260
So if you see the desktop, great, you can now have access to your Raspberry Pi desktop without any

09:20.260 --> 09:21.310
external monitor.

09:21.310 --> 09:27.160
So you can go ahead and jump to the next lesson where we will finish the last configuration steps.

09:27.760 --> 09:31.870
And I'm just adding this small extra troubleshooting parentheses here.

09:31.900 --> 09:32.110
Okay.

09:32.140 --> 09:37.660
To address the issue where you could have at this point not you would not see the desktop, but you

09:37.660 --> 09:40.060
would see a gray screen.

09:40.060 --> 09:44.710
So you could still connect with tigervnc, but you would see a gray screen.

09:44.830 --> 09:51.150
That has happened to me recently when I tried on the Raspberry Pi four, so I don't know if it's due

09:51.150 --> 09:52.020
to Raspberry Pi four.

09:52.050 --> 09:54.300
I could try again here on the Raspberry Pi five.

09:54.330 --> 09:58.680
It works correctly, but anyway, if you have a gray screen, well it means you won't see that.

09:58.680 --> 10:02.280
So probably you just, uh, close tigervnc.

10:02.280 --> 10:05.550
And then what we will do is go back to the terminal.

10:05.940 --> 10:06.240
Okay?

10:06.270 --> 10:08.760
So you should be able to connect with SSH.

10:08.790 --> 10:11.250
We're going to go back here.

10:11.280 --> 10:13.950
So I put the password.

10:14.250 --> 10:17.370
We go back to the Raspberry Pi with SSH.

10:17.370 --> 10:21.210
And we are going to do a sudo apt update okay.

10:21.240 --> 10:25.440
So you write exactly this command sudo apt update.

10:25.440 --> 10:26.970
You press enter.

10:27.540 --> 10:29.040
You might need to put your password.

10:29.040 --> 10:31.920
But here it works okay.

10:32.130 --> 10:34.020
It's going to update the packages.

10:34.020 --> 10:39.780
And then you need to do sudo apt upgrade okay.

10:39.810 --> 10:44.100
So actually update is going to fetch the new packages and upgrade.

10:44.490 --> 10:45.660
is going to update them.

10:45.690 --> 10:48.750
This is something we're going to see a bit later when we talk about Linux.

10:48.750 --> 10:50.820
So you don't really need to worry about this for now.

10:50.820 --> 10:52.950
You just type those comments exactly.

10:52.980 --> 10:54.300
So you upgrade.

10:54.300 --> 10:59.820
This is probably going to show you a lot of packages, and it's going to stop and ask you to validate.

10:59.820 --> 11:02.400
So you just press enter and then you can wait.

11:02.400 --> 11:07.200
So you might wait for 10 or 15 minutes for everything to be updated here.

11:07.200 --> 11:13.620
It shows me zero to upgrade because I have actually already upgraded the system before, but for you

11:13.620 --> 11:17.100
it might take well, like I told you, 10 to 15 minutes depends.

11:17.100 --> 11:19.980
And then after that you can reboot the Raspberry Pi.

11:20.010 --> 11:21.810
How do you reboot the Raspberry Pi?

11:21.810 --> 11:25.020
Well, we're not going to take the cable out and put it again.

11:25.020 --> 11:29.820
Now we can use sudo and then reboot just like that.

11:29.820 --> 11:32.430
So you press enter okay.

11:32.460 --> 11:34.350
You can see the system will reboot now.

11:34.350 --> 11:36.120
And now we lose the connection okay.

11:36.120 --> 11:39.300
Because if you reboot, then while the Raspberry Pi is shut down.

11:39.300 --> 11:43.280
So you lose the connection and then you can go back to Tiger.

11:43.310 --> 11:44.960
So Tiger VNC.

11:47.120 --> 11:48.620
So you should wait a bit.

11:48.650 --> 11:49.280
Okay.

11:49.340 --> 11:50.690
Maybe 30s.

11:50.870 --> 11:52.610
Let's try to connect.

11:53.180 --> 11:53.480
Okay.

11:53.510 --> 11:54.710
We have this again.

11:54.710 --> 11:56.390
So Pi.

11:57.470 --> 11:59.150
And then the password.

11:59.540 --> 12:03.110
And you should be able to get to this.

12:03.140 --> 12:03.590
Okay.

12:03.620 --> 12:08.930
And in the next video I'm going to show you at some point that we update the packages using an icon

12:08.930 --> 12:09.410
here.

12:09.440 --> 12:15.080
Or this icon is not here anymore, simply because we have already done it here previously in the terminal.

12:15.080 --> 12:17.090
And finally, well, if nothing works.

12:17.090 --> 12:23.060
So if you cannot get access to the Raspberry Pi OS desktop, well, there is one extra step that I've

12:23.060 --> 12:26.360
put in this section about Raspberry Pi Connect.

12:26.390 --> 12:28.490
Okay, so check that out with this for sure.

12:28.490 --> 12:34.970
You will be able to get access to the desktop, of course, provided that you can already have access

12:34.970 --> 12:36.890
here with SSH.

12:36.980 --> 12:39.920
Okay, but if nothing works, try with Raspberry Pi Connect.

12:39.920 --> 12:41.930
I have an extra video on this.
