Installing Windows Insider beta Windows 11 ARM on a Macbook Pro M1 with UTM/QEMU

I downloaded the Windows Insider beta of Windows 11 for ARM, and took a look at what’s involved to get it installed and up and running under UTM?QEMU on a Macbook Pro with an M1 CPU (ARM).

First, since the download is a .vhdx disk, I used the import option in the UTM frontend to import from the downloaded file. I also checked the option for the Spice drivers:

After starting to boot, the installer requires a network connection and it appears to get stuck:

Articles such as this one recommend to press Shift-F10 to get to a command prompt, and then enter this command to continue with the install skipping the requirement for a network connection: oobe\bypassnro

At this point the installer reboots and restarts, and this time you get an additional option on this dialog allowing you to skip the network requirement during installation:

After a short setup of a couple of minutes, Windows 11 desktop!

Next, the resolution seems to be fixed at 800×600, so knowing I checked the box in UTM for the Sprice/virtio drivers, I noticed there was a CDROM iso mounted on drive D:

Running the installer, it started up, and keeping all the defaults for now, installed without any issue:

All in all, pretty easy, only about 20 mins setup and it seems pretty snappy so far!

Solving a Quora programming homework question in ARM Assembly

It makes me sad when students ask the online communities to ‘please write me a program that does the following’. Not only is this flat out dishonest to ask someone else to do your homework for you, the opportunity for learning is in the process of solving the problem and writing the code yourself. If someone else writes the code, you’ve missed that opportunity. There’s little to be learned if someone else does the hard work and gives you the final result.

Most communities police these types of questions pretty well. Reviewers on Stackoverflow for example are quick to respond to these types of questions to help developers restructure a generic request for help into a specific question about a specific problem that the developer need help with. The guides that are usually referred to on suggestions to restructure these questions are actually very good advice and reminders for us all on how to ask good questions:

On other community sites, the community response goes in a different direction. This question for help on how to write a program was responded to be some of the funniest and bizarre approaches to solve the askers problem in all sorts of obscure language from Brainfuck to Whitespace and plenty of other weirdness inbetween.

Not to be left out but a little later to the party, I realized I hadn’t done any ARM assembly for a while, so here’s my solution in ARM Assembly that I developed on my Raspberry Pi:

.global main

main:
MOV R4, #3 @ init outer line counter =3

_outerloop:
MOV R3, R4 @ init word loop counter with current value of outer counter

_wordloop:
MOV R7, #4 @ syscall 4: output to stdout
MOV R0, #1 @ stdout
MOV R2, #6 @ length of string
LDR R1, =output
SWI 0

SUB R3, R3, #1 @ decrement word loop counter
CMP R3, #0
BNE _wordloop

@print newline
MOV R7, #4 @ syscall 4: output to stdout
MOV R0, #1 @ stdout
MOV R2, #1 @ length of string
LDR R1, =eol
SWI 0

SUB R4, R4, #1 @ decrement outer counter
CMP R4, #0
BNE _outerloop

_exit:
MOV R1, #0
MOV R7, #1
SWI 0

.data
output:
.asciz "Smile!"
eol:
.asciz "\n"

Building ARM Docker images on the Raspberry Pi

Install Docker for ARM using the install script:

curl -sSL https://get.docker.com | sh

From: https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/

Set to startup as a service:

sudo systemctl enable docker

Start the service manually now (or reboot to start automatically):

sudo systemctl start docker

Add user to docker group (to run docker cli without sudo):

sudo usermod -aG docker pi

 

To create a new image from a Raspbian base for ARM, use the Raspbian images from resin (in your Dockerfile):

FROM resin/rpi-raspbian:latest

From: http://blog.alexellis.io/getting-started-with-docker-on-raspberry-pi/

Edit your Dockerfile to include and configure whatever you need, and build an image as normal on the Pi using:

docker build -t tagname .

… and off you go.