UTM frontend for QEMU on M1 MacBook Pro: Creating a VM and installing Windows 98 (part 2 – MSCDEX driver issue resolved)

A while back I was playing with UTM to setup an x86 VM on my M1 MacBook to install Windows 98 from an iso. I got as far as booting and starting the install but then ran into issue with the MSCDEX driver on subsequent boots during the install where it would no longer see the virtual CDROM drive and so could not complete the install:

From some additional playing around, it seems there is a major difference in the virtualized x86 PC hardware between this x86 2009 option which has the CDROM driver issue:

and this older 1996 version which does work and the install will complete successfully:

A couple of additional findings:

  • if you don’t disable the USB input support, when you get to this screen in the install you will not have a mouse pointer:

In the Input settings disable USB input (the default is USB3.0 support) and this will give you a mouse:

Success!

node16 and Jest with ES6+ modules

I’ve run into this a few times, so leaving some notes for myself for next time,

By default, attempting to use “import x from ‘y’ ” style ES6 module imports with Jest will give you this error:

SyntaxError: Cannot use import statement outside a module

With node16, support for modules is added with the experiemental-vm option, so update your package.json to add a script executing jest with this flag:

"test": "node --experimental-vm-modules node_modules/.bin/jest"

and then also in your package.json, add:

  "type": "module",

If you search for the ‘cannot use import statement outside a module error there are plenty of recommendations, including more elaborate babel transpile ES6 modules to CommonJS style requires.

Depending what you’re doing maybe you’ll need some of the other approaches too, but I found the above 2 steps to be the bare minimum

Quick tip of the day: While learning Java, avoid defining anything as static

If you’re just starting out and learning Java, avoid the temptation of defining anything as static until you understand what this modifier does and why/when you need to use it: no static Class properties, no static methods.

The only use of static while you’re starting out is in your main method. You don’t need it anywhere else. You’ll avoid a lot of unexpected and unexplainable behavior as a result.