segmentation fault

Hacking Whonix onto Hyper-V

A guide to get Whonix running on Hyper-V.

This guide aims to get the Whonix™ operating system running on Hyper-V. This guide does not expect Virtualbox specific features such as guest additions to work and does not expend any effort to make them work.

Prerequisites

Acquire the necessary tools

Verify the signature

See the Whonix wiki.

Extract the archive

Use tar or another archive utility of choice to extract the ova archive, producing two vmdk virtual disks.

Convert the disks

Convert both virtual disks to vhd.

VBoxManage.exe clonehd source.vmdk target.vhd --format vhd

Virtual Machine Setup

Set up networking

Create virtual machines

Whonix still uses GRUB’s BIOS payload. It isn’t UEFI compatible and doesn’t run in Hyper-V’s “Gen 2” VMs, which bring various security improvements. However, you can attempt to run Whonix in “Gen 2” VMs here.

Post-boot configuration

We need to load some kernel modules to get networking working on Whonix. See this link for more info.

printf "hv_utils \nhv_vmbus \nhv_storvsc \nhv_blksvc \nhv_netvsc" >> /etc/initramfs-tools/modules
update-initramfs -u

Round 2: Working with EFI

Turns out EFI is relatively simple; install grub-efi and convert the partition table to GPT. This next section is for the people who need it.

Generation 2 virtual machines only support .vhdx disks. You should convert the disks within the Hyper-V Manager UI or with the PowerShell cmdlet Convert-VHD.

Install grub-efi

Boot up your existing Generation 1 virtual machine and install grub-efi-amd64.

apt update
apt install grub-efi-amd64
apt purge grub-pc-bin

Partitioning

Secure Boot

Debian’s grub-efi package comes with shim out of the box signed by Microsoft’s third party UEFI CA; it is up to the user to enable it in VM settings.

Do keep in mind this is mainly theater, as userspace components are not verified.

See also