How to connect a new Raspberry Pi to your Laptop without a screen

Posted by Momen 20/05/2017 0 Comment(s)

Welcome to Zeroohm Raspberry Pi Training series. In this series of Raspberry Pi Training, Zeroohm will focus its efforts on helping the community learn more about Raspberry Pi fundamentals and basics starting with basic control of LED's, motors, sensors and utilizing of wirless communication. We hope that you find this useful, Please, leave a comment for any questions or comments or reviews!

We provide all our trainings for groups from schools, universities, public sector and private sector in Abu Dhabi, Dubai, Sharjah, Fujirah, RAK or anywhere in UAE. Please,click here to contact us directly for any training inquires.

Our Raspberry Pi training series:

1. Introduction to Raspberry Pi

2. Analog Inputs/Output In Raspberry Pi

3. Wireless Communication in Raspberry Pi

4. How to connect a new Raspberry Pi to your Laptop without a screen

5. Communication between Raspberry Pi and Arduino

 

 

Have you ever got a brand new raspberry pi and didn’t have an HDMI screen to connect to it? Or were you in a place where you didn't have access to any screen? Are you sick of connecting the HDMI cable to the screen each time you want to work on your pi?

Don’t worry, In this tutorial I’ll be showing you how to connect to your brand new raspberry pi GUI from your laptop with just an Ethernet cable.

In this Tutorial you'll need the following:

  1. Raspberry Pi.
  2. Ethernet Cable.
  3. Laptop.
  4. SD Card with Raspbian.
  5. Micro USB Cable.

Step 1: To establish a connection between your Raspberry Pi and your laptop we must use a software that will make an SSH connection between your Pi and your Laptop. There are many softwares that can don that for you, one of the best one's is Putty.

PuTTY configration

 

Step 2: After you establish the connection and opened the Raspberry Pi terminal with Putty you will need the VNC viewer to open the Pi's GUI from your laptop.

VNC viewer

Step 3: Right click on your Wifi/Ethernet at your task basr , click on "network and sharing center".

 

network and sharing center

Step 4:Right click on the Wifi and go to "properties" , then go to "sharing center" and make sure that first checkbox is clicked

sharing center

 

Step 5: Go back to the "Network and Sharing Center", right click on Ethernet and go "properties" , then double click on internet protocol version 4 and use a dynamic IP address in the format "192.168.137.x" where x is a number between 2 till 255.

Internet Protocol Version 4 Properties

 

Step 6: turn ON your Raspberry Pi, Connect the ethernet cable between your Raspberry Pi and your Laptop, you should see unidentified network on Ethernet.

Connection between Raspberry Pi and Laptop

Step 7:now we have to check if the Raspberry Pi is connected or not so in the start menu search for "command prompt" or open "Run" from "Accesoress" and type in "command prompt". Once you open the "command prompt", type:

ping raspberrypi.mshome.net 

Hit Enter, If the Raspberry Pi is connected you should see something like this :

Rapberry Pi terminal

Note that the IP address shown is the IP address of the Raspberry Pi Ethernet port, and you can basically use it instead of the host name that we used "raspberrypi.mshome.net".

Step 8: Open Putty Software and type type "raspberrypi.mshome.net" or the IP address as the host name and click open.

IP address of Raspberry Pi

Step 9: After that you will asked to put user name and password , here we type : pi in the user name field and raspberry as in the password .

Step 10: After you entered the Raspberry Pi terminal, type in the following command:

$ sudo apt-get update

After the update finsih, type in the following command to install the VNC server package on the Raspberry Pi:

$ sudo apt-get install tightvncserver

Once the installation is finsihed, run the VNCserver by typing the command:

$ vncserver :1

Step 11: open the VNC viewer in your Laptop and type "raspberrypi.mshome.net" or the IP address that you got in step 7 in addition to ":1" after the IP address.VNC viewer

OR:

VNC veiwer

Step 12: Hit Enter, then click on "Continue" in the pop up window. After that in next pop up window type in the User name "pi" and the password "raspberry" and press "OK".

Authentication of Raspberry Pi

If all good, the Raspberry Pi GUI will open:

Raspberry Pi GUI

 

Now, there is one issue that we need to solve, once you have completed the previous steps, each time you switch ON your Raspberry Pi you must open the terminal with Putty, Run VNC server "$ vncserver :1" and then open the GUI with the VNC viewer. To fix this we do some configuration for the Pi to run the VNC server automatically at Startup. To do so, follow the next steps:

Step 13: Open the Raspberru Pi in Putty as in step 8, then open “.config” folder from the Pi’s: user folder (it is a hidden folder) by typing the command:

$ cd /home/pi
$ cd .config

Step 14:type in the following commands:

$ mkdir autostart
$ cd autostart
$ sudo nano tightvnc.desktop

Step 15: Once you hit Enter another window in the terminal will open, that in the Raspberry Pi's nano text editor. In the Editor write done the following:

[Desktop Entry]
Type=Application
Name=TightVNC
Exec=vncserver :1
StartupNotify=false

Step 16: Once you finished, save the file by "Ctrl" and "X", then type "y" to save and then hit "Enter".

Now next time you reboot your Pi, the VNCserver will start automatically and you will be able to easily connect your Raspberry Pi to a laptop display.

Whenever you want to do something on your Raspberry Pi, just connect it with an Ethernet cable to your laptop and power it ON. Then open VNCViewer, mention the IP address of your Raspberry Pi or as we did before you can use "raspberrypi.mshome.net" instead, and you can use your laptop’s display as the Raspberry Pi’s monitor.

 

Leave a Comment