Last active
September 22, 2025 21:30
-
-
Save symm/5125a1c97dc65056467082bfe64feb2d to your computer and use it in GitHub Desktop.
Installing Mikrotik RouterOS on Proxmox VE easily
This file contains hidden or 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/bash | |
| # Adapted from https://www.apalrd.net/posts/2023/tip_routeros/ | |
| set -e | |
| # Find latest CHR version at https://mikrotik.com/download | |
| CHR_VERSION="7.19.2" | |
| VM_ID=905 | |
| STORAGE=local-zfs | |
| #STORAGE=local-lvm | |
| VM_NAME="temp-mikrotik-chr-$CHR_VERSION" | |
| VM_IMAGE="chr-$CHR_VERSION.img" | |
| wget -c --no-clobber "https://download.mikrotik.com/routeros/$CHR_VERSION/chr-$CHR_VERSION.img.zip" | |
| unzip -n chr-$CHR_VERSION.img.zip | |
| qm destroy $VM_ID || true | |
| qm create $VM_ID --name $VM_NAME --ostype l26 | |
| qm set $VM_ID --net0 virtio,bridge=vmbr0,firewall=1 | |
| qm set $VM_ID --serial0 socket --vga serial0 | |
| qm set $VM_ID --memory 256 --cores 2 --cpu host | |
| qm set $VM_ID --scsi0 ${STORAGE}:0,import-from="$(pwd)/$VM_IMAGE",discard=on | |
| qm set $VM_ID --boot order=scsi0 --scsihw virtio-scsi-single | |
| qm set $VM_ID -description "Username: admin<br />Password: blank<br/><a href=\"https://help.mikrotik.com/docs/spaces/ROS/pages/18350234/Cloud+Hosted+Router+CHR\">docs</a>" | |
| qm disk resize $VM_ID scsi0 8G | |
| qm set $VM_ID --agent 1 | |
| qm template $VM_ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment