Super Easy Ubuntu on Raspberry Pi with Headless/SSH/USB Mass Storage

Recently I wanted to setup a simple quick fallback IPFS server to support my NFT market place app VizCache.

Luckily I had a Raspberry Pi and 1TB SSD lying around so I decided to put those to use and hook them up to my router, the only problem is that I didn’t have a usb keyboard and I needed SSH enabled. In the past I have browsed forums telling me to place a file named ssh in the root of the image, but this project is supposed to boot from USB HDD and I wanted a simple way to get it done…

Enter Raspberry Pi Imager v1.7.1!

Since Ubuntu/Pi integration is now supported by Canonical this process was extremely straight forward. Download the Raspberry Pi Imager and lets take a look

First Select Operating system

I went for the current ubuntu 64bit server, but you can actually choose anything you want, check out the list as there are some really great options and you can even upload your own image if you don’t find what you are looking for. Ok moving on>>>

Choose Storage

Obvious plug in your storage device and select it from the list. Two thing to consider…

  1. This process will OVERWRITE everything on the disk, so make sure you are sure you want to clear this storage device and/or have a backup.
  2. Verify that the power consumption from your storage device can be supported by the raspberry pi power bus (which is kinda small) or your drive has supplemental power.

🧙🏼‍♂️ Magical Settings!

So here is where the magic happens for solving my keyboard and headless problem. Click this settings button.

Inside here you will find the way to preload the ubuntu image with WIFI / SSH / User & Password + more . So basically getting you all setup as a head-less, keyboard -ess remote server with just a few check boxes, huzzah!

Burn it Baby!!

Now write the image.

Plug in drive, power and data … … … let it boot and ssh into your pi. In my case it was important to also have the wifi information in the config so that cloud-init could run setup, otherwise I could get ethernet to work… weird huh, you think wired would be more stable 🤷‍♂️

ssh pi@192.168.0.123 
...<enter password created in settings ;)>

Now look at that, easy as 🥧 , couldn’t resit. Enjoy!

Pfau

UPDATE:

So I ran into some issues with SSH and a previous key already on my machine it was making me pull my hair out trying to get ssh to work. I was looking into routers, firewall, cables, blah and ect.

Here is what I figured out,

broadreef_dev@Michaels-MBP ~ % ssh-keygen -R 192.168.0.237
# Host 192.168.0.237 found: line 4
# Host 192.168.0.237 found: line 5
# Host 192.168.0.237 found: line 6
/Users/broadreef_dev/.ssh/known_hosts updated.
Original contents retained as /Users/broadreef_dev/.ssh/known_hosts.old
broadreef_dev@Michaels-MBP ~ % 

I need to remove the old key for that host name so that we could get a new one.

Similar Posts

Leave a Reply

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