This document describes how to run the armsr/armv8 OpenWrt images in a VM hosted on macOS (Apple Silicon hardware) using VMware Fusion.
You need an ARM system-ready 64-bit version of OpenWrt. There are two versions:
combined-squashfs.img.gz: This edition, as of release 23.05.0, does not work correctly with sysupgrade. combined-ext4.img.gz This disk image uses a single read-write ext4 partition with no read-only squashfs root filesystem. Features like Failsafe Mode or Factory Reset won't be available as they need a read-only squashfs partition to function.In the guide we'll use openwrt-armsr-armv8-generic-ext4-combined.img.gz because it supports sysupgrade.
gzcat openwrt-*ext4-combined.img.gz > openwrt.img. As a result you get the raw openwrt.img image file.qemu-img convert -O vmdk openwrt.img openwrt.vmdkuser@host demo % grep VNET_1_HOSTONLY_SUBNET '/Library/Preferences/VMware Fusion/networking' answer VNET_1_HOSTONLY_SUBNET 172.16.132.0
Tip: keep a copy of the original gzip'ed image file, it can be used as an image for sysupgrade.
Tutorial and screenshots from VMware Fusion 13.5.0 on Apple Silicon
Start VMware fusion and use the File→New menu. Select Create a custom virtual machine
Select the appropriate Linux kernel version (OpenWrt 23.05.0 for armsr/armv8 uses Linux kernel 5.x).
Select Use an existing virtual disk and Choose virtual disk...
Select the openwrt.vmdk you created earlier, and Make a separate copy of the virtual disk.
On the Finish page, click Customize Settings.
Select a location to save the VM. After saving, edit the configuration.
The configuration you will set up by following this tutorial is:
Note that the order of the “Private to my Mac” and “Share with my Mac” networks is important for turn-key operation of OpenWrt in the VM.
Click on the sound card. Remove the sound card.
Click on the camera. Remove the camera.
Click on the CD/DVD. Open the advanced options section. Remove the CD/DVD drive.
Click on the existing Network. Change it to Private to my Mac.
Click on the Add Device... button on the main settings panel. Click on Network Adapter. (This will add the network for the WAN.)
Configure it to Share with my Mac.
Optional: check the USB & Bluetooth settings and choose your desired options.
Click on the Processors and Memory icon. Configure the system for 512MB and 2 processor cores.
Close the settings panel.
Optional: make a snapshot to capture the original unconfigured state, using the application menu Virtual Machine→Snapshots→Take Snapshot
OpenWrt by default configures the LAN into a bridge. This sets the virtual network adapter into promiscuous mode, which requires approval from VMware for the host-only network it uses. Promiscuous access is not required, so you can either approve or cancel the request.
uci show network.lan command into the virtual console window to see:root@openwrt:~# uci show network.lan network.lan=interface network.lan.device='br-lan' network.lan.proto='static' network.lan.ipaddr='192.168.1.1' network.lan.netmask='255.255.255.0' network.lan.ip6assign='60'
2, and restart the network. An example to type into the console:uci set network.lan.ipaddr=172.16.132.2 uci commit service network restart
opkg update && opkg install luci