0

I'm trying to open network manager GUI on WSL2 Ubuntu on Windows 11 using the command nm-connection-editor, but it shows the following error:

** (nm-connection-editor:7104): WARNING **: 17:05:24.796: Couldn't construct the client instance: Could not connect: No such file or directory

(nm-connection-editor:7104): GLib-GObject-CRITICAL **: 17:05:24.796: g_object_set_qdata: assertion 'G_IS_OBJECT (object)' failed

(nm-connection-editor:7104): GLib-GObject-WARNING **: 17:05:24.796: instance with invalid (NULL) class pointer

(nm-connection-editor:7104): GLib-GObject-CRITICAL **: 17:05:24.796: g_signal_handlers_destroy: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(nm-connection-editor:7104): GLib-GObject-WARNING **: 17:05:24.796: instance with invalid (NULL) class pointer

(nm-connection-editor:7104): GLib-GObject-CRITICAL **: 17:05:24.796: g_signal_handlers_destroy: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(nm-connection-editor:7104): GLib-GObject-CRITICAL **: 17:05:24.796: g_object_unref: assertion 'old_ref > 0' failed

** (nm-connection-editor:7104): WARNING **: 17:05:24.796: Failed to initialize the UI, exiting...

** (nm-connection-editor:7104): CRITICAL **: 17:05:24.796: nm_connection_list_present: assertion 'NM_IS_CONNECTION_LIST (list)' failed

How can I fix this?

Note: I already tried the possible solutions on this question but still doesn't work.

1 Answers1

0

Wow - You're hitting almost every WSL limitation in one single command there! I'm exaggerating slightly, but you should definitely read that answer for more details.

A few things are going on here, but most of these are rooted in the fact that:

  • WSL does not (easily) support Systemd. Alternatively, Systemd does not support running under WSL, since it will only run if it is PID1. See this Ask Ubuntu answer and this Super User answer where I deep-dive into that particular topic.

  • nm-connection-editor is a Gnome component. Gnome relies on Systemd.

  • It appears to me that nm-connection-editor, like many other Gnome components, makes use of Dbus for interacting with other components. DBus is normally started at boot by Systemd (or another process supervisor). It's possible to run it without Systemd, but it isn't running by default in WSL.

Even once we resolve all that:

  • Network Manager typically isn't going to be all that useful in WSL since you can't change the default network inside your distribution. WSL2 is actually a "managed" virtual machine that we as users can't access. It's that VM that controls the network. Your WSL2 distribution runs as a container inside that VM.

    Attempting to use Network Manager in WSL would be like attempting to use it in a Docker container -- It probably doesn't make much sense. You don't mention your use-case for wanting to use Network Manager, but that may warrant a second question if you need an alternative for your use-case.

With all that said, it's possible to get Network Manager running under WSL, just pretty hacky and quite complicated. See this Ask Ubuntu answer for a method I've used under Ubuntu 20.04 to get Gnome running under WSL through Xrdp.

Note that on Jammy (22.04), there are some other issues that have to be resolved, as the gnome-desktop package brings in some other problematic Systemd units under WSL - see this Genie issue on Github.

NotTheDr01ds
  • 28,025