Skip to content

Instantly share code, notes, and snippets.

@symm
Last active May 27, 2024 09:02
Show Gist options
  • Save symm/5125a1c97dc65056467082bfe64feb2d to your computer and use it in GitHub Desktop.
Save symm/5125a1c97dc65056467082bfe64feb2d to your computer and use it in GitHub Desktop.
Installing Mikrotik RouterOS on Proxmox VE easily
#!/bin/bash
# Adapted from https://www.apalrd.net/posts/2023/tip_routeros/
set -e
# https://mikrotik.com/download
VERSION="7.14.3"
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