[SOLVED] Persisting specific wifi connections in disposable sys-net

So I’m sure I must be doing something stupid here, but I’m losing my mind.

From a fresh install of Qubes R4.3.0, with selected Disposable sys-net, I’ve done the following:

cloned default-dvm to sys-net-dvm
Assigned sys-net to use the sys-net-dvm template

Connected to my home Wifi
Copied the contents of sys-net:/rw/config/NM-system-connections/homewifi.nmconnection to sys-net-dvm:/rw/config/NM-system-connections/homewifi.nmconnection

ensured sys-net-dvm:/rw/config/NM-system-connections/homewifi.nmconnection is owned by root:root with perms 0600

Powered off sys-net-dvm, then rebooted sys-net.

The file is there in sys-net. I’m looking right at it. The contents are right. The ownership is right. The permissions are right. Yet this file is utterly invisible to NetworkManager no matter what I do. What the hell am I missing?

While I do not know what your issue is, you can instead do the following to achieve your goal in a way that I have verified works and does the same thing (makes sys-net “disposable”) while not requiring a whole new DVM template.

  1. Have a sys-net qube that’s an AppVM (NOT Disposable)
  2. Add your connection the way you would normally (just by connecting to it)
  3. Execute the following commands in dom0:
qvm-features sys-net custom-persist.networkmanager /rw/config/NM-system-connections
qvm-service -e sys-net custom-persist
  1. Reboot sys-net
  2. Profit! Now you can add and remove NM connections in sys-net and they get persisted but nothing else does.

Context:

1 Like

You can try this?

Doesn’t help. I’ve got my configuration down to [wifi] with an ssid, and [wifi-security] with key-mgmt and psk, and NetworkManager is completely oblivious to the file’s existence.

1 Like

Okay, I think this is actually something in Qubes not working as intended, or at least not working as previously described.

If I run, in sys-net

sudo cp /rw/config/NM-system-connection/mynetwork.nmconnection /rw/config/NM-system-connection/fixthis.nmconnection, followed by systemctl restart NetworkManager, sys-net now reports 1 connection profile and automatically connects to my wifi.

Files populated in /rw/config/NM-system-connection at boot-time from the dvm-template are not recognized by NetworkManager for some reason.

Ownership is the same. Permissions are the same. Contents are absolutely identical.

1 Like

I bet in a selinux issue? It’s not enough to make the permissions right, you need to put the selinux flag to allow network manager to use the file.

6 Likes

You’re awesome!

In sys-net-dvm - sudo fixfiles restore /rw

2 Likes