How to create a Windows 10 bootable USB on MacOS

You don’t need Unetbootin, MacOS’ Boot Camp, or Rufus for Windows to create a Windows 10 USB bootable drive on a Mac to install Windows on a PC.

I needed to install Windows 10 in a new custom-build PC. I don’t have a single machine running Windows at home, so using Windows to create the bootable installer was out of the question. I tried most of the recommended methods, but after booting from the USB drive and partitioning the disk of the new machine, the Windows installer always complained that it couldn’t find some files it needed for the installation.

Finally, I found the culprit on Stack Exchange. The Windows installer ISO image contains a file named install.wim, which is over 4G bytes long. The USB drive is formatted as FAT32, which cannot hold files over 4G. So, although you’ll find a file named install.wim on the USB drive after creating the installer, the file is corrupted and the installation fails.

The workaround is to compress the install.wim file on your Mac and copy the compressed file, which is around 1GB smaller, to the USB drive. After that, the Windows installer finishes without complain.

  1. Download Windows 10 as an ISO image from Microsoft.

  2. You’ll need an USB drive with at least 5G of space. Using MacOS’s Disk Util, format the USB to ExFAT or FAT (The exact format is not important for the Windows installer, but if your mainboard is not new the mainboard of the computer you are installing to can read the USB drive). Be sure to create boot partition (MBR) while formatting. You’ll need to select ‘Show all devices’ using the upper left button in Disk Util so you can select the whole device for formatting, and not only the available partition.

  1. Install wimlib on MacOS using homebrew:

$ brew install wimlib

  1. Double-click on the ISO file to mount it.

  2. Select all files in the now-mounted ISO image and them to the USB drive. Depending on the speed of your USB drive, this may take 20 minutes or more.

  3. In the mounted ISO image, go to the sources directory, and copy install.wim to a folder on your Mac. (You cannot compress it directly inside the ISO image.)

  4. From the terminal, in the folder you just copied install.wim to, use wimlib to compress the file. Compressing the file will take a long time, probably more than an hour.

$ sudo wimlib-imagex optimize install.wim --solid

  1. Open the sources directory in the USB drive and delete the install.wim file.
  2. Copy your compressed install.wim file to the sources directory on the USB drive.
  3. Unmount the USB drive.

And that’s it! You now have a working Windows 10 installer created on MacOS.


Connecting to Public Wifi in MacOS Catalina

After upgrading to MacOS Catalina, I could no longer connect to open WiFI networks, specifically hotel networks and coffee shops. Previously, when connecting to one of these networks, a dialog would appear to ask for confirmation, a username/password combination, etc. No longer with Catalina.

After some extensive searching on the internet, the solution I found is launching the Captive Network Assistant manually. I wrote a small bash script to launch it from the command line on a terminal window:


/System/Library/CoreServices/Captive\ Network\\ Network\ Assistant

(You should always use some kind of VPN when connecting to non-encrypted public networks.)

catalina wifi

Hidden Cobra and the worldwide ATM hacks

US-CERT on the August/September 2018 ATM hacks which affected several nations:

(…) all of the compromised switch application servers were running unsupported IBM Advanced Interactive eXecutive (AIX) operating system versions beyond the end of their service pack support dates;

This is the typical example of short-term thinking. Someone/some comittee decides not to spend on a supported version of a particular software, but don’t consider what the downside could be.