How can I open an Application via dom0 keyboard shortcut?

I suspect another way to ask this would be: what dom0 command do I use to open ‘Firefox’ in the ‘work’ AppVM - if such a command exists, that’s all I need.


By Application I mean an individual application inside of an AppVM. For example, the ‘Firefox’ application inside of the ‘work’ AppVM.

By open I mean launch, from any state. Including the AppVM being shutdown.

By dom0 I mean you can use the keyboard shortcut anywhere, in any window. I’m effectively asking about global keyboard shortcuts.

I have found the following:

System Settings > Keyboard > Application Shortcuts > Add

However I am only able to figure out how to add commands that manipulate dom0. I haven’t gotten any commands to manipulate an application in an AppVM. And at this point, I am unsure whether this is even possible.

Google and this forum are also shockingly silent on this question. So my secondary motivation here is to help others in the future. I can’t be the only person who would like this :slight_smile:

1 Like

Yes you can!

But I can’t give you an exact answer currently.
If I remember correctly, you should check out the qvm-run command for this. But I am sure someone more knowledgeable will come around soon.

I am pretty sure you want something like this: How to open terminal in VM using qvm-run - #5 by qubesnewb…?

Edit:
Where

  • domU is the appvm you want to launch it from
  • qubes-run-terminal launches a terminal in the specified appvm (so likely your command)

This you can probably map to a keybinding.
Hope it helps!

To launch an app via dom0 cli, you can run this (<> denotes a variable you replace appropriately):

qvm-run -q -a --service <your-qube> qubes.StartApp+<your-app-.desktop-name>

For example, Firefox on fedora-appvm and Firefox ESR on debian-appvm, respectively:

qvm-run -q -a --service fedora-appvm qubes.StartApp+firefox
qvm-run -q -a --service debian-appvm qubes.StartApp+firefox-esr

And keyboard shortcuts in XFCE (dom0):
https://docs.xfce.org/xfce/xfce4-settings/keyboard

Or a more flexible solution if you use a lot of keybinds, sxhkd:
https://wiki.archlinux.org/title/Sxhkd

3 Likes

Thanks! I was not able to get this to work:

qvm-run fedora-appvm qubes.StartApp+firefox

However I found this, and it does work for most apps:

qvm-run -q fedora-appvm firefox

Based on the discussion about it here it’s unclear to me if I should keep using it long term:

Apps I have installed myself though I’m not able to get working so far. I think the problem is I don’t know what the your-app is called. I’m not even seeing them in /usr/bin under any names I recognize.

Anyone have ideas on where to find that info?

My apologies, I forgot the proper options I have updated my previous post.

I would prefer the qubes.StartApp method because it relies on a limited RPC that only executes existing apps in your appmenu. This is the way Qubes runs apps natively. Using a variation of qvm-run <qube> <command> uses an RPC that executes commands directly in a VM, which is more prone to error. If you’re an advanced user and understand the implications, then by all means use it. But if not, it would be better to stick to the paved route. In the future with sys-gui[-gpu], the latter will not be an option because the GUIVM will not be permitted to run commands directly in qubes. (At least with the current designs. As with everything, this is subject to change.)

Did you install the app in the appropriate template? If so, could you walk me through exactly how you installed it?

Did you install the app in the appropriate template?

Actually, no. The ones I’m trying to get working were all installed in the AppVM.

One of them was installed with these instructions:

The end result of which is:

./start-mullvad-browser.desktop

I have tried start-mullvad-browser and it doesn’t work (nor mullvad-browser)

Mullvad Browser has been registered as a desktop app for this user in ~/.local/share/applications/

And the others are .AppImage files which I dropped into /user, ran chmod on and added a .desktop file in the Template, so they show up in applications. All are added to AppMenu so if Qubes is running some qvm-run to launch them, I should be able to do the same if I can just identify how they are named.

This one is pretty cool, hopefully it helps someone later

To do a disposable VM you just add --dispvm

So now I have a keyboard shortcut to open a disposable Tor browser via this:

qvm-run -q -a --service --dispvm whonix-workstation-17-dvm tor_app_name

tor_app_name is long and might be semi-unique so I did not include mine. You can view it in the Qube Manager application selection menu by hovering over Tor Browser.

IIRC, the guide from Mullvad is outdated. Please use this:

As far as Appimages, they are standalone files, and you won’t find them anywhere but that file. Make sure they are executable:

sudo chmod +x </path/to/Appimage>

That is for the Mullvad VPN - the link I posted is for their browser. That actually did work with the new command and start-mullvad-browser

As for telling me to chmod the .AppImage, I suppose you didn’t read where I said I had done that step and (to me) I said it like I know that very well. And I’m more than a little confused how you think I was getting those to work at all if I had not done that.

… .AppImage files which I dropped into /user, ran chmod on and added a …

Pretty much everything you posted in this thread was flawed and I couldn’t use any of it as you stated it. However it ultimately did lead me to where I needed to go. So for that I’m very grateful.

But bigger picture, I’m not sure that is the best thing to be doing - going around spraying stuff that you clearly do not know that well, to people who might not understand it and just copy paste it, and end up getting themselves rekt.

I do apologize. I haven’t gotten much sleep this past week, and I was very tired when I tried to help. I was trying to help promptly, but you are correct: I should have waited.

You could create a Launcher in the “Taskbar” area… thats what i use to create a deceptive Windows 11 look a like. Then you can take an icon from icon8.com download the icon and switch out the icon from generic launcher to whatever you want to start up.

(Thats what i did with brave. Until i find a workable solution.)

Taskbar being the panel where the Qubes “Start” button is.

Thanks. I’m quite hooked on doing them with keyboard shortcuts now. Once muscle memory set in for my most used apps, I just lazily open stuff without even really realizing how I’m doing it. It’s very close to commanding stuff to open with my mind lol

Lol, yea for sure! I labeled that response because there could also be a linkage between Launchers and Keyboard Shortcuts.

I havent taken a look into Keyboard Shortcuts but there has to be a connection that could work the same.

Let me know when you figure it out!

-cheers