ben-grande / qusal

Salt Formulas for Qubes OS.
14 stars 6 forks source link

Installing dom0 formula prevents access to USB devices after reboot #55

Closed wassp-ds closed 1 month ago

wassp-ds commented 1 month ago

Commitment

I confirm that I have read the following resources:

Question

After going through the installation instructions for dom0, I lose access to usb devices after reboot. This is on fresh installation of the system. I tried to follow the BOOTSTRAPPING guide and only followed the one for dom0. Also, it seems to enforce KDE, which is something I would prefer to have an option for. I have been using i3 for years :) (this is a secondary issue).

What am I doing wrong? .

ben-grande commented 1 month ago

I lose access to usb devices after reboot.

The dom0 formula does not modify anything PCI or USB related, I am not sure Qusal is causing this issue. The only formulas that modify PCI are sys-usb, sys-audio, sys-net. Did you happen to apply these formulas?

Maybe the USB devices are in the disp-sys-usb qube?

I am deeply interested on why this happened.

Also, it seems to enforce KDE, which is something I would prefer to have an option for. I have been using i3 for years :) (this is a secondary issue).

Running the default dom0 formulas does indeed enforce KDE. You can however apply the states in dom0 separately without applying the KDE state.

The default dom0 state is dom0/init.sls. Choose the states you want to apply such as .helpers and .screenshot and apply those:

sudo qubesctl state.apply dom0.helpers,dom0.screenshot

Do not apply the default dom0 state that will enforce KDE:

sudo qubesctl state.apply dom0

This means you also can't use the default top dom0/init.top, but you can modify to have your own top state.

About having i3 or AwesomeWM available for installation is possible, but I don't use those WMs, please open a new issue if you want to track this issue.

ben-grande commented 1 month ago

I lose access to usb devices after reboot.

On Dom0, run:

qvm-pci

To see if the USB controller is attached to a qube.

I do not see how Dom0 formula messed with this, maybe you did other modifications on your system also? Please inform all the steps you took, commands run, explanation etc.

wassp-ds commented 1 month ago

Hi Ben, Thank you for a quick turn around in your answers!

I tried to think how I can best give you as much info as possible to help debug the issue, as I literally made a fresh install of Qubes on my machine, went through the steps to clone the qusal repo onto an auto-created AppVM (personal), copied it over to dom0 with the script provided, did the keyring dance, and applied the dom0 formula through the top path, not state - in a word, followed the instructions to the letter.

Maybe the USB devices are in the disp-sys-usb qube? I am deeply interested on why this happened.

The auto configuration of fresh install does attach the USB devices to a dedicated sys-usb VM, so I guess that maybe related?

One thing I did notice is that after installing the OS and upon reboot, I am getting a warning from the boot loader about USB setting set to 0 (I didn't manage to catch what it said yet - I am expecting it to be there on the next reboot as well). Perhaps that may have something to do with it?

In any case I'll keep investigating that issue and keep you posted (I am actually about to spin up a fresh Qubes right now).

ben-grande commented 1 month ago

Hi Ben, Thank you for a quick turn around in your answers!

No problem, if I feel it is urgent, I will try to help if I can.

I tried to think how I can best give you as much info as possible to help debug the issue, as I literally made a fresh install of Qubes on my machine, went through the steps to clone the qusal repo onto an auto-created AppVM (personal), copied it over to dom0 with the script provided, did the keyring dance, and applied the dom0 formula through the top path, not state - in a word, followed the instructions to the letter.

Please use --show-output when using qubesctl. See the Salt guide troubleshooting.

Then I can see which states were ran.

Please also read How to hide USB controllers from dom0. Then please run the following in Dom0:

qvm-pci
grep usb /etc/default/grub

Then please start your sys-usb qube and click on the device widget to see if the devices appear there.

Please answer the following questions:

Maybe the USB devices are in the disp-sys-usb qube? I am deeply interested on why this happened.

The auto configuration of fresh install does attach the USB devices to a dedicated sys-usb VM, so I guess that maybe related?

Yes, the USB controller is on that qube, start that qube and see what happens in the device widget.

One thing I did notice is that after installing the OS and upon reboot, I am getting a warning from the boot loader about USB setting set to 0 (I didn't manage to catch what it said yet - I am expecting it to be there on the next reboot as well). Perhaps that may have something to do with it?

Maybe. If you record your screen with another device, such as a mobile phone, then you can slow down the video and pause when that message appears.

In any case I'll keep investigating that issue and keep you posted (I am actually about to spin up a fresh Qubes right now).

Please report back so I can evaluate the situation.

wassp-ds commented 1 month ago

@ben-grande I'll perform the steps later during the day. Meanwhile:

Are you on laptop or desktop?

Laptop

External USB keyboard or integrated keyboard (laptop)?

External mouse and keyboard (custom-built with rp2040 MCU running on it - pretty cool 💪 )

More to come later today.

ben-grande commented 1 month ago

@ben-grande I'll perform the steps later during the day. Meanwhile:

Are you on laptop or desktop?

Laptop

External USB keyboard or integrated keyboard (laptop)?

External mouse and keyboard (custom-built with rp2040 MCU running on it - pretty cool 💪 )

More to come later today.

Cool, please try to reproduce the issue without Qusal first and log t:

wassp-ds commented 1 month ago

@ben-grande qubes reinstalled, with default fedora-38-xfce template (can get tor to bootstrap, but that's an unrelated sidenote) with sys-net and sys-usb VMs set up. I am able to normally interact with the peripherals.

  1. This is the output post-qubes install, before any salt shenanigans: grub-before-salt.txt qvm-pci-before-salt.txt

grep usb etc/default/grub - GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX usbcore.authorized_default=0 <- that's the message I missed during boot (mentioned earlier).

  1. sudo qubesctl top.enable dom0 - no issues
  2. sudo qubesctl state.apply: qubesctl-state-apply.txt qvm-pci-after-salt.txt grub-after-salt.txt

After reboot the peripherals stopped working at login and the click event on the touchpad is not working (the keyboard is fine). KDE has loaded (I'll deal with that separately).

grep usb etc/default/grub - GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX usbcore.authorized_default=0

wassp-ds commented 1 month ago

@ben-grande UPDATE: it has to do with the hide from dom0 issue - once I have unplugged all the peripherals and plugged it in only after logging in, things seem to work - so sorry to mess with your curiosity!

ben-grande commented 1 month ago

Great that you solved it.

ben-grande commented 1 month ago

About i3, see updated dom0 instructions.

Reference commit: https://github.com/ben-grande/qusal/commit/34d5d36518e12ae4a98965a56e144814b1af7d01