Skip to content

janelia-experimental-technology/raspberrypi_setup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

raspberrypi_setup

Repository Information

Author
Peter Polidoro
License
BSD-3-Clause
  • Modification Date: 2023-02-10
Ubuntu Version
ubuntu-22.04.1-preinstalled-server-arm64+raspi

Raspberry Pi Setup

Setup Ubuntu Server SD Card

On a host computer run:

cd ~/Downloads && wget https://cdimage.ubuntu.com/releases/22.04.1/release/ubuntu-22.04.1-preinstalled-server-arm64+raspi.img.xz

On a host computer run this before plugging SD card into host computer:

lsblk -p

Plug SD card into host computer and run:

lsblk -p

After verifying which device is your SD card (e.g. /dev/sdf1), unmount it using the following command:

umount /dev/sdf[0-9]

Next, we can write the image file to the SD card (be very careful using dd!):

  • if= path to your image
  • of = where to write output (note: do not include partition number)

Wait for a long time for command to finish.

cd ~/Downloads && xzcat ubuntu-22.04.1-preinstalled-server-arm64+raspi.img.xz | sudo dd of=/dev/sdf bs=4M status=progress conv=fsync
sudo touch $(findmnt -S /dev/sdf1 -o TARGET -n)/ssh
umount /dev/sdf[0-9]

Remove SD card from host computer.

Initialize Raspberry Pi

Insert the SD card you’ve set up with Ubuntu Server into the microSD card slot on the underside of your Raspberry Pi.

Use an Ethernet cable to connect the Ethernet port on Raspberry Pi to an Ethernet socket on the wall, or toon your internet router, or to a host computer ethernet port, or to a usb to ethernet adapter.

Plug the USB power supply into a socket and connect it to your Raspberry Pi’s power port.

SSH into Raspberry Pi

ssh ubuntu@ubuntu.local

If ‘No route to host’ error:

ip addr
# find ip addresses of various ip links on the host computer
# e.g. 192.168.1.117
nmap -p22 --open -sV 192.168.1.0/24
ssh ubuntu@192.168.1.77
# e.g. 10.42.0.1
nmap -p22 --open -sV 10.42.0.0/24
ssh ubuntu@10.42.0.193

Change password

Initial password is: ubuntu Change password

Update

# may need to reboot before upgrade if unattended-upgr has cache lock
sudo apt update && sudo apt full-upgrade -y
sudo apt autoremove -y
# reboot after upgrade

Setup avahi-daemon so you can reach hostname.local from from host OS

sudo apt install -y avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
sudo reboot

Change username and hostname

Create temporary user

sudo adduser tempuser && sudo usermod -aG sudo tempuser
exit

Change username

ssh tempuser@<ipaddress>
sudo usermod -l newusername -d /home/newusername -m ubuntu
sudo groupmod -n newusername ubuntu
sudo ln -s /home/newusername /home/ubuntu
exit
ssh newusername@ubuntu.local
sudo userdel -r tempuser
exit

Change hostname

hostnamectl
sudo hostnamectl set-hostname newhostname
sudo reboot

Setup cockpit for managing Ubuntu with a web console

sudo apt install -y cockpit

Access cockpit web console on Ubuntu

https://hostname.local:9090

Setup SSH Keys

ssh-keygen -t ed25519 -C "your_email@example.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

Install Docker

https://github.com/janelia-experimental-technology/docker_setup/blob/master/DOCKER_SETUP_LINUX.org

Connecting to Raspberry Pi

Ubuntu

USB to Ethernet Adapter Direct Connection

Setup Ethernet connection for USB ethernet adapter device and under IPv4 settings set method to ‘Shared to other computers’.

Windows

Download Bonjour Print Services for Windows

To make hostname.local work with windows, you must download and install Bonjour for Windows:

https://developer.apple.com/bonjour/

USB to Ethernet Adapter Direct Connection

Setup Ethernet connection for USB ethernet adapter device and in Network and Sharing Center select network with internet access and allow internet connection sharing with Ethernet connection of USB ethernet adapter.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published