Last active
June 26, 2024 16:34
-
-
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 | |
# https://mikrotik.com/download | |
VERSION="7.15.1" | |
VM_ID="940" | |
wget --no-clobber "https://download.mikrotik.com/routeros/$VERSION/chr-$VERSION.img.zip" | |
unzip -n chr-$VERSION.img.zip | |
qm create $VM_ID --name "temp-mikrotik-ros-$VERSION" --ostype l26 | |
qm set $VM_ID --net0 virtio,bridge=vmbr0 | |
qm set $VM_ID --serial0 socket --vga serial0 | |
#Yes, really, this is how little RAM it needs | |
qm set $VM_ID --memory 256 --cores 2 --cpu host | |
#Import the disk as scsi0, default boot order, resize up to 8G | |
qm set $VM_ID --scsi0 local-lvm:0,import-from="$(pwd)/chr-$VERSION.img",discard=on | |
qm set $VM_ID --boot order=scsi0 --scsihw virtio-scsi-single | |
qm disk resize $VM_ID scsi0 8G | |
#Make it a template | |
qm template $VM_ID | |
rm chr-$VERSION.img |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment