NetworkManager not using nmconnection file

Hello,

I am fairly new to Linux so the solution is probably pretty basic, but I could not find anything concerning this anywhere.

I was trying to make my WIFI persistent inside my disposable sys-net qube by copying the nmconnection file to the /rw/config/NM-system-connections directory of my fedora-dvm template qube. For context I tried copying it 2 different ways

  1. by using the qvm-copy-to-vm copy function of qubes
  2. by creating the file with nano and copying the contents

and I ran into the same Issue with both Methods. Instead of using the nmconnection file a new connection file with the schema [wifi name][random uuid].nmconnection gets created and used instead.

I tried setting the owner of the file using chown root:root and changed it’s permissions to u=rw using chmod insinde the dvm template but the same thing kept happening.

How do I get the the qube to accept configuration files I created?

I did get it working by setting my dvm template qube to hvm and connecting to the WIFI inside the dvm directly but I would rather get it to work by copying the file.

Check the difference between [wifi name].nmconnection and [wifi name][random uuid].nmconnection in your sys-net.

It now stopped working with the file that was created by the dvm and instead of adding a random uuid it adds a 1 at the end

this is the content of [wifi name].nmconnection:

[connection]
id:[wifi name]
uuid:[a uuid (different from [wifi name] 1.nmconnection])
type=wifi
interface-name=wls6

[wifi]
mode=infrastructure
ssid=[wifi name]

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=[password]

[ipv4]
method=auto

[ipv6]
addr-gen-mode=default

content of [wifi name] 1.nmconnection:

[connection]
id:[wifi name] 1
uuid:[a uuid (different from [wifi name].nmconnection])
type=wifi
interface-name=wls7

[wifi]
mode=infrastructure
ssid=[wifi name]

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=[password]

[ipv4]
method=auto

[ipv6]
addr-gen-mode=default

Thank you for helping and sorry for responding this late

Your problem is that interface name in disposable template and disposable qube have different names wls6 and wls7 so the Network Manager think of them as different connections.
If you have the same wls7 interface name in disposable qube on every start then you can just change interface name in disposable template from wls6 to wls7 and the connection will work in disposable qube.
Another way will be changing the interface name:
Network configuration - ArchWiki

Hi.
Just use the fields you need, the others one will be default values.

wifi_cfg=/rw/config/NM-system-connections/home.nmconnection
echo '
[wifi]
ssid=MY_SSID_NAME

[wifi-security]
key-mgmt=wpa-psk
psk=MY_PASSWORD' | sudo tee $wifi_cfg
sudo chmod 600 $wifi_cfg

Set your connection as you like it in sys-net, and then just copy it to /rw//config/NM-system-connections folder of sys-net’s dvm-template. Shut down dvm-template and restart sys-net. It’s all there.

This worked perfectly thank you for your help

I could bet you didn’t succeed with your initial tryout because you didn’t shutdown/reset qubes. No other thing is possible.