I have imported the xml files for the whonix gateway and workstation, and they’re both running on my headless server. How do I manage them now and enter their filesystems? I can’t SSH into them. I tried running # virsh console Whonix-Gateway, but get this error:
error: internal error: cannot find character device null
Should I edit the xml file? I didn’t want to do that without knowing for sure it won’t mess something up, so figured I’d post. Thanks.
@Patrick I have not found any security warnings about this. Interesting is an understatement. This essentially gives us Whonix-KVM-cli without having to do an extra build (or am I missing something?). If a user doesn’t want the GUI they can dial back the RAM on the GW to as little as 200MB and the GUI won’t show. Also doing “Send Key → Ctrl + Alt +F2” will exit the GUI session.
We can support this out of the box by shipping a modified grub, pre-started getty service and adding the devices to the VM config. I have successfully tested the steps below.
@foieac5 Yes there is a serial device that needs to be added in the XML or from virt-manager. You also need to start a service and edit grub in the guest VM you want to attach the console too.
Here are the steps which I will add to the wiki shortly:
Note: As of September 2024, these XML settings are applied to Whonix default libvirt XML files for a long time already. Therefore there is no need to add these settings by hand.
I did so using the GUI virt-manager console, but I can see the catch 22 you’re in since you are running the host headless too which means you have no alternative way to access the files in the guest. Hopefully when we do the changes in the future, you won’t have to experience that.
@Patrick I have not found any security warnings about this.
Let’s do this for Whonix KVM VM builds only for now.
Interesting is an understatement. This essentially gives us Whonix-KVM-cli without having to do an extra build (or am I missing something?).
If a user doesn’t want the GUI they can dial back the RAM on the GW to as little as 200MB and the GUI won’t show.
Wasn’t this the case before already?
Also doing “Send Key → Ctrl + Alt +F2” will exit the GUI session.
We can support this out of the box by shipping a modified grub, pre-started getty service and adding the devices to the VM config. I have successfully tested the steps below.
Yes.
@foieac5 Yes there is a serial device that needs to be added in the XML or from virt-manager. You also need to start a service and edit grub in the guest VM you want to attach the console too.
Please add the xml modifications to whonix-libvirt package. @HulaHoop
Unless there is a non complicated way to include KVM only changes in source let’s add all the necessary internal plumbing for now and simply tell other hypervisor users not to attach a console if they don’t want to.
Back to security, I guess the hypothetical bug of a console vuln is possible as discussed before but these types of bugs were rooted out in the early years of the millennium. I would guess the surface attack of a cli onsole is much smaller than the GUI console.
let’s add all the necessary internal plumbing for now and simply tell other hypervisor users not to attach a console if they don’t want to.
Further development work. Non-trivial. Might not even be possible.
Enable serial console everywhere would mean to enable it also for
physical isolation builds, and then when something goes unexpected “why
did Whonix enable serial console access by default” is a hard question
to answer.
Back to security, I guess the hypothetical bug of a console vuln is possible as discussed before but these types of bugs were rooted out in the early years of the millennium. I would guess the surface attack of a cli onsole is much smaller than the GUI console.
The only issue might be physical isolation or perhaps remote VMs where
this one disabled regular tty console login and then would be surprised
by the extra default serial console access.
It can be safely ignored. That warning will be silenced later when we know this implementation works.
Install the package.
Compare the newly generaetd /boot/grub/grub.cfg with the backup and see if the desired changes are made.
save list of running systemd unit files for later comparison sudo systemctl list-units | grep getty > new
Reboot required (to make grub changes take effect, also there is no code to run the new systemd unit file without reboot but it’s not useful anyhow since this requires reboot anyhow).
compare the systemctl output to check if the new systemd unit file is load meld old new
(or any other diff viewer of your choice)