Table of Contents

OpenWrt on UTM on Apple Silicon HowTo

This document describes how to run the armsr/armv8 OpenWrt images in a VM hosted on macOS (Apple Silicon hardware) using UTM.

Prerequisites

Select an OpenWrt image

You need an ARM system-ready 64-bit version of OpenWrt. There are two versions:

In the guide we'll use generic-squashfs-combined-efi.img.gz because it supports sysupgrade.

:!: Tip: keep a copy of the original gzip'ed image file, it can be used as an image for sysupgrade.

VM Setup in UTM

VM creation

:!: Tutorial and screenshots from UTM 4.4.4 on Apple Silicon

Start UTM and click Create a new Virtual Machine


Select Virtualize


Select Other (because the Linux install path assumes an install ISO image, which we are not using for OpenWrt)


Check the Skip ISO boot box


Configure 512MB and 2 CPUs (enough memory for running sysupgrade later)


Accept the default storage setting (we will remove this drive later and replace it with the OpenWrt image)


Leave the shared directory configuration blank


Check the Open VM Settings box. Fill in a name for the VM. Click Save. This brings you to the VM settings page.


VM configuration

The configuration you will set up by following this tutorial is:

Note that the order of the “Host Only” and “Shared Network” networks is important for turn-key operation of OpenWrt in the VM. While it can be configured using the console, configuration in this way simplifies getting to a running configuration.

VM settings

Remove unused devices

Control-click on Display and remove it. Control-click on Sound and remove it. Control-click on the VirtIO Drive and remove it. Confirm deleting the drive with Delete. (This is the blank disk that UTM creates during VM creation. We don't need it.)


Network Settings

Select Network. Change the Network Mode to Host Only. Check the Show Advanced Settings box. In the Guest Network box, type in the network range for the VM's LAN: 10.0.2.0/24.


Under Devices, click the +New entry and add a new Network. Click on the network and confirm it is configured as Shared Network.


Other Device Settings

Under Devices, click the +New entry and add a new Serial device. Click on the Serial device and check the mode. The default is a built-in terminal window that supports copy and paste with native macOS keyboard shortcuts.


Under the Drives section, select New.... Accept the interface default (VirtIO) and click on Import.... Navigate to the openwrt.img file you unpacked in previous steps.


Save the configuration.

Virtual Machine OpenWrt Settings


See also