Skip to content

Latest commit

 

History

History
110 lines (74 loc) · 3.68 KB

OSImaging.md

File metadata and controls

110 lines (74 loc) · 3.68 KB

The Server-With-a-PiKVM Project

Index

4.0 OS Imaging

PiKVM is not a software you will install on Raspberry Pi OS (formerly Raspbian). It is rather a lightweight OS, based on Arch Linux ARM.

For the Raspberry Pi 4 and Zero (2) W pre-compiled images are available. However, we will build the operating system ourselves. For that, you will need a x86-64 machine (or a virtual server).

In this example Debian 11 Bullseye was used.

📢 Official: Building PiKVM OS - PiKVM Handbook

4.1 Install Dependencies (e.g. Docker)

apt install git make curl binutils
apt install docker.io
usermod -aG docker $USER

mkdir /root/pikvm
cd /root/pikvm
git clone --depth=1 https://github.com/pikvm/os
cd os

4.2 Create Configuration File

Now you need to create a the configuration file config.mk at /root/pikvm/os/config.mk.

Do not use the default values for passwords. Instead, generate a random 16-character password using following command:

printf '%s\n' $(head /dev/urandom | LC_ALL=C tr -dc A-Za-z0-9 | head -c16)

⚠️ This configuration file is only valid for a Raspberry Pi 4 using the HDMI to CSI-2 Module.

# rpi4 for Raspberry Pi 4; rpi3 for Raspberry Pi 3; rpi2 for the version 2, zero2w for Zero2W
BOARD = rpi4

# Hardware configuration
PLATFORM = v2-hdmi

# Target hostname
HOSTNAME = kvm-srv1

# ru_RU, etc. UTF-8 only
LOCALE = en_US

# See /usr/share/zoneinfo
TIMEZONE = Europe/Berlin

# For SSH root user
ROOT_PASSWD = ...

# Web UI credentials: user=admin, password=<this>
WEBUI_ADMIN_PASSWD = ...

# IPMI credentials: user=admin, password=<this>
IPMI_ADMIN_PASSWD = ...

# SD card device
# (Irrelevant in our case, as we will burn the image later using the Raspberry Pi Imager)
CARD = /dev/mmcblk0

4.3 Build PiKVM OS and Make Image

After your configuration is ready, you can build the OS. That will take about half an hour:

make os

After that, we will make the image. It will be stored as xz compressed file in /root/pikvm/os/images

make SUDO= image

If not compressed, you can manually compress it as .tar.gz:

cd /root/pikvm/os/images
tar --dereference -czvf v2-hdmi-rpi4-latest.img.tar.gz v2-hdmi-rpi4-latest.img

4.4 Flash Image to MicroSD Card Using the Raspberry Pi Imager

You can download the offical Raspberry Pi Imager here. Flashing is easy, refer to the official documentation for that step:

📢 Official: Flashing the OS image - PiKVM Handbook