How does qvm-open-in-(d)vm determine which application to open a file in?

59 views
Skip to first unread message

u+q...@bestemt.no

unread,
Apr 24, 2017, 6:28:41 PM4/24/17
to qubes...@googlegroups.com
So I've added an entry to ~/.local/share/applications/mimeapps.list in
my DispVM and opening files of the corresponding type with
qvm-open-in-dvm works just as it should (opening the files in the
desired app in a new DispVM).

But if I try to run xdg-open in a DispVM with the same file, it does not
open in the application specified in that mimeapps.list file, nor does
mimeopen reference it.

So qvm-open-in-dvm cannot use xdg-open or mimeopen. How does it
determine which application to open a file in, then?

Or: Which command opens files (in the same VM) according to the entries
in that mimeapps.list file?

Thanks in advance!

--
ubestemt

Unman

unread,
Apr 25, 2017, 9:21:16 AM4/25/17
to u+q...@bestemt.no, qubes...@googlegroups.com
I'm pretty sure this is one of those distro/desktop things, because it
works for me as expected, although you havent said what application or
filetype is concerned. Nor what Template you are using.

It works as expected on Debian and Ubuntu DVMTemplates, using xdg-mime
default ..

If you run xdg-mime query default <filetype> in a disposableVM what do you get?

unman

u+q...@bestemt.no

unread,
Apr 25, 2017, 10:17:21 AM4/25/17
to Unman, qubes...@googlegroups.com
Unman <un...@thirdeyesecurity.org> [2017-04-25 15:21 +0200]:
> I'm pretty sure this is one of those distro/desktop things, because it
> works for me as expected, although you havent said what application or
> filetype is concerned. Nor what Template you are using.

I use a debian-8 template upgraded to unstable. The problem with
xdg-open (1.1.0 rc3; xdg-tools 1.1.1-1) seems to be that it does not
read ~/.local/share/applications/mimeapps.list, regardless of filetype.

> If you run xdg-mime query default <filetype> in a disposableVM what do you get?

Interestingly running xdg-mime query default <filetype> returns the
correct application, but xdg-open still opens the file in the original
default application.

Using qvm-open-in-dvm with the same filetype from another VM opens it in
the correct application.

--
ubestemt

u+q...@bestemt.no

unread,
Apr 25, 2017, 10:45:59 AM4/25/17
to Unman, qubes...@googlegroups.com
Ok, so I did a bit of poking around.

xdg-open <file> returns:

xdg-mime: mimetype argument missing
Try 'xdg-mime --help' for more information.

Which fits with xdg-mime not being able to recognize the mimetype of
files.

This phenomenon is described in a post on Ask Ubuntu (from May 2016).
And the proposed solution is to install gvfs-bin.
https://askubuntu.com/questions/779717/xdg-open-stopped-working-since-16-04-upgrade

I did that -- and it worked! Just a shame this bug is still around after
a year (I know, others have been around for much longer).

Though I'm still wondering how qvm-open-in-dvm managed to pull it off
from the start.

Unman

unread,
Apr 25, 2017, 2:48:51 PM4/25/17
to u+q...@bestemt.no, qubes...@googlegroups.com
I'm not convinced becase my stretch works as expected without gvfs-bin,
but it is built not upgraded. gvfs-bin brings in gvfs-common, so it may
be that that's what iss required and isnt in a Jesie-upgarded system.

Andrew David Wong

unread,
Apr 30, 2017, 2:49:07 PM4/30/17
to u+q...@bestemt.no, qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I know this thread has only addressed Debian- and Ubuntu-based DVM
Templates so far, but this is a significant problem on Fedora-based
DVMs after Chromium is installed. Tracking:

https://github.com/QubesOS/qubes-issues/issues/2786

- --
Andrew David Wong (Axon)
Community Manager, Qubes OS
https://www.qubes-os.org
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJZBjGUAAoJENtN07w5UDAwlT0QAL320oBnWBC2PWsj3a1qGMLV
jpB/vk8xgwNK7HJlIKt+8KKd9uFjU3f32pPVd1jw5D4DWi/fOS6siMmr5k+/dyC5
+3ZOhoQHJ+uzapKuwwbN3IhUgKh7twbRfViwFo2pMS621fN70DU75J3G07RNt+IL
yhHeXz2a3HSP3JLJbvB9YtvBHwMUSn0P0b2UVu/fvYj1U5LhWLZo4yEH1UqFDW9j
D3fU8JrDvwJrAtMN3vMB2OD63N7PxjaCVVekzHUN3pc4w9k3ecAtTmHFMqqyXwep
0yCVC+LW43Uyq/FFGcpo8lFYNeofs8u9/k89S34sWF0lNMiWRh646BQUnU/UTs3l
H3gdW0KEknVpp0R2Lbg0aPE1fQzo5yftqeWD28272W7O2k2T0Ge9a7UGNiw6cwu6
W2QanVpUFB7wIbmFBxPYzd2YpfDtftR8dHRsgNGmqByCZTwl8K4lVUhTKYOpIXNA
SiPtxVtvkeh/J7t57zYCXNTAcjP/TSiM5T8dKv6TRaVZ9vA+Digj4R6JWG9DeXa6
bXn1iLPfK12jD/7lGluuu0ZD5o2KGCNn1Ici6e51+AhkZu40EtTbK2SJK1NjdS9H
gFV4vupBRtWqHaEQ/JTk4VX0g6moclHu6kR9smT4anli+zT6roFtMSzxUWy0WKcz
3XQeGR5mguIE/rf2i7B5
=QtaT
-----END PGP SIGNATURE-----

u+q...@bestemt.no

unread,
May 1, 2017, 4:22:31 PM5/1/17
to Unman, qubes...@googlegroups.com
Unman <un...@thirdeyesecurity.org> [2017-04-25 20:48 +0200]:
> I'm not convinced becase my stretch works as expected without gvfs-bin,
> but it is built not upgraded. gvfs-bin brings in gvfs-common, so it may
> be that that's what iss required and isnt in a Jesie-upgarded system.

It also works in debian-wheezy updated to sid. I've written a how-to:
https://github.com/QubesOS/qubes-doc/pull/379/files?short_path=83ca4e2#diff-83ca4e28de9bcee331783522a52c2bd0

--
ubestemt
Reply all
Reply to author
Forward
0 new messages