How to add application to a qube

First of all, I have read and followed the following documentation:

Although it took me a long time to figure out how to actually create a .desktop file in the desired location, I managed to do it. However, after following the instructions, it never showed up in the applications list.

I followed the advice on this post: How to create shortcut in Application Menu?

One reply posted this link: (link removed because new users can only post 2 links at a time - what a stupid rule. It’s a post from fsflover starting with “Continuing the discussion…”).

It says “Most likely it will show you some dependency errors like this:” and a blank image appears, which might’ve just contained the crucial information I needed. It says it can’t explain the exact process to installing dependencies, and so I don’t know what to do.

All I want to do is install some software and make it easy to run when I open the qube. This should be super easy but it isn’t. It’s issues like these that make it very hard to make the switch. I’m usually good at googling for help without asking questions but I’m lost now. This is my first post on this forum.

Guess we need some more infos from you (which template/appVM you’re using?).
So let’s expect you’re using the fedora system (template/appVM), then you simply have to start a terminal on the templateVM (which the appVM is based on) and inserting:

sudo dnf install <software_name>

after the software was installed, then you need to shutdown the template and open the settings of the addVM. There you’ll find an application register, where you have to look for your installed application and moving it to the right window.
After that you can start the appVM and will find the installed application in the menu under “appVM > applications”

First of all, thanks for the reply.

sudo dnf install <software_name>

is no good. The software I want to install is never available despite being popular (eg. Tutanota).

However, today I managed to find out how to do it. After scouring the internet, I finally found a command that allows me to install via AppImage. After downloading the app image and making executable, I’m unable to run the appimage due to an error, “cannot mount appimage please check your fuse setup”. This is on Fedora (templateVM). The error says I should use --appimage-extract, but I don’t know the full command for this to be useful information. Finally I discovered you can run executables by using ./file-name.AppImage. I ran ./file-name.AppImage --appimage-extract which extracted a squashfs file. Unsure what to do at this point, I entered that folder (file explorer) and clicked on the executable, which opened the app. I wasn’t sure if it was installed at that point, but after refreshing the qube, it suddenly appeared in the applications list of the qube manager.

There’s nothing on the internet that explains this process. I just wonder, assuming you have to install via an appimage, is there an easier way to do it? I’m well aware that the easiest way to install apps is via simple “dnf install” or “get-apt” or via software managers, but this was not possible in my situation. I tried using flatpak (or is it flathub?) but that didn’t work.

1 Like

Test your .desktop file using gtk-launch from the terminal in the qube:

# create a working .desktop file for demo
$ cp /usr/share/spplications/xterm.desktop ~/.local/share/applications/footerm.desktop
$ gtk-launch footerm
#=> works

# break the .desktop file
$ sed -i 's/^Exec=xterm/Exec=noterm/' footerm.desktop 
$ gtk-launch footerm
gtk-launch: no such application footerm

# fix the file
$ sed -i 's/^Exec=noterm/Exec=xterm/' footerm.desktop 
$ gtk-launch footerm
#=> works

Welcome!

You absolute legend! That means a lot to the people who wrote it :slight_smile:

Ok, well @TheGardner’s explanation is how you’d end up getting menu options for software installed by the template’s package manager. I’m assuming you’re reasonably familiar with Linux (if you’re not, ask for clarification about anything you don’t understand).

Basically, if you want the software to be persistent (ie you shut down the qube, and have the software still be there when you start it again), then you’ll need to install it in the template that the Qube is based on.

(Installed software inside AppVMs is purged when the AppVM is shut down, just in case something installed turned out to be malware…)

  1. Open the template that you want to have the software installed in.
  2. Either:
    a. Run your package manager command in a terminal to install the software you want
    OR
    b. Put all the files in the right places manually if it’s compiled from source
  3. Once you’ve finished, shut down the template.
  4. Next, open up the Qube Settings dialog box of the Qube (otherwise known as “AppVM”) that you want your Q-menu option to be in.
    Q-Menu → AppVM → Qube Settings
  5. Select “Applications” tab, and that will bring you to this screen:

    (Yes, I know, I have a lot of crap in my templates :stuck_out_tongue:)
  6. Click “Refresh Applications”. This will open the template that this AppVM is based on, and refresh the list of installed software in the left list.
  7. Select the software that you want menu options for, and then click “>” to add them to your Q-Menu.
    (If you want all of them, then “>>” is your favourite button)
  8. Click “Apply”, and there should be an entry in your Q-Menu!

Full credit to @TheGardner for this solution.


However, if you are wanting to have Q-Menu options for scripts and just binaries that don’t have GUI frontends or .desktop files, then you’ll need to create them like it says in the links you found.

If you’re using the new Qubes App Menu, then they’ll need to be put into ~/.local/share/qubes-appmenus/<vm-name>/ instead. But this app menu is still in testing, so it might break.

If it does break, please post it in this forum so it can be fixed :slight_smile:

I agree. It doesn’t help that it isn’t really in a place where new users might naturally think to look, either. This is good feedback, though.

100% agree.

3 Likes

@Iambchop I will test this method and post the results later.

@alzer89 I didn’t know you had to install software in the template first. So if I’ve got this right…once you’ve installed the software in the templateVM, and you create a new AppVM based on that template, you have the option (via the Application tab in the qube manager) to add that application to the AppVM. That’s pretty neat and I’ll do that instead.

(Installed software inside AppVMs is purged when the AppVM is shut down, just in case something installed turned out to be malware…)

If that’s the case, how come I’m able to run the same downloaded app after closing the VM?

a. Run your package manager command in a terminal to install the software you want

  1. I don’t know what command that is,
  2. AFAIK, the package manager uses known repositories, while much of the software that I attempt to download is not available in known repositories and the only known way to install it is via the website.
  3. Isn’t it safer to download software through the website? I don’t know of any method to verify the authenticity of a repo, and there’s the possibility of mistyping the repo name. For example, I have no idea from what repo to install Tutanota.
  4. Different package managers have different repos and it’s confusing. Eg. flathub/flatpak, Snapd, and others that I’ve forgotten.

The rest of the instructions you’ve given, I am familiar with.

Also, please read my reply How to add application to a qube - #3 by 88uhbvpqboufpcez

The way I found that out was by opening an AppVM and installing a web server with a very intricate database, only to shut down the AppVM and restart it to find it ALL GONE.

After that, I immediately opened the Qubes OS documentation and spent a whole night reading all of it :joy:

But yeah. Basically, one of the awesome design features of Qubes OS is that an AppVM is stacked on top of a template. This means that if you run sudo rm -rf / —no-preserve-root inside an AppVM, your templates are unaffected (all the changes are in RAM only).

(Just in case anyone is curious about what that command does, it deletes every single file on your computer, and honestly it is a horrible sick joke to do to someone’s computer. :rage:

….but if you still want to try it, open a terminal in a disposable VM and try it and see what happens. Just make sure you don’t try it anywhere else!)

The idea is that if malware gets into an AppVM, it isn’t persistent. All you have to do is reboot the AppVM, and the malware should be all gone!

But yeah, it also means that any packages you installed will also be gone :stuck_out_tongue_winking_eye:

Not quite. The Applications tab in the Qube Settings determines what software you’d like to show up in your Q-Menu. It doesn’t mean that it won’t be present inside your AppVM.

Basically, if you open a template and put a file in there, it will appear in every single AppVM that uses that template.

This means if you want software (for example, LibreOffice) to be in your AppVM every time, you’d open the template and install it there.

But be careful. Remember that any file you put in a template will also be present in an AppVM that uses that template.

This include config files, and dot files (files that start with “.”, and usually contain configs, browser history, etc.).

This is why you don’t connect a template to the internet or do any tasks in them. The last thing you want is a cookie or authentication token inside your AppVMs because you decided to go on Facebook inside a template.

That’s asking for trouble….:expressionless:

There are some directories that are persistent in AppVMs by default, such as the home directory.

You can pick and choose what files/directories you want to be persistent like this:

It depends on what OS your template is.

Fedora = dnf
Archlinux = pacman
Debian = apt or apt-get
Gentoo = emerge
SUSE = zypper

There are others, but basically you get the idea…

Yes. Basically most Linux distros will manage and maintain their own software packages. These repos are a reflection of what values they stand for. For example, Fedora likes to keep any non-FOSS (Free and Open Source Software) software in a separate repo, and Debian usually likes to prefer software stability and security over cutting-edge new features.

If a package is in one of their repos, it means that they have audited it, validated it, and they endorse it. That’s why some repos might not have the software you’re looking for.

(obviously there are many more reasons why software may or may not be in a repo, but I’m just trying to give you a crashcourse)

That usually means that for one reason or another, they’re not endorsed by the maintainers of those repos.

You can still install them, but you likely won’t get any support (or sympathy) from the maintainers of those repos :wink:

Be prepared for a lot of people to spam you with “ARE YOU CRAZY?!?!” In response to this :yum:

Well, yes and no. It all depends on which source you trust more. Most people would trust a gigantic repo full of software that’s signed by the developers of the Linux distro…

But again, it’s entirely your choice what software you wish to run :slightly_smiling_face:

The repos are usually stored in the config files of the package manager, and you don’t have to type them in every time you update (that would be a nightmare!).

Most repos will have their own PGP keys that they use to sign their packages, as well as hashes of each package to verify that they haven’t been tampered with. The Qubes OS repos definitely do this.

Again, it all comes down to who you trust more…

I’m not actually sure whether there is one (happy for anyone to correct me on this).

If you’re super paranoid (no judgement), you can build it from source:

I did read it, and it sounds like your AppImage relies on dependencies (which kind of defeats the purpose of an AppImage…).

You shouldn’t have to extract an AppImage. It should contain everything needed to run it.

A lot of those steps you did shouldn’t be necessary…

I should clarify that it’s ok to store AppImages inside AppVMs (as long as they’re kept in a persistent directory, otherwise they’ll disappear when you shut the AppVM down).

But for an AppImage to require FUSE (non-Linux-native filesystems) doesn’t sound right….

We’ll happily try and help you out on this one, but we’ll likely need some terminal outputs posted.s

3 Likes
./file-name.AppImage --appimage-extract

…this worked like charm, thanks, i was not able to find anything regarding this case also, I had the same Tutanota app launcher situation.