Opening files with a disposable results in infinite loop or nothing

Hi everyone,

I’m experiencing an issue with my fedora-minimal disposable VM (dvm) template. When I try to open a PDF or text file within a dvm created from this template, it attempts to launch another dvm within the existing one. This new dvm then immediately shuts down. This behavior doesn’t occur when using the default default-dvm template.

I’ve checked the policies, but I haven’t identified anything that would cause this. Running the command from the command line doesn’t provide any error messages or useful output.

Here’s another breakdown of the specific behavior when opening a PDF:

  1. A dispVM starts up based on my minimal template.
  2. A dialog box appears, asking: “Are you sure you want to create another disposable VM?”
  3. If I click “Yes,” another dispVM starts, and the same question is repeated, creating an infinite loop.
  4. If I click “No,” all opened dispVMs shut down, and the file doesn’t open.

Am I missing a crucial configuration step or policy setting for my minimal dvm template? Any help would be greatly appreciated!

Disposable VM Template Setups

On a slightly different note, I’m curious about how others are setting up their dvm templates. I’m considering an “offline” and “online” dvm template setup, but I’d love to hear about different approaches and best practices from the community. What kind of dvm template setups are you using, and why?

If it helps, it happens with me too starting recently, and I am too annoyed. Just when I setup all separate dispvms for different types of files (I wrote about that as a concept), it worked perfectly and then it started to happen. If I manually copy to a manually started dispvm and manually open the file, it works. I’ve witnessed so many regressions recently… Huge letdown

What is the default application used to open a PDF or a text file in the misbehaving disposable template (or in your disposable based on it)? You can use these commands:

xdg-mime query default text/plain
xdg-mime query default application/pdf

It doesn’t matter. I set browser to be default, and it worked And it works manually, but not when you call it from the vm where the file resides.

For text/plain, my fedora-minimal dispvm template reports
qvm-open-in-dvm.desktop
On the default-dvm
geany.desktop

For PDF it reports on both the following:
org.gnome.Evince.desktop

Ok, so let’s try to fix this first. In the disposable template, change the default application for text files, either with xdg-mime or a graphical method. Is the opening of text files still a problem?

When I open a plain text file, Mousepad launches instead of Geany on the default-dvm. So I don’t think it’s the issue of xdg-mine.

I also apologize for any confusion, the disposable VMs do start up, but the issue is that the program doesn’t appear and quickly shuts down, or an infinite loop happens with the PDF’s.

1 Like

Thanks for the details, I was indeed wrong. I think qvm-open-in-vm doesn’t honor the user’s mimeapps.list file edited my xdg-mime. Maybe you can try to edit /usr/local/share/applications/mimeapps.list in the disposable template?

I couldn’t find this file in either the default-dvm or fedora-minimal dispvm templates. Does it exist on your end, or did you set it up yourself?

I wasn’t clear: mimeapps.list is the file in charge of the default app used to open a file:

Users, system administrators, application vendors and distributions can change associations between applications and mimetypes by writing into a file called mimeapps.list.

I think that when using xdg-mime you edit this file, but in the user dirs. So check $HOME/.local/share/applications/mimeapps.list. The system-wide associations are stored in /usr/share/applications.list. I believe that you have to create /usr/local/share/applications/mimeapps.list by copying one of these files here. There might be other file locations, I’m not sure…

Is there a GUI application that does this? Seems way too complicated, I’ll do some deeper research.

I believe that you can do all of this using a file manager. Just check the content of the user’s mimeapps.list file to be sure.

It’s so weird because the .pdf default is set to gnome evince inside /usr/local/share/applications/mimeapps.list but than it launches Atril document viewer. For both of the dvm templates.

This doesn’t exist on both of the templates.

This doesn’t either, but there is a folder called applications with mimeapps.list

/usr/local/share/applications/mimeapps.list So I’ll have to create a mimeapps.list? inside that folder? But that’s weird because the default one just works without any modificiations where does it get it’s default applications from? Despite launching something else than noted Atril document viewer instead of gnome evince

It worked!

I created the following
/usr/local/share/applications/mimeapps.list
Added the an entry for atril.desktop as pdf as described in /usr/share/applications.list and than copied atril.desktop with it to /usr/local/share/applications/ Why is there a system-wide association and a local one? And why does it work out of box for default-dvm?

Great! I was about to send you this, ahah:

Honestly, I’m not sure I’m helping you right now :smiling_face_with_tear: I thought it will be a quick test, but we raised more questions than answers… And I’m not sure it will work!

So, of course, I mistyped /usr/share/applications/mimeapps.list.

To answer your new questions:

I guess it was thought for a multi-user fedora, not for a Qubes OS template?

What did you do with the disposable template and/or the actual template (fedora-minimal) of this disposable template? I still don’t understand why this works…

To be honest I touched nothing it didn’t work out of box as it did with the default-dvm, the fedora minimal template (I am assuming because its minimal it doesn’t work that it needs some configruation?) But I don’t know it has to be tested on the fedora templates. I have another issue which might solve it like this one too.

By doing xdg-mime query default application/pdf

I get the default output in /usr/share/applications/mimelist.apps

You can override those in usr/local/share/applications

as stated here XDG MIME Applications - ArchWiki

The locations might not be correct because its arch linux but it should give you an indicitation on how and what, still no idea how QubesOS templates have done this. The default-dvm is based on xfce, maybe that’s the default for XFCE? when I open a text file inside default-dvm mousepad launches which is a default for xfce.

Also there are other files inside /usr/share/applications/. Such as gnome-mimeapps.list defaults.list etc…

Unfortunately, didn’t solve the Gajim issue. Don’t know if it’s because debian.