How2Pi.com LogoOrangePi-5 Libre-Renegade RaspberryPi-4B Radxa-Zero OrangePi-Zero2
Quick and Simple How Tos for SBC Devices!
Under Construction: Just dumping my tutorials here for now. I will organize them later...
Install Armbian
Orange Pi 5 (Armbian) – Installation
This How-to covers installing Armbian on an Orange Pi 5 (RK3588S).
1. Download the Desktop Version of Armbian for the Orange Pi 5 from here: https://www.armbian.com/orangepi-5
2. Download balena Etcher (Available for Windows / Mac OS / Linux) from here: https://www.balena.io/etcher#download-etcher
3. Plug your SD Card / Reader into your Mac or PC:
4. Open Etcher and flash the Armbian image to your SD Card:
5. Insert the SD card into your Orange Pi, boot into Armbian and answer setup questions.
Orange Pi 5 (Armbian) – Boot from M.2 SSD
This How-to covers how to copy your bootable SD card to a M.2 SSD and boot from it.
IMPORTANT: You can only clone a SD card of equal or smaller capacity to the target SSD drive
1. Use gdisk to delete any partitions that may be present on the SSD:
sudo gdisk /dev/nvme0n1
2. Make the following choices marked in green:
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/nvme0n1: 250069680 sectors, 119.2 GiB
Model: KBG40ZNS128G NVMe KIOXIA 128GB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 1303EA25-A12A-7546-9CD5-D81C74EF55FE
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 2048, last usable sector is 250069646
Partitions will be aligned on 2048-sector boundaries
Total free space is 2538126 sectors (1.2 GiB)

Number Start (sector) End (sector) Size Code Name
1 32768 557055 256.0 MiB EA00 bootfs
2 557056 247562240 117.8 GiB 8300

Command (? for help): d
Partition number (1-2): 1

Command (? for help): d
Using 2

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/nvme0n1.
The operation has completed successfully.
3. Now clone the SD card to the NVMe drive with the following command:
sudo cat /dev/mmcblk1 > /dev/nvme0n1
Note: If you get the following error: cat: write error: No space left on device.
This means your SD card’s partition table was too big for your NVMe drive.
4. Setup the Orange Pi to boot from the NVMe drive: Run the command:
sudo armbian-config
5. Select System → Install and then select Install/Update the bootloader on MTD Flash
6. Power off the system and eject the SD card. You should now be able to boot from the NVMe drive.
Note: The Orange Pi will still boot to the SD (if present) by default.
Note: It’s a good idea to keep the SD card handy as a clean snapshot / backup of your Orange Pi system in case you need to roll back any changes made beyond this point.
Note: If your SD card was smaller than your NVMe SSD, you will want to use a utility like GParted (Included with Armbian) to resize (expand) the root partition to utilize unallocated space.
Orange Pi 5 (Armbian) – Setup a VNC Server
This How-to covers how to setup a VNC server on Orange Pi 5 via x11vnc.
1. Install x11vnc and net-tools:
sudo apt install x11vnc
2. To create a service to start x11vnc at system boot:
sudo bash -c 'cat <<EOF > /lib/systemd/system/x11vnc.service
[Unit]
Description=Start x11vnc Service
Requires=display-manager.service
After=lightdm.service

[Service]
ExecStart=/usr/bin/x11vnc -auth guess -loop -forever -safer -shared -ultrafilexfer -bg -o /var/log/x11vnc.log
ExecStop=/usr/bin/killall x11vnc

[Install]
WantedBy=multi-user.target
Try: ExecStart=/usr/bin/x11vnc -auth guess -forever -display :0 -o /var/log/x11vnc.log
EOF'
3. Now enter the following commands:
sudo systemctl daemon-reloadsudo systemctl enable x11vncsudo systemctl start x11vnc
4. You should now be able to connect to your Orange Pi from a VNC client like VNC Viewer using your IP address and default port (5900):
Orange Pi 5 (Armbian) – Setup NoVNC
This How-to covers how to setup NoVNC which allows you to connect to your Orange Pi’s VNC server using a web browser. No VNC client required!
1. Install NoVNC:
sudo git clone https://github.com/novnc/noVNC /usr/share/novnc
2. To create a service to start NoVNC at system boot:
sudo bash -c 'cat <<EOF > /lib/systemd/system/novnc.service
[Unit]
Description=Start NoVNC Service
Requires=x11vnc.service
After=x11vnc.service

[Service]
ExecStart= /usr/share/novnc/utils/novnc_proxy --listen 6080 --vnc localhost:5900
ExecStop=/usr/bin/killall websockify

[Install]
WantedBy=multi-user.target
EOF'
3. Now enter the following commands:
sudo systemctl daemon-reloadsudo systemctl enable novncsudo systemctl start novnc
4. You can now connect to your Orange Pi via VNC over a web browser using the following syntax: http://<Pi Device IP Address>:6080/vnc.html
Orange Pi 5 (Armbian) – QEMU Installation
This How-to covers how to compile QEMU from source to run on the Orange Pi.
1. Make sure Armbian has the latest updates:
sudo apt-get update && sudo apt-get -y upgrade
2. Now install all of the dependencies to build and run QEMU:
sudo apt-get -y install libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build git-email libaio-dev libbluetooth-dev libcapstone-dev libbrlapi-dev libbz2-dev libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev libibverbs-dev libncurses5-dev libnuma-dev git librbd-dev librdmacm-dev libsasl2-dev libsdl2-dev libseccomp-dev libsnappy-dev libssh-dev libvde-dev libvdeplug-dev libvte-2.91-dev libxen-dev liblzo2-dev valgrind xfslibs-dev libslirp-dev p7zip-full unzip
3. Install QEMU (Screamer Fork) from git
git clone -b screamer https://github.com/mcayland/qemu ~/qemu-screamer
4. Change to the qemu-screamer folder and then run ./configure . This takes about a minute…
cd ~/qemu-screamer/./configure --disable-kvm --disable-werror --target-list="i386-softmmu x86_64-softmmu ppc-softmmu"
5. Now run the make command to begin compiling. We will use 4 processor threads to speed things up. This takes a while.
make -j 4
6. Download a bootable iso file to test with:
wget https://releases.ubuntu.com/bionic/ubuntu-18.04.6-live-server-amd64.iso
7. Now start QEMU using the test iso:
IMPORTANT: The following command must be run on your Pi device (locally) and wont work via SSH.
./build/x86_64-softmmu/qemu-system-x86_64 -m 1G ./ubuntu-18.04.6-live-server-amd64.iso
Orange Pi 5 (Armbian) – SheepShaver Installation
This How-to covers how to install SheepShaver, a fast Macintosh Power PC emulator.
1. Make sure Armbian has the latest updates:
sudo apt-get update && sudo apt-get -y upgrade
2. Install all of the dependencies to build and run SheepShaver:
sudo apt-get -y install build-essential p7zip-full libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build git-email libaio-dev libbluetooth-dev libcapstone-dev libbrlapi-dev libbz2-dev libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev libibverbs-dev libncurses5-dev libnuma-dev git librbd-dev hfsutils librdmacm-dev libmpfr-dev libsasl2-dev libsdl2-dev libseccomp-dev libsnappy-dev libssh-dev libvde-dev libvdeplug-dev libvte-2.91-dev libxen-dev liblzo2-dev valgrind xfslibs-dev libslirp-dev libgail-common autoconf p7zip-full unzip
3. Install SheepShaver from git
git clone https://github.com/kanjitalk755/macemu.git ~/macemu
4. Change to the SheepShaver directory and compile the source code:
cd ~/macemu/SheepShaver/make linkscd ~/macemu/SheepShaver/src/Unix./autogen.shmake -j 4
5. Create Sheepshaver prefs file:
bash -c 'cat <<EOF > ~/.sheepshaver_prefs
screen dga/960/540
ramsize 134217728
frameskip 0
gfxaccel true
ignoresegv true
ignoreillegal true
hardcursor true
scale_integer true
scale_nearest true
ether slirp
EOF'
6. Download, extract (and rename) the required system ROM file:
wget https://how2pi.com/f/macemu/NEWWORLD.ROM.zipunzip ./NEWWORLD.ROM.zip -d ~/
7. Create a blank virtual disk to install Mac OS on:
dd if=/dev/zero of=~/mac-ss.hd bs=1024k count=1024hformat -l 'Macintosh HD' ~/mac-ss.hd
8. Download and extract the Mac OS 9.0.4 installation CD then make it read only:
wget https://how2pi.com/f/macemu/Mac_OS_9.0.4.iso.7z7za e ./Mac_OS_9.0.4.iso.7zmv ./Mac_OS_9.0.4.iso ~/chmod 0444 ~/Mac_OS_9.0.4.iso
9. Create shell scripts and make them executable:
bash -c 'cat <<EOF > ~/installmac-ss.sh
~/macemu/SheepShaver/src/Unix/SheepShaver --rom ~/NEWWORLD.ROM --disk ~/mac-ss.hd --cdrom ~/Mac_OS_9.0.4.iso
EOF'
bash -c 'cat <<EOF > ~/runmac-ss.sh
~/macemu/SheepShaver/src/Unix/SheepShaver --rom ~/NEWWORLD.ROM --disk ~/mac-ss.hd
EOF'
chmod +x ~/installmac-ss.sh ~/runmac-ss.sh
10. Start Sheepshaver with the Mac OS installation cd:
IMPORTANT: The following commands must be run on your Pi device (locally) and wont work via SSH.
~/installmac-ss.sh
11. Run the Mac OS Installer program (Defaults are fine):
12. Once the installer is completed, shutdown the system: Special → Shutdown.
13. Now you can run Sheepshaver with the shell script:
~/runmac-ss.sh
Note: After you boot into your mac installation for the first time the Mac OS Setup Assistant will run. Using this tool will crash the system every time. Just close out of it.
Shortcut: You can download a preinstalled HD image by running the following commands:
wget https://how2pi.com/f/macemu/Mac_OS_9.0.4.hd.7z7za e ./Mac_OS_9.0.4.hd.7zmv ./Mac_OS_9.0.4.hd ~/mac-ss.hd
Orange Pi 5 (Armbian) – Basilisk II Installation
This How-to covers how to install Basilisk II, a fast Macintosh Power PC emulator.
1. Make sure Armbian has the latest updates:
sudo apt-get update && sudo apt-get -y upgrade
2. Install all of the dependencies to build and run Basilisk II:
sudo apt-get -y install build-essential p7zip-full libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build git-email libaio-dev libbluetooth-dev libcapstone-dev libbrlapi-dev libbz2-dev libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev libibverbs-dev libncurses5-dev libnuma-dev git librbd-dev hfsutils librdmacm-dev libmpfr-dev libsasl2-dev libsdl2-dev libseccomp-dev libsnappy-dev libssh-dev libvde-dev libvdeplug-dev libvte-2.91-dev libxen-dev liblzo2-dev valgrind xfslibs-dev libslirp-dev libgail-common autoconf p7zip-full unzip
3. Install Basilisk II from git
git clone https://github.com/kanjitalk755/macemu.git ~/macemu
4. Change to the Basilisk II directory and compile the source code:
cd ~/macemu/BasiliskII/src/Unix./autogen.shmake -j 4
5. Create the Basilisk II prefs file:
bash -c 'cat <<EOF > ~/.basilisk_ii_prefs
modelid 14
cpu 4
ramsize 67108864
screen dga/960/540
frameskip 1
ignoresegv true
scale_integer true
scale_nearest true
ether slirp
EOF'
6. Download, extract (and rename) the required system ROM file:
wget https://how2pi.com/f/macemu/QUADRA650.ROM.zipunzip -p ./QUADRA650.ROM.zip QUADRA650.ROM > ~/QUADRA650.ROM
7. Create a blank virtual disk to install Mac OS on:
dd if=/dev/zero of=~/mac-bii.hd bs=1024k count=256hformat -l 'Macintosh HD' ~/mac-bii.hd
8. Download and extract the Mac OS 8.1 installation CD:
wget https://how2pi.com/f/macemu/Mac_OS_8.1.iso.7z7za e ./Mac_OS_8.1.iso.7zmv ./Mac_OS_8.1.iso ~/chmod 0444 ~/Mac_OS_8.1.iso
9. Create shell scripts and make them executable:
bash -c 'cat <<EOF > ~/installmac-bii.sh
~/macemu/BasiliskII/src/Unix/BasiliskII --rom ~/QUADRA650.ROM --disk ~/mac-bii.hd --cdrom ~/Mac_OS_8.1.iso
EOF'
bash -c 'cat <<EOF > ~/runmac-bii.sh
~/macemu/BasiliskII/src/Unix/BasiliskII --rom ~/QUADRA650.ROM --disk ~/mac-bii.hd
EOF'
chmod +x ~/installmac-bii.sh ~/runmac-bii.sh
10. Start Basilisk II with the Mac OS installation cd:
IMPORTANT: The following commands must be run on your Pi device (locally) and wont work via SSH.
~/installmac-bii.sh
11. Run the Mac OS Installer program (Defaults are fine):
12. Once the installer is completed, shutdown the system: Special → Shutdown.
13. Now you can run Basilisk II with the shell script:
~/runmac-bii.sh
Note: After you boot into your mac installation for the first time the Mac OS Setup Assistant will run. Using this tool will crash the system every time. Just close out of it.
Shortcut: You can download a preinstalled hard disk image by running the following commands:
wget https://how2pi.com/f/macemu/Mac_OS_8.1.hd.7z7za e ./Mac_OS_8.1.hd.7zmv ./Mac_OS_8.1.hd ~/mac-bii.hd
Orange Pi 5 (Armbian) – Configure Mac OS 9 Virtual Machine (VM) on QEMU
This How-to covers how to setup old-school Mac OS 9 on QEMU in three easy steps.
1. Download the prebuilt OS 9.2.2 hard disk image file and extract:
cd ~/wget https://how2pi.com/f/macemu/Mac_OS_9.2.2.img.7z7za e ./Mac_OS_9.2.2.img.7zmv ./Mac_OS_9.2.2.img ~/mac.img
2. Make the shell script executable:
sudo chmod +x ./runmac-qemu.sh
3. Run the shell script to start QEMU using the downloaded hard disk image:
IMPORTANT: The following command must be run on your Pi device (locally) and wont work via SSH.
~/runmac-qemu.sh
Orange Pi 5 (Armbian) – Create a Desktop or Application Shortcut to Start your Mac OS 9 VM
This How-to covers how to create a desktop and/or application panel shortcut (icon) to start your Mac OS 9 VM easily.
1. Download an image to use for the icon / shortcut:
sudo wget https://clipground.com/images/mac-icon-png-4.png -P /usr/share/icons/
2. Create an icon (.desktop) file:
bash -c 'cat <<EOF > ~/macos9.desktop
[Desktop Entry]
Type=Application
Name=Mac OS 9
Comment=Run Mac OS 9 in Basilisk II Emulator
Exec=/bin/sh -c "$HOME/runmac-bii.sh"
Icon=/usr/share/icons/mac-icon-png-4.png
Terminal=false
EOF'
3. Make the shortcut icon executable:
sudo chmod +x ~/macos9.desktop
4. Move the shortcut to the applications panel:
mv ~/macos9.desktop ~/.local/share/applications/