Raspberry pi is finally a linux running in a small hardware and running a vnc server on it wouldn't be a problem. Well, I wanted to use my laptop's screen and and keyboard to control my raspberry pi. The only method I found viable is by running a VNC server on my raspberry pi and connecting to it via a VNC client. VNC servers allow remote access to GUI of a given computer.
To start a VNC server on your Raspberry pi you first need to install a VNC server on it:
$ sudo apt-get install tightvncserver
Now run the service by typing the following:
$ tightvncserver
Type a password (keep it simple). To run the server type:
$ vncserver :1
Just keep it at :1 because :0 is occupied by the default screen.
Now, install a VNC client on your laptop (e.g. RealVNC or TightVNC). To connect to the pi type the IP address of the pi followed by :1 and enter the password you gave to your pi.
But, you'll have to type the last line every time you wanted to connect to the pi via a laptop. By automating this line every time you boot your raspberry pi you don't need to do that. You can just supply power to the pi and wait for some time and try to connect to the pi via the VNC server on your Laptop. This issue has been handled by the raspberry pi organization as well. But, they make you create a service that starts at boot which runs another program which runs another file which contains your command to start the server. Well, this was a mess.
So, my dad came up with the idea to start the vnc server by placing the last scripting line in a file called '.bashrc' (ignoring the quotes). This file runs each time you login into your pi. So, just configure your pi to enter into the desktop environment or text environment after automatic login. The pi can automatically login as pi with the default password. So, this would run the vnc server at boot and so you can connect to your pi directly after powering it up.
To start a VNC server on your Raspberry pi you first need to install a VNC server on it:
$ sudo apt-get install tightvncserver
Now run the service by typing the following:
$ tightvncserver
Type a password (keep it simple). To run the server type:
$ vncserver :1
Just keep it at :1 because :0 is occupied by the default screen.
Now, install a VNC client on your laptop (e.g. RealVNC or TightVNC). To connect to the pi type the IP address of the pi followed by :1 and enter the password you gave to your pi.
But, you'll have to type the last line every time you wanted to connect to the pi via a laptop. By automating this line every time you boot your raspberry pi you don't need to do that. You can just supply power to the pi and wait for some time and try to connect to the pi via the VNC server on your Laptop. This issue has been handled by the raspberry pi organization as well. But, they make you create a service that starts at boot which runs another program which runs another file which contains your command to start the server. Well, this was a mess.
So, my dad came up with the idea to start the vnc server by placing the last scripting line in a file called '.bashrc' (ignoring the quotes). This file runs each time you login into your pi. So, just configure your pi to enter into the desktop environment or text environment after automatic login. The pi can automatically login as pi with the default password. So, this would run the vnc server at boot and so you can connect to your pi directly after powering it up.
Comments
Post a Comment