Qubes fails to start sys-net if wifi kill switch is off

I’m happy to report that I found a workaround for this issue. Basically, I wrote a service that is executed at startup before sys-net that tries to determine if the wifi card is plugged in at boot, and attaches or detaches it from sys-net accordingly.

Note that with this solution, if the kill switch is off (wifi disabled) at boot, then you won’t be able to use the wifi unless you reboot with the kill switch on, since Qubes won’t ever load the PCI device. However, you can still use bluetooth if you turn the kill switch on.

Instructions:
Create a file named /etc/systemd/system/killswitch.service and write into it:

[Unit]
Description=Killswitch fix for L14
After=qubesd.service
Before=qubes-vm@sys-net.service

[Service]
ExecStart=/usr/bin/sh -c '\
if qvm-pci | grep -q dom0:01_00.0 ; then \
    qvm-pci attach sys-net dom0:01_00.0 --persistent || true ;\
else \
    qvm-pci detach sys-net dom0:01_00.0 || true ;\
fi'
Type=oneshot
RemainAfterExit=no

[Install]
WantedBy=multi-user.target

(note that the PCI device name in your machine might change, but I doubt that. In any case, you can quickly find the device name running qvm-pci)

Then, run this command to enable the service you just created:

systemctl enable killswitch.service

That’s it!

2 Likes