You can use Photon OS as a virtual machine on Raspberry Pi (RPi). You can download Photon OS and install the Photon OS distribution on vSphere.
This the multi-page printable view of this section. Click here to print.
Running Photon OS on Raspberry Pi
- 1: Prerequisites for Running Photon OS on Raspberry Pi
- 2: Installing Photon OS on Raspberry Pi
- 3: Enabling Raspberry Pi Interfaces using Device Tree
1 - Prerequisites for Running Photon OS on Raspberry Pi
Before you use Photon OS within RPi, perform the following prerequisite tasks:
Verify that you have the following resources:
Resource Description Raspberry Pi 3 Raspberry Pi 3 Model B or Model B+ board. This will serve as the target of the installation. Raspberry Pi 4 Raspberry Pi 4 Model B or Model B+ board. This will serve as the target of the installation. Host computer A computer equipped with the following:
1. An SD card reader.
2. Software utilities to flash an image onto an SD-card (details and instructions provided below).
Distribution File Photon OS RPi image downloaded from URL Note: Photon OS RPi image is available only from Photon 3.0 onwards.
Download Photon OS.
To install Photon OS on a Raspberry Pi, you must download the Photon OS RPi image, which is distributed as a compressed raw disk image with the file extension
.raw.xz
.Note: You cannot use the Photon ISO to install on RPi.
Go to the following URL and download the latest release of Photon OS image for RPi: https://packages.vmware.com/photon/4.0/GA/rpi/rpi.tar.xz.
For instructions, see Downloading Photon OS.
2 - Installing Photon OS on Raspberry Pi
You can get Photon OS up and running on an RPi board, by flashing the Photon RPi image onto the board’s SD card.
Flash Photon OS on Raspberry Pi
After you have downloaded the Photon RPi image with the file extension *.raw.xz
, decompress the file to *.raw
and then you can choose one of the methods below to flash it onto the RPi SD card.
- Flash Photon to RPi using Etcher
- Flash Photon to RPi using Linux CLI
Flash Photon to RPi using Etcher
- Install Etcher https://etcher.io/, which is a utility to flash SD cards attached to your host computer.
- Plug the RPi SD card into your host computer’s SD card reader.
- Perform the following steps on the Etcher GUI: Select image -> Select drive -> Flash, by selecting the Photon OS RPi as image and the RPi SD card as drive.
Flash Photon to RPi using Linux CLI
If you have Linux running on your host computer, install the
xz
package, which provides thexz
compression utility and related tools, from your distribution package manager.Plug the RPi’s SD card into your host computer’s SD card reader.
Identify the device file under
/dev
that refers to the RPi SD card. For example,/dev/sdc
. This file path is used to flash the Photon image onto the RPi in the next step.Note: Make sure that you are flashing to the device file that refers to your RPi3 SD card. Running the below command with an incorrect device file will overwrite that device without warning and might result in a corrupted disk. The device file ‘/dev/sdc` is an example and might not be the device file in your case.
Run the following command to flash Photon onto the RPi SD card:
xzcat <photon-rpi4-image.raw.xz> | sudo dd of=/dev/sdc bs=4M conv=fsync
Boot Photon OS on Raspberry Pi
After you flash Photon OS successfully onto the RPi SD card, eject the card from your host computer and plug it back into the RPi board.
When you power on Raspberry Pi , it boots with Photon OS.
After the splash screen, Photon OS prompts you to log in.
Update login credentials
The Photon OS RPi image is configured with a default password. However, all Photon OS instances that are created using this image will require an immediate password change upon login. The default account credentials are:
- Username:
root
- Password:
changeme
After you provide these credentials, Photon OS prompts you to create a new password and type it a second time to verify it. Photon OS does not allow common dictionary words for the root password. When you are logged in, you will see the shell prompt.
You can now run tdnf list
to view all the ARM packages that you can install on Photon OS.
3 - Enabling Raspberry Pi Interfaces using Device Tree
Photon OS RPI images from Photon 4.0 has Device Tree Overlay support. And these images have compiled Overlays to enable/disable Rpi Interface. Perform the following:
SPI Interface: Execute following commands to enable SPI Interface:
mkdir /sys/kernel/config/device-tree/overlays/
cat /boot/efi/overlays/rpi-enable-spi0.dtbo > /sys/kernel/config/device-tree/overlays/spi/dtbo
Audio Interface: Execute following commands to enable Audio Interface:
mkdir /sys/kernel/config/device-tree/overlays/audio
cat /boot/efi/overlays/rpi-enable-audio.dtbo > /sys/kernel/config/device-tree/overlays/audio/dtbo
Note: Ensure that the linux-drivers-sound rpm is installed.
I2C Interface: Execute following command to enable I2C Interface:
modprobe i2c-dev
#Customizing Device Tree Overlay
Photon OS also provides Device Tree Compilers (i.e. dtc), to compile Customised Device Tree Overlays. Execute following command to install dtc on Photon OS:
tdnf install dtc
Execute following command to compile the overlay:
dtc -@ -O dtb -o my_overlay_dt.dtbo my_overlay_dt.dts
For more information about format of Device Tree Overlay, see https://www.kernel.org/doc/Documentation/devicetree/overlay-notes.txt