How to install GhostBSD on Windows
Due to the impending doom of age/ID verification, mandatory account requirements and AI slop built into Windows 11 24H2 and later you may have considered switching your OS to a free and open source one.
But you don't want to do the transition immediately, you want to try it out first on your Windows machine.
The easiest way would be to use the tool Oracle VirtualBox, but we want to go FOSS (Free Open Source Software) right away and therefore we will use the Emulator QEMU.
The former is a Type-2 hypervisor while the latter is an emulator, but it can also act as virtual-machine manager (VMM) for Hyper-V on Windows using the Windows Hypervisor Platform (WHPX) API. Check the previous link's requirements for your machine, you need at least Windows 10 2004 to run QEMU with the WHPX hardware acceleration.
First things first we need to install QEMU, fortunately there is some German guy that is so nice to compile the QEMU source code to Windows binaries on every major release, the installer for the binaries is located here. Download the .exe file with the latest date.
QEMU is shipped with SeaBIOS, but that doesn't support UEFI so we will also download the open source implementation OVMF (Open Virtual Machine Firmware) binaries from Mr. Weil's site. The files are called "OVMF_CODE.fd" and "OVMF_VARS.fd", fd stands for Flash Device.
Now let's install QEMU:
Only select the emulators for the most important architectures to save some space (all selected would require 1.1 GB):
aarch64
aarch64w
arm
armw
i386
i386w
ppc
ppc64
ppc64w
ppcw
risc64
risc64w
x86_64
x86_64w
Now we have to create a disk image for our virtual machine, open a terminal and type the following:
cd "C:\Program Files\qemu"
qemu-img create -f qcow2 "C:\Users\Cecco\Documents\Virtual Machines\GhostBSD.qcow2" 128G
This will create a virtual disk in the default qcow2 format of QEMU, please notice that the size of 128 GB is only the max. size it will not use up that amount on your disk immediately, it will only grow if you actually install something in it. The minimum size required by GhostBSD is 15 GB.
Before we continue we have to download the GhostBSD ISO file, choose the MATE version and select your closest download location. In this case I will leave it in the default Windows Downloads folder. For the OVMF files I chose the Virtual Machines folder where the virtual disk resides.
Now we can write the actual batch file that will launch the virtual machine:
cd "C:\Program Files\qemu"
qemu-system-x86_64.exe ^
-M q35 ^
-m 8G ^
-smp 4 ^
-k de ^
-accel whpx,kernel-irqchip=off ^
-drive if=pflash,index=0,format=raw,file="C:\Users\Cecco\Documents\Virtual Machines\OVMF_CODE.fd",readonly=on ^
-drive if=pflash,index=1,format=raw,file="C:\Users\Cecco\Documents\Virtual Machines\OVMF_VARS.fd" ^
-cdrom "C:\Users\Cecco\Downloads\GhostBSD-26.1-R15.0p2.iso" ^
-hda "C:\Users\Cecco\Documents\Virtual Machines\GhostBSD.qcow2"
Create a new text file, change the file extension to .bat (batch) and copy the above code into the batch file. Now change all pathnames to match your actual directories.
Let's dissect all the commands and options:
cd will change the directory from your home or System32 directory to the directory containing the exectuables of the QEMU emulators.
qemu-system-x86_64.exe will execute the emulator for the x86 64-bit architecture (it will also work without the file extension).
^ (caret) this is just used for line continuation, so all options will be in a row when executed, this just serves for better readability, in Linux/UNIX a \ (backslash) is used instead.
-M q35 indicates an emulated machine type with an Intel Q35 chipset from 2009.
-m 8G indicates a memory size of 8 GB. This is the minimum requirement for GhostBSD, though it also worked with 6 GB when testing.
-smp 4 indicates the CPU core count for the virtual machine, in my case this is identical to the host machine.
-k de indicates a keyboard layout, in this case de for German language.
-accel whpx,kernel-irqchip=off enables the Windows Hypervisor Platform as an accelerator.
-drive if=pflash loads the specified .fd UEFI BIOS files. The first is the static code (therefore readonly) and the second one is for the variables that are stored in the BIOS.
-cdrom loads our GhostBSD Live ISO.
-hda loads our virtual disk image which we created earlier. You can load up to 4 disks with these aliases: hda, hdb, hdc and hdd with hd standing for hard drive.
Let's go on and boot up GhostBSD by starting the batch script and installing GhostBSD to the virtual disk drive.
When the installer finished it asks to reboot the system, if we do that it will just stop there and we can turn off the virtual machine.
Now edit the batch file and remove the line with the -cdrom and save it. The GhostBSD.qcow2 virtual disk file should now be about 7.43 GB large. We can start the batch file and it should continue where we left.


Comments
Post a Comment