Run OpenWRT in Proxmox VE
Date:
[]
OpenWRT is a powerful and highly customizable Linux distribution for embedded devices, particularly routers. This post will guide you through setting up an OpenWRT virtual machine (VM) in Proxmox VE. The installation process is different than mainstream distros such as Ubuntu or Fedora, because OpenWRT are distributed in raw
format instead of iso
images.
Below I have created the steps for your reference
Step 1: Download the OpenWRT Image
- Go to the OpenWRT release page.
- Select the latest stable release.
- Navigate to
targets
->x86
->64
. - Right-click on
generic-ext4-combined.img.gz
(not the "efi" version) as in the picture below and copy the link.
Step 2: Prepare the Image on Proxmox Host
-
On your Proxmox host, open a terminal and download the archive using the copied link:
wget *paste link here*
-
Unpack the downloaded archive:
gunzip openwrt-*.img.gz
Step 3: Resize the Image
Resize the image to the desired size for your VM's disk. For example, to resize it to 8 GiB:
qemu-img resize -f raw openwrt-*.img 8G
Step 4: Create a New VM in Proxmox
- In the Proxmox VE web interface, create a new VM.
- Ensure the following settings:
- No installation media
- BIOS: SeaBIOS
- No drives
Do not start the VM yet.
Step 5: Import the Resized OpenWRT Image
Import the resized OpenWRT image into the new VM:
qm importdisk *VMID* openwrt-*.img *STORAGEID*
Replace *VMID*
with your VM ID and *STORAGEID*
with your storage ID.
Step 6: Configure the Disk
- Go to the VM -> Hardware.
- Select the newly imported disk named "Unused Disk 0".
- Press "Edit".
- Set the disk to VirtIO with "Discard" and "IO Thread" enabled.
- Press OK.
Step 7: Add Networking and Other Devices
Add any necessary networking or other devices to your VM.
This is how it looks like on my test VM. I have 2 adapters set up (one for LAN, one for WAN),
but you may use any number of network as you wished.
Step 8: Start the VM
You're done! Start the VM and enjoy all the routing capabilities of OpenWRT.
Further Reading
Now you should have a fully functional OpenWRT virtual machine running on Proxmox VE. Enjoy your new routing setup