A 4th way to "Try FreeBSD in Under Five Minutes" (Hyper-V)

Hi gang!

Editorial (brief)

So.. the FreeBSD foundation posted a new article on their blog today (= time of writing) which explains 3 ways to try FreeBSD. I really enjoyed the article, but... uhm... what about us Microsofties? ;) They addressed Apple Macbook, Amazon (Lightsail & EC2), but what about Microsoft's Hyper-V on Windows?

Now, the way I see it we could go about this in 2 ways... I suppose I could throw a tantrum and start complaining ("whining") how this "aint' no fair" but I hope you can agree that this would only sour the atmosphere. Nope, we're not doing that. Instead I choose door number 2 (well, I suppose actually number four, lol!)...

Try FreeBSD under 5 (or so) minutes => with Microsoft's Hyper-V​

Before I continue... keep in mind that we're not necessarily importing a VM here, but we're creating a new one and then use the disk image as provided by the FreeBSD foundation. Figured I'd mention this to avoid possible confusion. Also... I'm using a localized (Dutch) version of Windows 11, but will try to translate best I can.

Step one => Make sure Hyper-V is installed

The easiest way to do this is to simply open your start menu, then search for "Hyper"; this should show you an option for Hyper-V management, something like this:

hyperv-management.jpg


If this is present then fire it up. But if you can't find it then you may need to install Hyper-V support yourself. Keep in mind though that Hyper-V is only available in Windows (10/11) Pro or Enterprise editions. Anyway, the quickest way to install Hyper-V support is to open a PowerShell console with elevated permissions (in other words: "Run as administrator"), then run this command: PS C:\WINDOWS\system32 > Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All.

There's also a (boring) GUI way to do it, but, yah. For more information on all that please check this Microsoft article.

Step two => Grab the image!

Open your favorite browser and then point it to the official download repository: https://download.freebsd.org. In specific, we want to go here => https://download.freebsd.org/releases/VM-IMAGES/14.2-RELEASE/amd64/Latest/. Download this file: "FreeBSD-14.2-RELEASE-amd64.vhd.xz".

Step three => Setting it all up

#1 The image

Say about Windows (and Microsoft) what you want... they do honor (most) open standards. That .xz file extension? That denotes that we're dealing with an archive, so before you continue make sure to extract this somewhere accessible. The only thing you have to do is right click on the file and use the "Extract..." option, easy no?

extract.jpg


This should leave you with this file: "FreeBSD-14.2-RELEASE-amd64.vhd".

#2 The VM

Now it's time to open the Hyper-V manager and create a new virtual machine (see the menu on the right). You're free to use whatever settings you like, but... be sure to use Generation 1 for the VM:

generation.jpg


Fun fact: the image actually supports both ways to boot (UEFI & BIOS) but if you want to use EFI then you also need to disable a few secure boot options which are enabled by default. And well... the itend of the original article is to fire up FreeBSD within 5 or so minutes, so obviously I'm using the easiest and quickest way here. As such: BIOS.

Now, like I said: you can use whatever other settings you want, but... be sure to point your VM to the HD image we just downloaded (and extracted):

import_hd-2.jpg


See what I mean? I specifically use the option to "Use an existing virtual hard disk" and then I pointed the installer to the image we downloaded (and extracted!) earlier on. I assigned this VM with 4Gb worth of memory (which is the default) but you can easily limit that to 2Gb if you'd like.

Step four (and final) => Fire it up!

bootscreen.jpg

Notice how this boot screen only shows the availability of one single kernel?

After you went through all the options you should have a new entry in your Hyper-V VM overview. Just double click on it to open its console, then click the "Start VM" option. Next stop... the above bootscreen. As soon as you get to the logon prompt you can log on as root (and without a password) and you're now free to explore the awesome world of FreeBSD!

If you're new to FreeBSD then I strongly suggest that you also take a peek at the handbook, which should help you to get started.

So yeah... short & sweet... enjoying a new FreeBSD Hyper-V VM within 5 or so minutes, hope you could enjoy this as well.

Thanks for reading!
 
also if you have apple silicon better use utm. you get a vm that is a lot faster and don't have to build qemu etc
 
I wonder why, is the image built to support only Gen1 VMs? I find Gen2 ones much cleaner and faster, using paravirtualized drivers instead of emulating old crappy hardware (but I install using the .iso).
Easy:
Fun fact: the image actually supports both ways to boot (UEFI & BIOS) but if you want to use EFI then you also need to disable a few secure boot options which are enabled by default. And well... the itend of the original article is to fire up FreeBSD within 5 or so minutes, so obviously I'm using the easiest and quickest way here. As such: BIOS.
 
Back
Top