Accessing Raspberry Pi on first boot without keyboard mouse and display directly from PC using SSH

Update: NOV 13, 2017

Visit our new tutorial “Raspbian Stretch Headless Setup on Raspberry Pi Zero, Zero W, Pi 3 which is easier but it works for Raspbian Stretch and does not work on previous versions of Raspbian such as Raspbian Jessie.

Contents:


Normally new installation of Raspberry Pi needs Mouse, Keyboard and Display for configuring Raspbian Jessie especially when there is no network i.e. Router or Access point already established. But these are the requirements no more as Raspbian Jessie comes with SSH pre-enabled. As both Raspberry Pi and PC both do not have IP address configured by default and cannot communicate to each other, A DHCP (Dynamic Host Configuration Protocol, automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway) server is required to be installed on PC. DHCP server for Windows perform this job with ease, just follow the steps below.

Step A:

  • Go to Network and Sharing Center by searching in start menu.
  • Click on Change adapter settings.
  • Right click on Local Area Connection and click Properties.
  • Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
  • Select Use the following IP address option and provide an IP address (eg. 192.168.3.1).
  • Check Validate settings upon exit (to validate settings).
  • Click OK.

windows-ip-address-setting

Step B:

  • Download DHCP server for Windows from this link
  • Unzip the contents of Latest DHCP server for Windows ZIP file to C:\DHCP
  • Run “dhcpwiz.exe” file and click Next

windows-dhcp-server-setup

  • Click on Refresh, choose Local Area Network or Ethernet (depends on Windows you are using) and hit Next

windows-dhcp-server-setup-selecting-network

  • Leave all values as default and Click on Next

windows-dhcp-server-setup-protocols

  • Click Next (Don’t change any thing)

windows-dhcp-server-setup-configuring-dhcp

  • Check whether the path of “INI file” is same as the location of the dhcpsrv.exe
  • Check “Overwrite existing file”
  • Click on Write “INI file”
  • Click Next

windows-dhcp-server-setup-writing-ini-file_

  • Configure firewall by clicking Admin (Click yes on security warning)

windows-dhcp-server-setup-enabling-admin-priv

  • Under “Firewall Exceptions” Click on Configure and then Exit

windows-dhcp-server-setup-configuring-firewall

  • Select the check box Run DHCP server immediately and click Finish

windows-dhcp-server-setup-run-server

  • Now hit Continue as tray  app button

windows-dhcp-server-setup-tray-app

Step C:

  • Connect the Raspberry Pi to the computer’s LAN port using cable
  • Wait a while and a popup will show assigned IP address and the MAC Address of Raspberry Pi

windows-dhcp-server-setup-dhcp-ip-address

  • Open PuTTY and access Raspberry Pi using IP Address shown in popup
  • Enter pi as user name and raspberry as password
  • That’s all  😎

Assigning Static IP address to Raspberry Pi

  • Open “dhcpcd.conf” file in Nano editor
  • Scroll all the way to the bottom of the file and add one, or both of the following snippets. Depending on whether you want to set a static IP address for a wired connection (eth0) or a wireless connection (wlan0)
  • Save the configuration file by pressing “Ctrl” and “X” key followed by “Y” and “Return” key

Connecting to WiFi Access Point using Terminal

  • Open “wpa_supplicant.conf” file in Nano editor
  • Copy the following lines in bottom (Right click paste copied contents in PuTTY)
  • Save the configuration file by pressing “Ctrl” and “X” key followed by “Y” and “Return” key
  • Reboot Raspberry Pi using reboot command
 

2 thoughts on “Accessing Raspberry Pi on first boot without keyboard mouse and display directly from PC using SSH

  1. Pingback: Complete Guide to Home Automation – Hobbytronics Pakistan

  2. Pingback: How to Install Raspbian Jessie into Raspberry Pi – Hobbytronics Pakistan

Leave a Reply

Your email address will not be published. Required fields are marked *