Almalinux9 WSL2 environment execution nmcli con show null

I tried to install wsl2 mirroring for Almalinux9 and ALmalinux8, because the project requires the use of NetworkManager to connect to the wsl2 network. However, when I tried to manage the network through “”nmcli con show“” and “”nmcli con up”, I found that it was empty and could not be activated. I executed “nmcli networking” to check the Networkmanager hosting status and display enable. I feel that this is contradictory or that almalinux has made other restrictions. I am very anxious. Please help me take a look. Thank you all

By executing nmcli -t dev status, the network device status is displayed as:​

eth0:ethernet:unmanaged:​

lo:loopback:unmanaged:

NetworkManager on WSL is known to cause issues and is masked in AlmaLinux WSL images.

If systemd is enabled, units that can cause issues with WSL should be disabled or masked. The below units are known to cause issues in WSL distributions (applies to both system and user units):
NetworkManager.service

$ uname -r
5.15.167.4-microsoft-standard-WSL2

The AlmaLinux on WSL2 does not run AlmaLinux kernel. The active network configuration is in the kernel, and therefore set by WSL2, not by NetworkManager.service.

You can run ip ro (and other ip commands) to see the current config.

Thank you for your reply. I also saw Microsoft’s instructions based on your link, and it is indeed restricted.

Thank you for your reply. It is true that the wsl2 kernel is mainly used to control network devices. If we only use NetworkManager as a tool to manage network interface cards, how can we open this restriction? Although I know it will cause some problems, I still want to learn more about it

That would be true on real AlmaLinux system, but the tool for WSL2 is Microsoft Windows.