Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use the nmcli in WSL and create a wifi hotspot?

I am trying to setup a wifihotpot on my laptop in ubuntu 18 running as a Windows Subsystem for Linux (WSL). (Terminal only) Following basic tutorials I wanted to run the following command:

~$ nmcli device wifi hotspot con-name my-hotspot ssid my-hotspot band bg password 123456
Error: Could not create NMClient object: Could not connect: No such file or directory.

Trying to start the networkmanager also fails:

~$ sudo service network-manager start
* Starting network connection manager NetworkManager    [ OK ]
~$ sudo service network-manager status
* NetworkManager is not running

I tried the networkManager after installing network-manager:

sudo add-apt-repository ppa:nilarimogard/webupd8

Is there another way to create a wifi hotspot from Ubuntu running as a WSL? Or does it not have the right access to the windows host to pull it off?

like image 284
Joost Avatar asked Jul 23 '19 23:07

Joost


People also ask

What is Nmcli used for?

nmcli is a command-line tool which is used for controlling NetworkManager. nmcli command can also be used to display network device status, create, edit, activate/deactivate, and delete network connections. Typical Uses: Scripts: Instead of manually managing the network connections it utilize NetworkMaager via nmcli.

Can't connect to Nmcli hotspot?

Temporary solution: Completely power off and restart (cold boot) the device (this ensures that the WLAN card memory is initialized to an clean state), and then execute nmcli con up SSID , then enter the password on the phone to connect to the AP normally.

Is WSL portable?

WSL and WSL2 are really a set of optional features in Windows and can't be made portable (if you actually want to install WSL, don't follow that guide, use the single-command install).


1 Answers

at this time, I don't believe it is possible according to https://github.com/microsoft/WSL/issues/2438. They designed WSL to ignore calls to set interface properties. So nmcli and other commands that changes interface properties are not working, they marked it as a bug and will fix it in the future.

"WSL currently ignores the call (which was intentional at the time of the design) to set interface properties" - sunilmut

I hope to help in some way :)

like image 167
Daniel Tré Avatar answered Oct 24 '22 12:10

Daniel Tré