Skip to content

Instantly share code, notes, and snippets.

@ryuheechul
Last active April 14, 2024 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryuheechul/e829b7846a965638deeb122bdd0b403c to your computer and use it in GitHub Desktop.
Save ryuheechul/e829b7846a965638deeb122bdd0b403c to your computer and use it in GitHub Desktop.
How to "Install" an OpenWRT VM in Proxmox with UEFI

Existing references I looked at before I went on trial and error until eventually I managed to make it work:

Note

Although links above were good references to look at so I didn't have to start from scratch, following none of them actually worked for me. Hence, I'm leaving my own note after figuring things out.

My situation:

  • Proxmox on x86-64 machine
  • booting with OVMF (UEFI, since I want to passthrough hardware at somepoint)
  1. Go to OpenWRT release page, select the latest release stable release, then targets -> x86 -> 64. Right-click generic-ext4-combined-efi.img.gz and copy the link.

  2. On the Proxmox host, download the archive and unpack it:

# I will use example link here but yours might different depends on the version
wget https://downloads.openwrt.org/releases/23.05.3/targets/x86/64/openwrt-23.05.3-x86-64-generic-squashfs-combined-efi.img.gz
# don't forget unzipping, because this is where I accidently skipped it at my second attempt (my first attempt I didn't download 64 bit version so that failed)
# - surpringly (or maybe not surprisingly) both `qemu-img resize` and `qm importdisk` works on `.gz` file
# - so the disk will imported with compressed bits which doesn't make any sense to the UEFI boot loader of course...
gzip -d openwrt-23.05.3-x86-64-generic-ext4-combined-efi.img.gz
  1. Resize the image to be the size you want your VM's disk to be (example with 8 GiB):
# choose your own size but I chose 2G
qemu-img resize -f raw openwrt-23.05.3-x86-64-generic-ext4-combined-efi.img 2G
  1. Create a new VM in Proxmox. Similar to https://www.youtube.com/watch?v=gbyjK4ni198&t but make sure to use:
  • no installation media
  • OVMF
  • no drives (you can delete the EFI disk created due to choosing OVMF)
  • do not start the VM yet after creating
  1. Import the resized OpenWRT image into the new VM:
# qm importdisk *VMID* openwrt-*.img *STORAGEID*
qm importdisk 101 openwrt-23.05.3-x86-64-generic-ext4-combined-efi.img local-lvm
  1. Go to the VM -> Hardware, select the newly imported disk named "Unused Disk 0", press "Edit" and simply click "Add"
  • or you can edit whatever option you like or need
  1. Add whatever networking or other devices you need.

  2. Start the VM and it should be booting to OpenWRT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment