-
-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Qubes OS version
R4.0
Affected component(s) or functionality
Assigning PCI devices to qubes.
Brief summary
PCI devices are assigned in random order. This causes the interface names to vary across reboots (e.g., wls6 vs. wls7). Network Manager uses this identifier to identify the network card, so “randomly“ (=depending on the interface name) ignores saved Wi-Fi networks.
How Reproducible
Randomly – something like 50 % chance of different order with two PCI devices.
To Reproduce
Steps to reproduce the behavior:
- Assign at least two PCI devices to a qube (e.g. Wi-Fi + Ethernet to sys-net)
- Run lspci in the qube and save the content.
- Reboot computer. (Maybe restart of qubesd would be enough; Restarting just the single qube is not enough.)
- Run lspci in the qube and compare with the previous output.
Expected behavior
The order of those devices is always the same.
Actual behavior
The order varies randomly.
Additional context
IIUC, qubes.devices.PersistentCollection stores the identifiers of PCI devices in a Dict. Dictionaries in Python don't guarrant the order of keys (try running python3 -c 'print({"1":None, "2":None})'
several times…), IIUC, it has some per-process random nonce in order to prevent collision-based DoS attack. It seems that the order is propagated to the affected DomU. I can see varying order of pcidevs in /var/log/libvirt/libxl/<qube-name>.log
.
In my opinion, keeping a stable order might be also useful for some other kind of persistently attachable devices, so maybe the problem should be solved there.
Solutions you've tried
- Workaround for NetworkManager: For each Wi-Fi network, add two (or more, depending on the number of PCI devices) connections – one for each possible interface name.
- Workaround for NetworkManager: When Wi-Fi does not connect, edit the network connection and adjust the Device identifier.
- [Not yet tried] Workaround for network interface names: Add some kernel parameter that affects the network interface naming to be based on something other than on order of PCI devices.