shell-intune-samples icon indicating copy to clipboard operation
shell-intune-samples copied to clipboard

IntuneWSLPluginInstaller - WSL distro not recognized

Open derhoeppi opened this issue 6 months ago • 10 comments

We wanne use the IntuneWSLPluginInstaller for our company devices to allowed only allowed distributions. Now we have an distribution NixOS. It has also the information in /etc/os-release but it would not be recognized. Another distribution like debian or ubuntu works.

The /etc/os-release looks like:

ANSI_COLOR="0;38;2;126;186;228" BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="25.05.20250724.3ff0e34" CPE_NAME="cpe:/o:nixos:nixos:25.05" DEFAULT_HOSTNAME=nixos DOCUMENTATION_URL="https://nixos.org/learn.html" HOME_URL="https://nixos.org/" ID=nixos ID_LIKE="" IMAGE_ID="" IMAGE_VERSION="" LOGO="nix-snowflake" NAME=NixOS PRETTY_NAME="NixOS 25.05 (Warbler)" SUPPORT_END="2025-12-31" SUPPORT_URL="https://nixos.org/community.html" VARIANT="" VARIANT_ID="" VENDOR_NAME=NixOS VENDOR_URL="https://nixos.org/" VERSION="25.05 (Warbler)" VERSION_CODENAME=warbler VERSION_ID="25.05"

Where is the issue that this distribution is not recognized?

derhoeppi avatar Sep 05 '25 08:09 derhoeppi

What is the exact issue that you are seeing? Is the compliance result for the policy not correct? Or are you seeing failures with WSL?

befari avatar Sep 05 '25 15:09 befari

Yeah the result is not correct. A user can add this distribution and we have now way to block this. I do not understand why this distribution is not mentioned in the registry so the compliance script could check that it is not allowed.

derhoeppi avatar Sep 05 '25 16:09 derhoeppi

Can you share the configuration for your compliance policy?

befari avatar Sep 05 '25 16:09 befari

Thats our setting in Intune:

Image

Thats the list of my wsl distributions:

Image

Both are started and the IntuneWSLPlugin is earlier installed. If i take a look into my registry i can only see that ubuntu is registred in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Intune\WSLManagement\mySID\

derhoeppi avatar Sep 05 '25 16:09 derhoeppi

Have you started the NixOS distribution at all? Or have you just registered it? In order for the plugin to pick up the distro it has to have been started at least once

befari avatar Sep 05 '25 17:09 befari

Sure NixOS was started from Windows Terminal and i get a prompt where i can use linux commands like "cat /etc/os-release".

derhoeppi avatar Sep 05 '25 18:09 derhoeppi

if you run "/bin/cat /etc/os-release" do you get any errors?

befari avatar Sep 05 '25 18:09 befari

Yes /bin/cat is unknown

Image

derhoeppi avatar Sep 05 '25 18:09 derhoeppi

Is the command "/bin/cat /etc/os-release" hard coded in the library? If yes is it possible that this one is only executet if "cat /etc/os-release" does not give a valid response? And is there someone who is working on it? Is that code open source so we can see, modify and create merge requests to fix it.

derhoeppi avatar Oct 17 '25 14:10 derhoeppi

Apologies for the delay, we have a work item open to address this and will be addressing it fairly soon. I will be sure to update you as soon as we have done so. The code is not open source for this plugin

befari avatar Oct 17 '25 15:10 befari

@befari do you need someone to test this change?

derhoeppi avatar Jan 10 '26 12:01 derhoeppi