I am new to Qubes OS and I have a problem with an application which doesn’t launch from the Qubes menu.
I have installed the application in an AppVM. Why not in a TemplateVM ? Because this application only deploys in /home/user, and creates a .desktop shortcut file in ~/.local/share/applications. Qubes sees it well and displays it in the AppVM applications list, but when I click on it, nothing happens (visually).
If I open a xfce-terminal from this AppVM and launch the command written in Exec= in the .desktop file, it works, the application starts (the script is launched and a web browser appears).
If in the same terminal I run gtk-launch <shortcut> where is the name of the .desktop file with or without the .desktop part, it works too.
But if I click on the shortcut in the Qubes menu, nothing appears.
How could I troubleshoot what is happening here, and why the behavior is different from the equivalent commands?
This page contains some details about how it works:
The .desktop file used by dom0 are stored under ~/.local/share/applications
You can look for the line starting with Exec= to see the actual command used by the Appmenu. You can use grep like this (replace $NAME_OF_THE_... by the corresponding value each time I mention it until the end of this post):
# in dom0, replace $NAME_OF_THE_APP
grep -r "Exec=.*$NAME_OF_THE_APP" ~/.local/share/applications
It should give you something like this:
~/.local/share/applications/org.qubes-os.vm._${NAME_OF_THE_QUBE}.xfce-settings-manager.desktop:Exec=qvm-run -q -a --service -- ${NAME_OF_THE_QUBE} qubes.StartApp+${NAME_OF_THE_APP}
So, you can try to run the same command in dom0:
# in dom0
qvm-run -q -a --service -- ${NAME_OF_THE_QUBE} qubes.StartApp+${NAME_OF_THE_APP}
You can also use this command inside the qube:
# in your qube
/etc/qubes-rpc/qubes.StartApp $NAME_OF_THE_APP
This will allow you to see where the shortcut is falling if so.
The following is just an idea, I had this problem with a missing path in the $PATH environment variable. My application was installed in ~/.local/bin, but it wasn’t in the $PATH used by the StartApp service. So, adding this line to ~/.profile was the solution:
Thank you for the detailed answer. I found the .desktop file in dom0 where Exec= is exactly the command you wrote.
If I run this, nothing happens, no error appears. If I remove -q I only get Running 'qubes.StartApp+${NAME_OF_THE_APP}' on ${NAME_OF_THE_QUBE} displaying.
However,
when I run this, I get the following error:
Traceback (most recent call last):
File "/etc/qubes-rpc/qubes.StartApp", line 39, in <module>
main(sys.argv)
File "/etc/qubes-rpc/qubes.StartApp", line 15, in main
if qubes_db.read('/qubes-service/app-dispvm.' + arg) is not None:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
qubesdb.Error: (71, 'Protocol error')
An idea where this could come from ?
I precise that my AppVM is relying on the default debian-12-xfce template given at Qubes installation.
Hmmm I assumed $NAME_OF_THE_APP is the name we find in the .desktop filename in the qube, under the form $NAME_OF_THE_APP.desktop.
So in the qube, gtk-launch $NAME_OF_THE_APP works, while /etc/qubes-rpc/qubes.StartApp $NAME_OF_THE_APP not.
I think it is also the name we find in dom0 in ~/.local/share/applications/org.qubes-os.vm._$NAME_OF_THE_QUBE.$NAME_OF_THE_APP.desktop
OK, here is a problem: in my qube, $NAME_OF_THE_APP has a space in it. However, the first part before the space disappeared in the .desktop filename in dom0.
It’s like, instead of having ~/.local/share/applications/org.qubes-os.vm._${NAME OF THE QUBE}.${NAME OF THE APP}.desktop, I had ~/.local/share/applications/org.qubes-os.vm._${NAME OF THE QUBE}.${APP}.desktop. I guess it’s not how it should be.
Seems like there is a problem in the shortcut management where there is a space in the name. To cross-test this theory, I copied the $NAME_OF_THE_APP.desktop file in my qube to a $NAME_OF_THE_APP_WITHOUT_SPACE.desktop, I resynced the apps to have the new shortcut in the Qubes menu, and now it works.
There is probably an open issue here; as a workaround I’ll remove the space in the .desktop filenames.
Thank you for the help !
Alright that’s good to know, so it’s the app developers who are at fault here.
But well, even if it’s not conformant with the specifications, while most linux distributions support it, maybe Qubes could support it as well.
I guess Qubes devs should at least be aware of this and take their decision (if they take a look here).