Where to add command to turn wifi off

57 views
Skip to first unread message

trueriver

unread,
Aug 8, 2018, 9:10:58 AM8/8/18
to qubes-users
What I am actually wanting to do is to alter sys-net so that the wifi does not start without my deliberate intervention, regardless of whether it was enabled at the most recent shutdown.

This is not to disable it totally, but to ensure that it only starts if I right click the widget and tick the enable wifi checkbox.

At present the wifi is enabled on sys-net startup, even when disabled from the system tray widget on the previous shutodwm. This is the exact reverse of what I want!

I apologise for raising this here (it is more appropriately a NetwrokManager or Fedora question) but it arises for me in the context of Qubes.

I have identified the command

nmcli radio wifi off

and am wondering where to insert this command in the start-up sequence. And do you recommend it to be in the sys-net Qube /rw space, or in the template (so that it actually runs at every startup).

Also, I am wondering if I have missed a config setting for NetworkManager that will do this for me. I have pored over the man pages and googled NetwokrManager disable but not found an answer. Plenty of ways to disable power management but that turns out to be something different.

R~~

Chris Laprise

unread,
Aug 8, 2018, 9:46:34 AM8/8/18
to trueriver, qubes-users
You can open a terminal in your template and run the following:

sudo touch /var/run/qubes-service/network-manager
sudo service network-manager start
nmcli radio wifi off

Then shutdown the template and restart sys-net. NM should remember the
setting you made in the template and start with wifi turned off. It can
be turned on by right-clicking the systray icon and enabling the wifi
checkbox.

--

Chris Laprise, tas...@posteo.net
https://github.com/tasket
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB 4AB3 1DC4 D106 F07F 1886

trueriver

unread,
Aug 8, 2018, 12:05:05 PM8/8/18
to qubes-users
Chris's suggestion was not quite right, but near enough for me to get it working. This is no reflection on Chris but is down to inconsistent naming conventions between different devs on different projects.

Chris said


>
> You can open a terminal in your template and run the following:
>
> sudo touch /var/run/qubes-service/network-manager

up to here is correct, but there are two points with the following line

> sudo service network-manager start

Firstly, it tries to do it but suggests we use systemctl instead.

Secondly systectl does not know of a service by this name. I then did a bit of searching and it turns out that the correct command is

sudo systemctl start NetworkManager

The rest all works as advertised.

> nmcli radio wifi off
>
> Then shutdown the template and restart sys-net. NM should remember the
> setting you made in the template and start with wifi turned off. It can
> be turned on by right-clicking the systray icon and enabling the wifi
> checkbox.
>

Many thanks Chris for putting me on the right path.

Comment on Qubes design:

Now I have seen it working I am also impressed with the way that touching that file makes it possible to start the service, just once, in the template, and the way that that file magically disappears before the template is rebooted. I had not realised that some template changes are volatile. As I say I am impressed :)

Warmly
River~~

Chris Laprise

unread,
Aug 8, 2018, 1:57:55 PM8/8/18
to trueriver, qubes-users
On 08/08/2018 12:05 PM, trueriver wrote:
> Chris's suggestion was not quite right, but near enough for me to get it working. This is no reflection on Chris but is down to inconsistent naming conventions between different devs on different projects.
>
> Chris said
>>
>> You can open a terminal in your template and run the following:
>>
>> sudo touch /var/run/qubes-service/network-manager
>
> up to here is correct, but there are two points with the following line
>
>> sudo service network-manager start
>
> Firstly, it tries to do it but suggests we use systemctl instead.
>
> Secondly systectl does not know of a service by this name. I then did a bit of searching and it turns out that the correct command is
>
> sudo systemctl start NetworkManager

Yes, I should have mentioned I worked that out on Debian 9. Fedora
service names are different.

Unman

unread,
Aug 9, 2018, 4:45:56 AM8/9/18
to Chris Laprise, trueriver, qubes-users
NetworkManager as service name works in Debian too.
Reply all
Reply to author
Forward
0 new messages