WiFi card passed to LXD container results in failure, Please help me!

That’s a different type of managed. iw is not part of the NetworkManager suite, therefore that managed does not mean managed by NetworkManager.

I see you are using the RTL8812AU. Isn’t that the one that does not work out of the box and you need to install DKMS drivers?

Luckily, I happen to have one of those. I went through the steps and installed a DKMS driver, and managed to replicated the issue that you are facing.

According to the following,

You get a better error message when you stop the container, add the nic (it gets added successfully since there is no check), and when you start the container you get:

lxc mykali 20200410173713.876 ERROR    network - network.c:lxc_network_move_created_netdev_priv:3126 - Operation not permitted - Failed to move network device "wlx0xxxxxxxxxx" with ifindex 12 to network namespace 104055

There’s a bug report for this, apparently it has been a regression that was supposed to be fixed.

Here is the fix, support for nl80211 adapters,

This post says that they got a workaround to specify the physical interface (in that case, phy2) simply by installing the iw utility. They use Debian, most likely not the snap.

@stgraber, should there be a bug report for this?