Skip to content

Jim Christian

Thoughts on tech, tools, and life.

Menu
  • Home
  • About
  • Signal Over Noise Newsletter
  • Consulting
  • Notion Marketplace
Menu

Headless Pis over VNC

Posted on January 30, 2013 by Jim

After half term, I’ll be giving our Programming Club members access to their own Raspberry Pi. But because I don’t have the space for extra monitors in our IT Lab, I’ll need to have another workaround for letting the students have access to their Pis.

The best way to do this is to make the Pis ‘headless’. No need for anything other than power and an Ethernet cable.

I’ve done this by cobbling together instructions I found across other websites – my build notes are below. Each Pi has its own dedicated IP address that’s outside of our DHCP scope.

Image the SD card

Begin by using Mac to install image to SD card by opening Terminal and running the following command to get the SD card id:

df -h

Unmount it to prepare it for imaging

sudo diskutil unmount /dev/disk5s1

(disk5s1 is the value returned for my SD card. YMMV.)

Change your working directory to that of where you have your Raspberry Pi OS image. In this case, I have an image of raspberian-wheezy in my ~/Downloads folder. Copy image. Wait.

cd ~/Downloads
sudo dd bs=1m if=2012-12-16-wheezy-raspbian.img of=/dev/rdisk5

Once that’s all complete, your SD card will mount itself in the Finder with a name of ‘Untitled’. Eject it, put it in your Pi and start it up.

Run raspi-config

raspi-config should launch once your Pi has completed the boot sequence. I chose the options to:

  • expand rootfs, which will partition the rest of your SD card to be available to be used upon the next reboot
  • enable ssh – essential if you want to remote in to your Pi
  • check for any updates

Then finish. There is no immediate need to reboot your Pi at this point, as re-partitioning the available SD card space takes about a minute per available gigabyte.

Configure the Network

Open up your *interfaces* file

sudo pico /etc/network/interfaces

Configure your network interface. Each one of our Pis has been given a static address.

iface eth0 inet static

address 192.168.1.x

netmask 255.255.255.0

gateway 192.168.1.1

You can verify your network changes after the next reboot.

Install and Configure tightvncserver

(more instructions here)

sudo apt-get update

sudo apt-get install tightvncserver

Start server and configure a password (password is restricted to 8 characters). A view-only password is really not needed.

/usr/bin/tightvncserver

Download this text file to add tightvnc to startup

wget http://www.penguintutor.com/otherfiles/tightvncserver-init.txt

Move it to the correct location

sudo mv tightvncserver-init.txt /etc/init.d/tightvncserver

Change the file so it is owned by root (not strictly neccessary, but is the standard ownership for init files

sudo chown root:root /etc/init.d/tightvncserver

Make the file executable

sudo chmod 755 /etc/init.d/tightvncserver

Add the script to the default runlevels with the command

sudo update-rc.d tightvncserver defaults

If all has gone correctly at this point, you can reboot your Pi. When it comes back up it will begin to reallocate free space on the SD card if you chose that option in *raspi-config*. Again, allow about 1 minute per Gb on the card.

sudo shutdown -r now

Check everything works

When your Pi comes back up, check that VNC works on port 5901. You can do this on a Mac by using Screen Sharing in the Finder by choosing Go > Connect to Server and then typing vnc://pi@192.168.1.x:5901, using your Pi’s IP address.

You can also check SSH from Terminal:

ssh pi@192.168.x.x

If it works, that’s it, you’re done! Shut down the Pi and relocate it somewhere else with just a power lead and network cable.

sudo halt

Post navigation

← The New Minecraft Club
Gothamic Beta Pebble Watch Face 1.0 →

Looking for my Prompting Frameworks? They've moved!

January 2013
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Jun   Apr »
  • Behind the Screens: Optimising My Newsletter With AI
  • Outdoor Summer Cinema
  • Cold Brew With Lemon and Dalgona at Home: Simple Summer Coffee Experiments
  • Perplexity does video generation now
  • Thoughts on Claude
  • August 2025
  • July 2025
  • May 2025
  • April 2025
  • February 2025
  • January 2025
  • December 2024
  • June 2024
  • May 2018
  • March 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • July 2017
  • May 2017
  • March 2017
  • December 2015
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • April 2013
  • January 2013
  • June 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • February 2011
  • November 2010
  • July 2009
  • January 2008

AI animation apple author tools automation bbc books camera gear Canon EOS M200 Claude coding content creation course creation education Elgato Prompter EOS Webcam Utility Pro Estonia Gaming garageband imovie Informatic AI ios iPad launch center pro lecture london mac mcedit minecraft newsletter os x personalization productivity raspberry pi Remote Resilience Hub restrictions scifi star wars tech technology textexpander URL schemes valencia video recording webcam software

  • Bluesky
  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Mail
  • Mastodon
  • Medium
  • YouTube
  • X
© 2025 Jim Christian | Powered by Minimalist Blog WordPress Theme