element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog Headless Post-Installation on a USD 5.00 Raspberry Pi Zero "W"
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 17 Nov 2017 9:21 PM Date Created
  • Views 660 views
  • Likes 7 likes
  • Comments 0 comments
Related
Recommended
  • pi
  • novice raspberry pi
  • pi-zero
  • pi zero w
  • pi zerow
  • rpi_beginner

Headless Post-Installation on a USD 5.00 Raspberry Pi Zero "W"

Former Member
Former Member
17 Nov 2017

I have seen a lot of guides to configure headless operations without attached display, keyboard, and mouse - all of which seem to be out of date.  Maybe it's because that Raspbian has evolved or something else.  Anyways, this technote is based on Raspbian Stretch or Stretch-Lite circa September 2017.

 

I got this Raspberry Pi Zero "W" for USD 5.00 by walking into a local store (http://www.microcenter.com/product/486575/Zero_W) in the Dallas/Fort Worth Texas USA area.  That price is for one.  If you want more, then the unit price goes up - sort of a volume "anti-discount" image.  They also have a USD 5.00 price on the "official" Pi zero case.  Unfortunately, you have to walk-in as I was told.  There must be other stores around the 3rd rock that offer comparable discounts (UK? Hong Kong? Rotterdam?).

 

I'll assume that the reader has just created a MicroSD Raspbian installation in the usual manner on the workstation.  Make sure no writes are pending.  If the 2 Stretch partitions are not yet automounted, pull out the caddy and push it back in.  This should cause an automount of the 2 Stretch partitions of the MicroSD.

 

On my Linux system, `sudo blkid` shows the following after creating the Raspbian boot MicroSD:

 

/dev/sdc1: LABEL="boot" UUID="E5B7-FEA1" TYPE="vfat" PARTUUID="020c3677-01"

/dev/sdc2: UUID="b4ea8e46-fe87-4ddd-9e94-506c37005ac5" TYPE="ext4" PARTUUID="020c3677-02"

 

with corresponding mounts

 

/media/USER-NAME/boot/

/media/USER-NAME/b4ea8e46-fe87-4ddd-9e94-506c37005ac5/

 

Enable SSH on the first Raspbian power-up

 

cd /media/USER-NAME/boot/

touch ./ssh

 

Assuming that you are using Wifi, enable the connection.  The following is an example on my Linux system for the USA using WPA-PSK security.

 

cd /media/USER-NAME/b4ea8e46-fe87-4ddd-9e94-506c37005ac5/etc/wpa_supplicant

sudo vi  wpa_supplicant.conf

 

Replace the existing contents of wpa_supplicant.conf with the following:

 

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

country=US

 

network={

ssid="Your network SSID"

psk="Your WPA/WPA2 security key"

key_mgmt=WPA-PSK

}

 

I highly recommend setting up a static IP address; this is very convenient for headless SSH operation.

 

Assuming that:

 

    1. You are using Wifi and your wireless device is named wlan0
    2. The desired IP address for the Raspberry Pi = 192.168.1.104
    3. The router IP address = 192.168.1.1
    4. The primary DNS server is also at 192.168.1.1

 

append to /etc/dhcpcd.conf the following:

 

interface wlan0

static ip_address=192.168.1.104/24

static routers=192.168.1.1

static domain_name_servers=192.168.1.1 8.8.8.8

 

Adjust IP addresses as necessary for your environment.

 

Note that if you are using wired Ethernet instead of Wifi and its device name is eth0, then specify this interface instead:

 

interface eth0

 

Be sure to sync; sync; sync changes to the MicroSD before removing it from the USB port.

 

Insert the MicroSD into the Raspberry Pi and power up.

 

From your workstation, connect to the Pi

 

ssh -X pi@PI-IP-ADDRESS   # -X allows me to invoke X GUI programs like the Gnu text editor (`gedit`)

 

Change the root password to something that you'll remember, just in case

 

Configure the Pi

sudo raspi-config

 

  1. Change password for user pi
  2. Localisation - Language and Regional settings
  3. Timezone - Where are you?
  4. If you already have a Raspberry Pi with host name "raspberrypi", you will probably want to change this Pi Zero W's host name to something else.
  5. Reboot

 

On your workstation, I would enter the host name and static IP address for the Raspberry Pi in /etc/hosts (assuming the workstation is Linux or Unix).

 

From your workstation, connect to the Pi

 

ssh pi@PI-HOST-NAME

 

Got an NFS file server that the user "pi" needs access to on a permanent basis?  Permanently mount "/mnt/bigtree.nfs"

 

1. I'll assume that your NFS server is set-up and you know how to manage it.  Practical overviews of NFS set-up can be found here:

    • phoenixcomm -- https://www.element14.com/community/people/phoenixcomm/blog/2015/04/30/howto-nfs-network-file-system
    • balearicdynamics -- https://www.element14.com/community/community/design-challenges/sci-fi-your-pi/blog/2015/05/13/meditech-raspian-nfs-sharing

Be sure to read the comments too.  All of us have learned NFS at the "School of Hard Knocks" but it is worth it.

 

2. Set up a local mount location:

 

cd /mnt; sudo mkdir bigtree.nfs; sudo chown pi:pi bigtree.nfs

 

3. Append the following to /etc/fstab; adjust per your local requirements:

 

# Mount bigtree.nfs using NFS

# NFS-SERVER is the host name as specified in /etc/hosts (static IP address).

# This NFS server has "bigtree" rooted directly under mounted file system "/data4188".

NFS-SERVER:/data4188/bigtree   /mnt/bigtree.nfs   nfs   rw,bg,auto,noatime   0   0

 

4. Test (In general, always test immediately after making system changes!):

 

sudo mount -a

touch /mnt/bigtree.nfs/xx

rm /mnt/bigtree.nfs/xx

 

Got a SAMBA file server that the user "pi" needs access to on a permanent basis?  Permanently mount "/mnt/bigtree.samba" as follows:

 

1. I'll assume that your SAMBA server is set-up and you know how to manage it.

 

2. Set up a local mount location:

 

cd /mnt; sudo mkdir bigtree.samba; sudo chown pi:pi bigtree.samba

 

3. Append the following to /etc/fstab:

 

# Mount bigtree using SAMBA

# SAMBA-SERVER is the host name as specified in /etc/hosts (static IP address).

# This SAMBA server has a share named "bigtree".

//SAMBA-SERVER/bigtree /mnt/bigtree.samba cifs auto,owner,rw,credentials=/root/bigtree.credentials,uid=pi,gid=pi 0 0

 

4. Create /root/bigtree.credentials for the login to the SAMBA server (read and write access):

 

username=SAMBA-USER-ID

password=SAMBA-USER-PASSWORD

 

5. Test mounting changes (In general, always test immediately after making system changes!):

 

sudo mount -a

touch /mnt/bigtree.samba/xx

rm /mnt/bigtree.samba/xx

 

Now is a good time to update your system

 

sudo apt-get -y update

sudo apt-get -y dist-upgrade

sudo apt-get -y autoclean

sudo apt-get -y autoremove

sudo reboot

 

That's it

 

Find any bugs?  Suggestions for improvement?

Richard Elkins

Dallas, Texas, USA, 3rd Rock, Sol

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube