Mac randomization not working

Also restart sys-net and check once again in sys-net:

cat  /rw/config/qubes-bind-dirs.d/50_user.conf
ls -la /rw/bind-dirs/etc/NetworkManager/conf.d/
ls -la /etc/NetworkManager/conf.d/

Here is the output again, unfortunately I can only write it down since I’m on separate machines.
Disp template output:

  1. binds+=( ‘/usr/lib/NetworkManager/conf.d/31-randomize-mac.conf’ )
    binds+=( ‘/var/lib/NetworkManager/secret_key’ )
    binds+=( ‘/etc/NetworkManager/conf.d/00-macrandomize.conf’ )
  2. drwxr-xr-x 2 root root 4096 Apr 17 17:19 .
    drwxr-xr-x 3 root root 4096 Apr 17 17:18 …
    -rwxr-xr-x 1 root root 212 Apr 17 17:19 00-macrandomize.conf
  3. drwxr-xr-x 2 root root 4096 Apr 17 17:20 .
    drwxr-xr-x 7 root root 4096 Mar 2 13:56 …
    -rwxr-xr-x 1 root root 212 Apr 2 17:13 00-macrandom.conf

sys-net:

  1. binds+=( ‘/usr/lib/NetworkManager/conf.d/31-randomize-mac.conf’ )
    binds+=( ‘/var/lib/NetworkManager/secret_key’ )
    binds+=( ‘/etc/NetworkManager/conf.d/00-macrandomize.conf’ )
  2. drwxr-xr-x 2 root root 4096 Apr 17 17:19 .
    drwxr-xr-x 3 root root 4096 Apr 17 17:18 …
    -rwxr-xr-x 1 root root 212 Apr 17 17:19 00-macrandomize.conf
  3. drwxr-xr-x 2 root root 4096 Mar 9 2023
    drwxr-xr-x 6 root root 4096 Apr 17 18:03

Shutdown disp template and then restart sys-net.
Then check again:

cat  /rw/config/qubes-bind-dirs.d/50_user.conf
ls -la /rw/bind-dirs/etc/NetworkManager/conf.d/
ls -la /etc/NetworkManager/conf.d/

And see if there is 00-macrandom.conf in /etc/NetworkManager/conf.d/ in sys-net.

The first output is the same, only the last one changes:

  1. drwxr-xr-x 2 root root 4096 Mar 9 2023
    drwxr-xr-x 6 root root 4096 Apr 17 18:47

Sys-net is still empty in /etc/NetworkManager/conf.d/

I’ve just checked this myself and I didn’t have this issue.
I’ve created disposable template based on debian-12-xfce, created test file in /etc/NetworkManager/conf.d/ using bind-dirs:

sudo mkdir -p /rw/config/qubes-bind-dirs.d
echo "binds+=( '/etc/NetworkManager/conf.d/test.conf' )" | sudo tee /rw/config/qubes-bind-dirs.d/50_user.conf
sudo mkdir -p /rw/bind-dirs/etc/NetworkManager/conf.d/
sudo touch /rw/bind-dirs/etc/NetworkManager/conf.d/test.conf

Then created named disposable netVM based on this template and the file test.conf was in /etc/NetworkManager/conf.d/.

Can you try to use different template instead of Kicksecure-minimal for a test?
Maybe there is some problem in Kicksecure-minimal, but I don’t know what it could be.
Maybe there is some script that is checking whatever this is DispVM and if it is then it’s somehow removing the content of /etc/NetworkManager/conf.d/ for some reason.

Okay, I’ll check it. Should I leave sys-net as a disposable?

Yes, just change the template of your disposable template that sys-net is based on.

I checked it now and it is as you said, the test.conf was there.

I’m trying it again with a debian minimal template.

Edit: my download speed is quite slow right now so its going to take a while

Okay so in when using the debian and debian minimal template everything works fine. The test.conf file is in the disposable sys-net.

It seems like it has something to do with kicksecure.

I “reinstalled” the Kicksecure-minimal template, meaning I just deleted my sys-net template and dvm template to start anew and changed 31-randomize-mac.conf in /usr/lib/NetworkManager/conf.d/ instead of creating a new file in the /etc/NetworkManager/conf.d/ dir as it is mentioned in the guides. And it seems that the changes are being used.

Journalctl seems to pick up these changes as well as ip link show. The ethernet mac address gets changed.

If someone has problems with their kicksecure template in this regard then this could probably help.

@apparatus thanks for your help in trying to solve it.

1 Like