Skip to content

Instantly share code, notes, and snippets.

@brosahay
Created March 16, 2025 05:25
Show Gist options
  • Save brosahay/a8458ceb4a6c359ebb2ccd8f33064c81 to your computer and use it in GitHub Desktop.
Save brosahay/a8458ceb4a6c359ebb2ccd8f33064c81 to your computer and use it in GitHub Desktop.
unRaid OpenWRT VM installation

INSTALL

Download the image from https://archive.openwrt.org/releases/24.10.0/targets/x86/64/

# DOWNLOAD
wget https://archive.openwrt.org/releases/24.10.0/targets/x86/64/openwrt-24.10.0-x86-64-generic-ext4-combined.img.gz \
-O openwrt.img.gz
# EXTRACT
gzip -d openwrt.img.gz
# CONVERT IMG <-> QCOW2
qemu-img convert -O qcow2 openwrt.img openwrt.qcow2
# MOVE TO UNRAID DOMAIN
mkdir -pv /mnt/user/domains/openwrt/
mv openwrt.qcow2 /mnt/user/domains/openwrt/

Virtual machine settings

The following are the unRaid configuration for VM using Generic Linux VM

Linux
Logical CPU: 1/2 Core
Initial Memory: 128 MB
Machine: i440fx-7.1
BIOS: SeaBIOS
Primary vDisk Bus: VirtIO
Primary vDisk Location (Manual): /mnt/user/domains/openwrt/openwrt.qcow2
Network Model: virtio-net

Optionally, enable hardware passthrough if required from unRaid to VMs. This can be found under Tools -> System Devices and enbale Bind selected to VFIO at Boot.

Configure the NETWORK interface

  1. Connect to OpenWRT VM via VNC console.
  2. Open the file /etc/config/network in an editor.
  3. Find lan interface configuraion, and modify option ipaddr '192.168.1.1' to an IP inside the subnet of the unRaid server.
  4. Optionally, find lan interface configuraion, and modify proto to dhcp.
  5. Optionally, modify wan based on network topology.
  6. Once all done, restart network using /etc/init.d/network restart
  7. Get the current IP using ip addr
  8. Open the UI on the IP obtained in the previous step.

https://forums.unraid.net/topic/171286-how-to-use-a-pcie-wi-fi-card-on-unraid-via-openwrt-vm-passthrough/

<?xml version='1.0' encoding='UTF-8'?>
<?xml version="1.0"?>
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
<uuid>ec132649-d746-e4df-11bd-15a993673bfb</uuid>
<name>OpenWRT</name>
<description/>
<metadata>
<vmtemplate xmlns="unraid" name="OpenWRT" icon="unraid.png" os="linux" storage="default" webui=""/>
</metadata>
<currentMemory unit="KiB">262144</currentMemory>
<memory unit="KiB">524288</memory>
<cpu mode="host-passthrough" migratable="on">
<topology sockets="1" cores="1" threads="1"/>
<cache mode="passthrough"/>
</cpu>
<vcpu placement="static">1</vcpu>
<cputune>
<vcpupin vcpu="0" cpuset="0"/>
</cputune>
<memoryBacking>
<nosharepages/>
</memoryBacking>
<os>
<type arch="x86_64" machine="pc-i440fx-7.1">hvm</type>
</os>
<features>
<acpi/>
<apic/>
</features>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/local/sbin/qemu</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2" cache="writeback" discard="unmap"/>
<source file="/mnt/user/domains/openwrt/<input-image-name>.qcow2"/>
<target bus="virtio" dev="hdc"/>
<boot order="1"/>
<serial>vdisk1</serial>
</disk>
<controller type="usb" index="0" model="ich9-ehci1">
<address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x7"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci1">
<master startport="0"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x0" multifunction="on"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci2">
<master startport="2"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x1"/>
</controller>
<controller type="usb" index="0" model="ich9-uhci3">
<master startport="4"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x2"/>
</controller>
<interface type="bridge">
<mac address="<input-mac-address>"/>
<source bridge="br0"/>
<model type="virtio-net"/>
</interface>
<input type="tablet" bus="usb"/>
<input type="mouse" bus="ps2"/>
<input type="keyboard" bus="ps2"/>
<graphics type="vnc" sharePolicy="ignore" port="-1" autoport="yes" websocket="-1" listen="0.0.0.0">
<listen type="address" address="0.0.0.0"/>
</graphics>
<video>
<model type="qxl"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x1e" function="0x0"/>
</video>
<audio id="1" type="none"/>
<console type="pty"/>
<channel type="unix">
<target type="virtio" name="org.qemu.guest_agent.0"/>
</channel>
<memballoon model="virtio">
<alias name="balloon0"/>
</memballoon>
</devices>
</domain>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment