Batmen.cc


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

  1. Go to the OpenWRT release page.
  2. Select the latest stable release.
  3. Navigate to targets -> x86 -> 64.
  4. Right-click on generic-ext4-combined.img.gz (not the "efi" version) as in the picture below and copy the link.

openwrt-download-page

Step 2: Prepare the Image on Proxmox Host

  1. On your Proxmox host, open a terminal and download the archive using the copied link:

    wget *paste link here*
  2. 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

  1. In the Proxmox VE web interface, create a new VM.
  2. 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

  1. Go to the VM -> Hardware.
  2. Select the newly imported disk named "Unused Disk 0".
  3. Press "Edit".
  4. Set the disk to VirtIO with "Discard" and "IO Thread" enabled.
  5. Press OK.

Step 7: Add Networking and Other Devices

Add any necessary networking or other devices to your VM. openwrt-vm-hardware-page 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