Whonix for arm64 / Raspberry Pi (RPi)

https://forums.whonix.org/t/whonix-for-arm64-raspberry-pi-rpi/1788/180

Aw.,…

Edit to my last post:
my mistake, actually, fstab shows dev by uuid for / (root).

grml-debootstrap now merged arm64 build support.

grml-debootstrap bug "VM build failing if combining --vmefi with --arch arm64 which maybe can be worked around in derivative-maker.

related grml-debootstrap arm64 issues:

VM --arch arm64 builds might now be functional.

It might now even be possible to cross-build arm64 images while the build machine is running Intel / amd64.

I am writing “might” because I only superficially tested that is booting using QEMU and I am not using any ARM64 hardware myself. Since there is no dedicated ARM64 maintainer, this might break in the future. This is because the amount of architectures, platforms I can support is limited by being only 1 person.

While I added a (Kicksecure) CI test for arm64 builds, which will hopefully prevent the build process from breaking again and going unnoticed for a long time, the boot process might break in the future because we don’t have CI testing yet that does not only building but actual booting and testing.

related: Continuous Integration (CI) Whonix Testing - Automated Test Suite

The good news: “some newer” RPi (don’t ask me about the details) now support booting using UEFI (Tiano Core) and are compatible with a standard arm64 GRUB2. According to above blog post, even the standard Debian installer from debian.org can nowadays install on RPi. Raspian and Armbian are now optional for RPi.

The bad news: This generate-recipe.py (part of Debian RaspberryPiImages - Debian Wiki) build script shows that each RPi needs a few different things. Such as a different kernel.

# Arch, kernel, DTB:
if version == '1':
    arch = 'armel'
    linux = 'linux-image-rpi'
    dtb = '/usr/lib/linux-image-*-rpi/bcm*rpi-*.dtb'
elif version == '2':
    arch = 'armhf'
    linux = 'linux-image-armmp'
    dtb = '/usr/lib/linux-image-*-armmp/bcm*rpi*.dtb'
elif version in ['3', '4']:
    arch = 'arm64'
    linux = 'linux-image-arm64'
    dtb = '/usr/lib/linux-image-*-arm64/broadcom/bcm*rpi*.dtb'

Also a different wireless (WiFi) / bluetooth firmware package.

This means there can likely be no universal bootable image that works on all RPi hardware versions.

Hi
I wanted to ask what is the current status of Whonix Gateway on RPi. Has anyone found a way to make it work? If not - what is missing? I want to help make it work but don’t know where to start.

No progress and none should be expected, unless contributed.

This is non-trivial stuff:

A tool is required that is capable of securely creating bootable RPi images that can be integrated into derivative-maker (image build script). The next required task:

Rasberry PI (RPI) support · Issue #114 · grml/grml-debootstrap · GitHub needs to be implemented upstream.

I’ve managed to get Whonix with multiple workstations working on an Arm RockPro64. This device is fully supported by Debian with FOSS mainline kernel drivers.

I used libvirt/Qemu-KVM images compiled from source but with the following modifications to the XML files:

  • remove genid (not supported)
  • remove memoryBacking (not sure if this needed or supported or what it’s doing)
  • set type machine=‘virt’
  • added <os> loaders of type=‘pflash’ to /usr/share/AAVMF/AAVMF_{CODE,VARS}.fd
  • remove pvsinlock (not supported)
  • remove vmport (not supported)
  • remove kvmclock (not supported)
  • remove <pm> (ACPI S3 not supported)
  • remove spice/graphics video options (for a headless server system, kloak doesn’t seem supported in a virsh console but maybe that doesn’t matter for what I’m doing)
  • the disk is running on a HDD because SD card storage is too volatile

I set the minimum RAM requirements for the Gateway (450MB) and is working fine. I think you need a minimum of 4GB RAM total so the host and VMs have enough or else you will be swapping a lot.

Seems to work just fine for me. Not sure what the problem is for the pi, as long as you can run libvirt it shouldn’t matter what the host is running I think?

1 Like

This is about host operating system support. A bootable image that can run on ARM64 / RPi. A dedicated Whonix-Gateway box. For purpose of Build Documentation: Physical Isolation maybe. Perhaps a Dev/Torified Wi-Fi Hotspot - Whonix.

This is difficult as per, why, see Whonix for arm64 / Raspberry Pi (RPi) - #214 by Patrick.