Excluding a "standard" service (such as pulseaudio, but not limited to it) from XDG-autostart ?

55 views
Skip to first unread message

daltong defourne

unread,
Dec 10, 2018, 3:05:12 PM12/10/18
to qubes-devel
Hello!

I'm trying to exclude a service that is started by XDG-autostart from starting up only on SOME app-VMs based on same template-VM (so deleting the .desktop file from appvm completely is not an option)

After reading some comments on github from long ago (like this one here https://github.com/QubesOS/qubes-issues/issues/137#issuecomment-77752422 ) I have concluded that I theoretically should be able to use NotShowIn in the desktop file.

However, putting a

NotShowIn=personal;work

into

/etc/xdg/autostart/pulseaudio.desktop

did not help me to prevent pulse startup in VM named personal and vm named work

What am I doing wrong?

Is doing what I want even possible?

P.S.
Still Qubes 3.2 because I am windows-VM dependent

Ivan Mitev

unread,
Dec 11, 2018, 1:54:49 AM12/11/18
to qubes...@googlegroups.com


On 12/10/18 10:05 PM, daltong defourne wrote:
> Hello!
>
> I'm trying to exclude a service that is started by XDG-autostart from starting up only on SOME app-VMs based on same template-VM (so deleting the .desktop file from appvm completely is not an option)
>
> After reading some comments on github from long ago (like this one here https://github.com/QubesOS/qubes-issues/issues/137#issuecomment-77752422 ) I have concluded that I theoretically should be able to use NotShowIn in the desktop file.
>
> However, putting a
>
> NotShowIn=personal;work
>
> into
>
> /etc/xdg/autostart/pulseaudio.desktop
>
> did not help me to prevent pulse startup in VM named personal and vm named work
>
> What am I doing wrong?

You can only specify a VM type (AppVM, NetVM, ...), not a VM name.

> Is doing what I want even possible?

In theory yes (haven't tested it): you'll have to put a .desktop in
$HOME/.config/autostart/ with 'Hidden=true' in each of the *AppVM* you
want the .desktop app to be disabled.


> P.S.
> Still Qubes 3.2 because I am windows-VM dependent

FWIW I'm using R4 both with R3.2 imported win VMs as well as ones
created in R4 and I don't have any problems (but then I use QWT from
R3.2 - didn't manage to have the newer QWT work; see issue #3585).


PS: please send such posts to qubes-users@


unman

unread,
Dec 16, 2018, 7:16:14 AM12/16/18
to qubes...@googlegroups.com
It would surely be easier to use bind-dirs to have a qube specific
autostart?

Ivan Mitev

unread,
Dec 16, 2018, 7:27:44 AM12/16/18
to qubes...@googlegroups.com
I've never used bind-dirs ; looking at the doc I don't see how that
could be *easily* used for the OP's problem, can you elaborate ?
(genuinely interested - I'm likely missing something).

unman

unread,
Dec 16, 2018, 9:59:17 AM12/16/18
to qubes...@googlegroups.com
Set up bind-dirs with binds+=( '/etc/xdg/autostart' )
On reboot the qube will have the autostart directory held in /rw.
Remove the pulseaudio and qubes-pulseaudio files from
/etc/xdg/autostart.
Reboot
Done.

Alternatively, remove those files from the TEMPLATE and use bind-dirs to
start the services in the few qubes where it's wanted, by including the
file in binded /etc/xdg/autostart.

Surely easier than custom desktop files?
You can use (and abuse) bind-dirs for almost complete qube
customisation. Well worth using.

Ivan Mitev

unread,
Dec 16, 2018, 10:47:33 AM12/16/18
to qubes...@googlegroups.com
OK - that's what I thought could be done after reading the doc.

> Alternatively, remove those files from the TEMPLATE and use bind-dirs to
> start the services in the few qubes where it's wanted, by including the
> file in binded /etc/xdg/autostart.

In both cases, overriding the content of the *whole* directory is a bit
heavy-handed IMO. Moreover the templateVM and the AppVMs will get
out-of-sync when packages in the template that change/add stuff to
autostart/ are upgraded/installed.


> Surely easier than custom desktop files?

Frankly, I'm not sure ; the OP wanted to prevent pulseaudio from
starting in two AppVMs:

Solution 1- create a single-line .desktop file in two AppVMs

Solution 2- configure bind dirs, copy the template's autostart/*.desktop
files to both AppVM minus the service(s) you don't want. And then try
not to forget to keep the .desktop files in sync when upgrading the
template.

So, considering the OP's needs, I'd say that 1- is quicker and easier to
implement than 2-, but maybe you'll disagree (not trying to argue!).

> You can use (and abuse) bind-dirs for almost complete qube
> customisation. Well worth using.

Indeed, it's quite powerful. Will keep that in mind for future heavy
qubes customization.

Cheers
Ivan

Marek Marczykowski-Górecki

unread,
Dec 16, 2018, 10:51:35 AM12/16/18
to Ivan Mitev, daltong defourne, qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Tue, Dec 11, 2018 at 08:54:45AM +0200, Ivan Mitev wrote:
>
>
> On 12/10/18 10:05 PM, daltong defourne wrote:
> > Hello!
> >
> > I'm trying to exclude a service that is started by XDG-autostart from starting up only on SOME app-VMs based on same template-VM (so deleting the .desktop file from appvm completely is not an option)
> >
> > After reading some comments on github from long ago (like this one here https://github.com/QubesOS/qubes-issues/issues/137#issuecomment-77752422 ) I have concluded that I theoretically should be able to use NotShowIn in the desktop file.
> >
> > However, putting a
> >
> > NotShowIn=personal;work
> >
> > into
> >
> > /etc/xdg/autostart/pulseaudio.desktop
> >
> > did not help me to prevent pulse startup in VM named personal and vm named work
> >
> > What am I doing wrong?
>
> You can only specify a VM type (AppVM, NetVM, ...), not a VM name.
>
> > Is doing what I want even possible?
>
> In theory yes (haven't tested it): you'll have to put a .desktop in
> $HOME/.config/autostart/ with 'Hidden=true' in each of the *AppVM* you want
> the .desktop app to be disabled.

This should work. And this is the recommended way according to Desktop
Application Autostart Specification[1]. And is much less intrusive than
bind-dirs.

[1] https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html#idm140434866989328

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAlwWdH8ACgkQ24/THMrX
1ywdyAf/WsKAR5uEWY9NOTOLZDcoEKnOKuqRj8i55S/Jz97/puIUqNxTivyoo6S3
ypJrHdp9wBQuL/RTnieavbUdJxBSmqHoljZhK4nImkXXQE+Qsv8f0X1i2ar0xqsL
cKLY911+xRWjIcqBvrYshYO/2W4qm9KTmCiNq9p2+5iRSUMBgZovimFFpUaXz3mP
0p7R7cQxv4pDHvkK1zUn1JY4xqhDkGGO+bbkN9o6PaTeDjlQx0Bj8xiVCemDFvlW
nYMIc+Fq37WboztS1sf6XXj87i/Xm4HUX9QHggQG+ZBqdhUd3rEjMeCvf6V+quyZ
yJIP5sO/Qy9TCPV/V57rtrAf9JOkiA==
=Rr6X
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages