Whonix host operating system

It’s something really small and stupid that is messing (missing?) somewhere. We will eventually find out.

Installation works, and the Host EFI installed machine actually boots into GRUB if repaired using grub> commands or if it is booted with the ISO still in (I know, strange. Same behavior last time I checked in May).

Of course, all these tests are performed in QEMU/KVM (virt-manager) for now, but if it doesn’t work here at this level it won’t work on real hardware.

1 Like

New functionality added for overlayfs may be useful for live mode:

1 Like

Hello and happy new year!
GOOD NEWS for EFI install mode! :grinning:
I think I have FINALLY found the culprit!

-> Just tried it with version 15.0.1.5.4 (built myself).

It appears that unless specified otherwise, Calamares installation in EFI mode creates a directory on the EFI partition using the default branding name, i.e. in our case “Whonix-Host”:

user@host:/mnt$ ls -lR
.:
total 4
drwxr-xr-x 4 root root 4096 Jan 22 14:05 EFI

./EFI:
total 8
drwxr-xr-x 2 root root 4096 Jan 22 14:05 boot
drwxr-xr-x 2 root root 4096 Jan 22 14:05 Whonix-Host

./EFI/boot:
total 0

./EFI/Whonix-Host:
total 5212
-rwxr-xr-x 1 root root     108 Jan 22 14:05 BOOTX64.CSV
-rwxr-xr-x 1 root root 1206824 Jan 22 14:05 fbx64.efi
-rwxr-xr-x 1 root root     209 Jan 22 14:05 grub.cfg
-rwxr-xr-x 1 root root 1533296 Jan 22 14:05 grubx64.efi
-rwxr-xr-x 1 root root 1261192 Jan 22 14:05 mmx64.efi
-rwxr-xr-x 1 root root 1322936 Jan 22 14:05 shimx64.ef

But for some reason, the installed machine is unable to boot if the directory containing the bootloader files is not named “Debian”.

It seems to be an obscure bug on which few relevant information is readily available online.

-> renaming /EFI/Whonix-Host into /EFI/Debian solves the problem.

I will upload a pull request on gitlab in a few moments.

Apart from that, didn’t run extensive tries, but everything else seemed to work as expected.

All tested on KVM so far (not on real hardware).

2 Likes

https://gitlab.com/whonix/live-config-dist/-/merge_requests/1/commits

2 Likes

Happy New Year to you too. I always love the moments of epiphany when finally hunting down an annoying bug. This is great progress :slight_smile:

2 Likes

Yes, exactly. I wasn’t very actively working on it for months, and decided to give it a try with a fresh head. Then I tried to change the name of this directory and bingo! :slight_smile:

I am currently testing (and writing this post) using Whonix-Workstation on Whonix-Host installed on real hardware (high capacity USB stick)! Works fine.

Only thing, had to change back the domain name from qemu to kvm, as it was set to qemu for testing purposes in KVM (for nested virtualization). Just a reminder that we need to it back in the release candidate. Otherwise the VMs are unbearably slow.

See post 237 by @Patrick:

EDIT: I see that per use qemu if kvm is unavailable for easier Whonix development using ne… · Kicksecure/libvirt-dist@b77262f · GitHub there should be a check during the first installed Host boot for kvm capabilities (If I understand correctly). As I used KVM with virt-manager to install Whonix-Host on the USB stick (easier to debug), that might explain why the VMs xml files were set to qemu on first boot (also in KVM). I should try to run the entire installation process on real hardware to see if kvm domain is correctly set. Then we wouldn’t need to change anything.

2 Likes

So now as per our roadmap we “only” lack Whonix-Host Firewall. Whonix-Host Tor configuration and anon-connection-wizard and we are good to go.

Any news on the development of these features? How can it be helped?

1 Like

https://gitlab.com/whonix/live-config-dist/-/merge_requests/1/commits

Yay! :slight_smile: :slight_smile: :slight_smile:

Welcome back again and happy new year!

whonix-libvirt /usr/lib/whonix-libvirt/install is started by /lib/systemd/system/whonix-libvirt-install.service

https://github.com/Whonix/whonix-libvirt/blob/master/usr/lib/whonix-libvirt/install

That script creates a .done file:

/var/lib/whonix-libvirt/install.done

whonix-libvirt-install.service won’t run /usr/lib/whonix-libvirt/install again if the .done file exists.

ConditionPathExists=!/var/lib/whonix-libvirt/install.done

If you have suggestions on how to improve that please let me know. Would be good to support this use case somehow. Why not. Installation of Whonix-Host in a VM on USB can be a good idea how beginners/testers since that guarantees really installation to USB. Internal boot disk which the user currently booted from remains unchanged. We also need to keep things comfortable for developers/testers.

([X] There is also a use case of sometimes running an operating system from hardware and sometimes inside a VM. Suppose you just made a full dd backup and now want to try if the backup is functional. Assign the USB drive to a VM and boot it.)

What would be a sane way to implement this? At every boot iterate over all installed libvirt XLM’s (multiple gateway’s, workstation’s) and change back/forth from qemu to kvm? That seems surprising / intrusive? Users who set up some non-Whonix VM to qemu to notice that these where just changed to kvm after reboot.

A bit hard to script. kvm to qemu includes “remove <pvspinlock state='on'/> from XML file” but qemu to kvm would mean “re-add <pvspinlock state='on'/>”. Re-adding is more difficult because it needs to be added in the correct position.

XML files don’t support comments so comment in/out isn’t possible either.

Neither we should delete the user’s local version in /etc/ and copy over the original from /usr/share because then user modifications would be lost.

Yes.

Unfortunately not.

If anyone could implement any of that, that would help.

As for Whonix-Host Firewall I never got any idea how to filter traffic by “VM name”. Simplified: How do we allow Whonix-Gateway to use the internet but prohibit everyone else?

Ideally the user could configure a list of VM names which have networking permitted. The default list would only include Whonix-Gateway.

More advanced:

  • allow Whonix-Gateway (default)
  • allow Whonix-Gateway 2 (custom, multiple Whonix-Gateway)
  • allow Kicksecure VM
  • allow debian-tor user (host operating system Tor process)

After the simplified question is solved, implementing the advanced stuff might actually be easy.

1 Like

I now have an idea how to write the host firewall… Looking at network interfaces before/after installation of KVM and then white listing the new device.


Could you please make SecureBoot work as well? @onion_knight I.e. “just” as good as Debian has it.

Purpose: Usability. Boot compatibility. Let users where SecureBoot is enabled by default boot while SecureBoot stays enabled. Not require them to disable SecureBoot in the BIOS.

Non-purpose: Security.

Related:

Changes to EFI boot with Debian Bullseye, might affect how we do things:

https://michael-prokop.at/blog/2021/06/09/efivars-is-gone-with-debian-bullseye-newinbullseye/

does the host firewall need to be an issue here? currently, on numerous other implementations of whonix, no such firewall configs are used. would a solution be to have the typical “all incoming ports” disabled with the standard disclaimer that the host itself should not be used for standard workstation activities?

as a side note, i don’t think restricting network traffic to the gateway will work. it would prevent system updates on the host os. so, there is going to need to be an allowance for some host network activity.

i’m very glad to hear that progress is still being made here. but, if it’s near done, i’m not sure the lack of a perfect custom firewall should block release.

That has potential to generate a bad reputation.

For sure.

Implementing a host user clearnet is simple. (Similar to Whonix-Gateway user clearnet.) White listing VM traffic is a lot harder.

There’s a lot more todo.

https://forums.whonix.org/search?q=%23status_open_issue_todo%20%23component_whonix-host%20%20tag%3Acomponent_whonix-host

https://phabricator.whonix.org/project/view/26/

Not all has to be done but essentials seems to be EFI boot support, SecureBoot support, Anon Connection Wizard host support, an installer ISO that works for both EFI and non-EFI booting (⚓ T979 co-install grub-efi-amd64 and grub-pc by default on Whonix-Host ISO).

maybe not? since whonix host will be using kvm, all that traffic should be owned by user “libvirt-qemu.” it’s not as perfect as filtering by vm name. but, it’s a start and narrows traffic down a little bit.

or, here’s another idea, what about filtering by source ip? for example, the whonix gateway in the kvm version has the local ip address on the host of 10.0.2.2. could this not effectively serve as a “virtual machine name” in implementation?

1 Like

3 posts were merged into an existing topic: Whonix’s Host naming

Having a hybrid ISO for USB / DVD that supports BIOS legacy boot, EFI boot and SecureBoot is a difficult task.

Hence I am now investigating porting Kicksecure / Whonix’s build script (derivative-maker) to Debian’s live-build which can do all of the above.

1 Like

live-boot create “normal”, non-live fully persistent raw disk images?

1 Like

A post was split to a new topic: port Whonix to Fedora as base operating system