Using virtualization software like Proxmox allows you to turn a single Raspberry Pi into a mini datacenter capable of running multiple virtual machines and containers. This provides flexibility to consolidate services and try different software without needing dedicated hardware for each one.
Installing Proxmox on a Raspberry Pi takes a bit more effort than a regular Linux distribution, but it opens up many possibilities. This guide will walk through the entire process of flashing the Proxmox image, initial server setup, optimizing performance, and basic usage.
Why Proxmox on Raspberry Pi
Here are some of the main advantages of running Proxmox on a Raspberry Pi:
- Low Cost – Raspberry Pis are inexpensive single board computers perfect for homelabs. Less wasted resources compared to running everything bare metal.
- Energy Efficient – Consolidating services into VMs/LXCs allows unused boards to be powered off saving electricity costs.
- Space Saving – Small form factor takes up less space instead of multiple dedicated machines and cables.
- Mobility – Easy to backup and migrate VMs to move your lab anywhere. Raspberry Pi’s small size makes transportation easy.
- Educational – Great way to learn server virtualization, containerization, clustering and Linux networking/storage concepts at low cost.
The end result is a compact yet capable server platform perfect for home use and experimentation.
Hardware Requirements
These are the official minimum hardware requirements from Proxmox to comfortably run their environment:
- Raspberry Pi 4 (all models)
- 8 GB RAM
- 64 GB+ fast microSD card (avoid slow cards)
- Heatsinks + fan case strongly recommended
Adequate cooling is very important when running intensive workloads otherwise performance will throttle during extended load from thermal throttling. Using higher spec hardware meets the requirements with more headroom.
Download Proxmox Image
First download the Proxmox VE image for Raspberry Pi from the official website.
The latest release at time of writing is v7.2 with the .xz compressed image file about 476 MB. Download and decompress this file to get the raw .image file.
Alternative option is downloading the community provided image with optimizations specific for the Raspberry Pi hardware. This can provide better performance over the generic reference image.
Next this Proxmox image will be written to a microSD card and used to boot up the Raspberry Pi.
Write Image & Boot Up
With the compressed disk image downloaded and decompressed the next step is flashing it onto the microSD.
This can be done using utilities like Etcher or dd on Linux/macOS. Windows users can try Rufus.
The microSD card will be completely erased so backup any required data first!
With the Proxmox image written insert the microSD into the Raspberry Pi and connect ethernet cable + power supply. It will now boot up directly into the Proxmox VE setup wizard.
Initial Server Setup
The first boot will launch the configuration wizard used to setup core server settings.
- Set location/time zone
- Configure networking
- Create administrative user
The web-based Proxmox GUI can then be accessed at the configured management IP using the credentials entered.
With access to the web UI the system can also be updated from the shell by running:
apt update && apt dist.-upgrade -y && reboot
Reboot once to ensure latest package versions and kernel are loaded.
Optimizing Performance
Running Proxmox introduces some extra overhead from the virtualization management layer. But there are optimizations specific for improving performance on the Raspberry Pi hardware:
- Allocate More RAM to GPU
By default only 128 MB is given to GPU memory.
- Manually set the gpu_mem value higher in /boot/firmware/config.txt.
- gpu_mem=512
- Reboot required for this to take effect
- Set CPU Governor Setting
The OnDemand governor will provide best performance and automatically clock CPU speeds faster under load.
- Add the following line to /etc/default/cpufrequtils:
- GOVERNOR=”OnDemand”
- Then reload settings:
- systemctl disable cpufrequtils.service
- systemctl enable cpufrequtils.service
- systemctl restart cpufrequtils.service
- Enable Kernel Swap Support
Zram creates compressed swap in RAM. This speeds up swapping significantly and allows more aggressive overcommitting.
- Install required package:
- apt install zram-tools
- The service is enabled by default on Proxmox so no further action needed.
- Mount External USB Storage
The internal microSD storage is limited and slow. For best performance mount external fast USB disks and SSDs. This also allows resizing as needed instead of the fixed microSD card size.
First identify device names:
- lsblk
- Then create an ext4 filesystem:
- mkfs.ext4 /dev/sda1
- Finally add a mount entry in /etc/fstab:
- /dev/sda1 /mint/usbdisk ext4 defaults 0 2
- Reboot and the drive will now persistently mount on boot.
Creating Virtual Machines
With Proxmox server fully set up it’s time to create some VMs!
- Add ISO and Disk Images – First locate the ISO install images and disk templates to upload. These can be stored locally or downloaded on demand.
- Launch VM Wizard – Click Create VM then go through the wizard to configure new virtual machine.
- Select Type/ISO – Choose type as Linux and select install ISO previously uploaded.
- Configure Options – Set CPU cores, RAM amount, add storage disks, configure network, etc. Based on OS minimum requirements.
- Start VM – Launch the VM! Connect via VNC and go through OS install process inside the virtual machine.
Repeat steps to create additional VMs for all services with appropriate specs for each.
Managing Containers
Proxmox also includes LXC support for fast containers. Make use of these lighter weight containers for microservices:
- Download Template – Go to the LXC template library and download the desired base image.
- Create Container – Use the GUI or CLI pct tool for setup.
- Customize Options – Tweak config settings as needed for application running inside container.
- Start Container – Launch the newly created LXC!
Containers complement full VMs allowing services to run more efficiently.
Conclusion
Getting Proxmox running on the Raspberry Pi unlocks tons of new possibilities. It’s an affordable platform for gaining practical first-hand experience with datacenter virtualization concepts.
Hopefully this guide covered the full setup process starting from flashing the Proxmox image to configuring VMs and containers. The Raspberry Pi may have basic specs on paper but can punch above its weight by maximizing performance and running services in a virtualized architecture.
In summary the key aspects are:
- Flashing the Proxmox image and initial server setup
- Optimizing the system for best performance
- Adding external storage via USB for capacity and speed
- Creating both VMs and LXC containers customized for services
- Taking advantage of containerization and virtualization
So grab a Raspberry Pi and begin building your virtual home lab!