---------------------------------------
Window$
October 6th, 2019
---------------------------------------
Pre-Script (idk, the opposite of a post-script? lol): So much for
regular phlogs. Don't expect anything.
I really. really. dislike. windows.
I've been using and dealing with Windows a lot more than I like to
over the past little while. I'm just going to share a few of my
experiences here.
#1; gophernicus port to windows.
This will probably interest most of you gophers the most. I've
started to port gophernicus, the gopherd I maintain, to Windows. It
hasn't been very difficult so far, with only a number of #ifdefs,
#defines, #undefs and #includes to put in to the code. Now, I need
to implement winsock. amcclure has been helping me with this,
providing ideas and Windows insights.
I've been told that Visual Studio compiler should be supported
because 'MinGW is crap'. I like MinGW a lot... I'm at least keeping
MinGW supported and that's what I'm going to continue initial
porting on. Visual Studio can come later.
I'll post a blog post at the end of the process documenting what I
did.
#2; Windows in a VM vs dedicated parition.
For a while, I've been (disappointingly) running Windows both
in it's own parition on bare metal *and* in a VM; this was eating
up a *lot* of disk space. I've recently migrated to a new SSD I've
bought (Samsung 970 Evo Plus 500GB); it's a M.2 NVME drive. I'm
getting almost 2-3x the speeds! (I'll stop drooling over it now)
Anyway, about disk space. I rarely used the bare-metal install; I
only used it for stuff like a Windows-only application needing
bluetooth, which I was having great trouble using in the VM.
I've rsync'd the VM to a bare metal partition. This was not an easy
process, I did it in a few steps:
1. Booted the VM, and rebooted into an Admin command prompt (you
can do this in Settings, supposedly).
2. Used `mbr2gpt` to convert the install from BIOS to UEFI, as the
VM was using BIOS but my computer uses UEFI.
3. Checked that worked (phew, it does!)
4. Converted the .vdi to a raw image, using `qemu-img convert -O
raw Windows.vdi Windows.img`.
5. Used `losetup` to convert it to a boot device, and partprobe'd
it. Mounted it and the new bare-metal partition.
6. Then, I rsync'd it over.
From there, I copied over the EFI files so that I could boot from
Windows, and ran `grub-mkconfig` to add Windows to my
configuration.
Even better, if I *had* to, I could bypass GRUB completely, as my
BIOS supports having custom UEFI boot options pointing to a EFI
file. This also means I can boot the bare-metal intall in a VM
using QEMU + OVMF (open source UEFI) with the -bios option.