Last active
February 2, 2024 01:45
-
-
Save Taurolyon/4fe244cdef31a6310290c77feff3fbb5 to your computer and use it in GitHub Desktop.
Proxmox OpenWRT script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# inspired by https://computingforgeeks.com/install-and-configure-openwrt-vm-on-proxmox-ve/ | |
VM_NAME=OpenWrt | |
VM_ID=$(pvesh get /cluster/nextid) | |
RAM=2048 | |
CORES=1 | |
BRIDGE=vmbr1 | |
IMAGE=./openwrt.img | |
STORAGE=local | |
VER=$(curl --silent "https://api.github.com/repos/openwrt/openwrt/releases/latest" | grep '"tag_name"' | sed -E 's/.*"v([^"]+)".*/\1/') | |
wget -O openwrt.img.gz "https://downloads.openwrt.org/releases/$VER/targets/x86/64/openwrt-$VER-x86-64-generic-ext4-combined-efi.img.gz" | |
du -sh openwrt.img.gz | |
gunzip ./openwrt.img.gz | |
qemu-img resize -f raw ./openwrt.img 5G | |
qm create --name $VM_NAME $VM_ID --memory $RAM --cores $CORES --cpu cputype=kvm64 --net0 virtio,bridge=$BRIDGE --scsihw1 | |
qm importdisk $VM_ID $IMAGE $STORAGE | |
qm set $VM_ID --scsihw virtio-scsi-pci --virtio0 $STORAGE:$VM_ID/vm-$VM_ID-disk-0.raw | |
qm set $VM_ID --serial0 socket --vga serial0 | |
qm set $VM_ID --boot c --bootdisk virtio0 | |
qm set $VM_ID --onboot 1 | |
# qm start $VM_ID && qm terminal $VM_ID |
I haven't tested it, but https://gist.github.com/Taurolyon/985d537cb256f52cda2190db2f86ffb1#file-prox_openwrt_uefi-sh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This creates a BIOS VM. I want to try and modify this to create an EFI version.