Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upOpen in DispVM doesn't work for PDF files #1621
Comments
rootkovska
added
bug
C: core
labels
Jan 14, 2016
rootkovska
added this to the Release 3.1 milestone
Jan 14, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Confirmed. Does not work for me in Debian based DispVMs either.
|
rootkovska
added
the
P: major
label
Jan 15, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 17, 2016
Member
It looks to be two separate issues for Debian and Fedora
Fedora
The default application is evince-previewer (aka "Print Preview"), which fails with:
$ mimeopen -n test.pdf
Opening "test.pdf" with Print Preview (application/pdf)
Filename "file:///home/user/test.pdf" does not exist or is not a regular file
Probably we should somehow blacklist evince-previewer, or sth (we can't uninstall it as it is the same package as actual evince)
Debian
There is no PDF viewer installed at all. evince weight 10MB. Probably worth it, to have this basic functionality...
|
It looks to be two separate issues for Debian and Fedora FedoraThe default application is
Probably we should somehow blacklist DebianThere is no PDF viewer installed at all. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 17, 2016
Member
And BTW, after installing evince in Debian template, it fails the same way as in Fedora...
|
And BTW, after installing |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Jan 17, 2016
Member
I have some minimal experience with default applications and mime types on Debian.
- https://github.com/Whonix/tb-default-browser
- https://github.com/Whonix/tb-default-browser/blob/master/debian/tb-default-browser.mime
- https://github.com/Whonix/tb-default-browser/blob/master/debian/tb-default-browser.menu
- Whonix/tb-starter@064fedc
- Whonix/tb-starter@e6d005a
- The file that matters is
/usr/share/applications/mimeinfo.cache. cat /usr/share/applications/mimeinfo.cache | grep pdf
|
I have some minimal experience with default applications and mime types on Debian.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Jan 17, 2016
Member
Luckily mime priority looks good. (Otherwise increasing the mime priority would not be trivial as writing to /usr/share/applications/mimeinfo.cache directly would perhaps not be a clean/robust solution.)
Is there any reason to stick to mimeopen? After installing evince on debian, xdg-open /path/to/some/file.pdf worked for me, opened the file in evince.
|
Luckily mime priority looks good. (Otherwise increasing the mime priority would not be trivial as writing to Is there any reason to stick to |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 17, 2016
Member
I remember we've considered it in the past and it fixes some issues, while introducing others. The only thing I can find about it in issues is here: #66
Anyway if xdg-open works for more cases than mimeopen, I think it may be good idea to switch.
|
I remember we've considered it in the past and it fixes some issues, while introducing others. The only thing I can find about it in issues is here: #66 Anyway if |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Jan 17, 2016
Member
Interestingly, see what xdg-open, which is a shell script, is just doing.
bash -x xdg-open /path/to/file.pdf
It internally uses mimeopen. But it works better. Somehow.
|
Interestingly, see what xdg-open, which is a shell script, is just doing. bash -x xdg-open /path/to/file.pdf It internally uses mimeopen. But it works better. Somehow. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 17, 2016
Member
Ok, I've tried on fresh R3.1-rc2 install, Debian template:
- At first (after installing
xdg-utils) it fails withgnome-open: not found. Apparently because of QubesOS/qubes-gui-agent-linux@524fb45 - When unset
GNOME_DESKTOP_SESSION_ID, it callsmimeopen, which then callsevince-previewer(instead ofevince), at first it fails withFilename file:///home/user/test.pdf" does not exist or is not a regular file, but for some reason then it displays the pdf then.
On Fedora template, indeed it opens PDF using evince.
Test cases which were problematic in the past:
- doc
- pptx
- png
- jpg (
.jpgand .jpeg`) - txt (yes, really!)
|
Ok, I've tried on fresh R3.1-rc2 install, Debian template:
On Fedora template, indeed it opens PDF using Test cases which were problematic in the past:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 22, 2016
Member
Solved mystery of mimeopen (but not the problem itself). Default application is chosen based on:
$HOME/.local/share/applications/defaults.list(if present)- order of entries in
/usr/share/applications/mimeinfo.cachefor a given file type (first one wins)
There is no support for any global defaults list (like /usr/share/applications/defaults.list). mimeinfo.cache is generated by update-desktop-database tool, order of entries for a given mime type depends on... order of files in the filesystem.
This isn't the first time we have such problem with mimeopen: #423
Lets consider switching to some other tool (xdg-open) again. It is basically a wrapper for different tools for opening files, the algorithm is:
- If some specific desktop environment is detected, use a tool specific to that environment (
gvfs-open/gnome-open,kde-open,exo-open,enlightenment_open, etc) - Otherwise, try the following tools, in order:
xdg-mime query default(uses/usr/share/applications/mimeapps.list- another file with preferred applications, then fallbacks todefaults.list- handle both user home and global one in/usr/share/applications)run-mailcapmimeopen(Debianxdg-utilspackage has a patch to prefermimeopenoverrun-mailcap)
This results is:
- Fedora:
- in default install uses
gvfs-open, which correctly usesevince - after unsetting
$GNOME_DESKTOP_SESSION_ID- usesxdg-mime query defaultandmimeapps.listdoes containevince.desktopforapplication/pdfso it is used
- in default install uses
- Debian:
- by default tries to call
gvfs-open, thengnome-open- none of them are installed, so it fails (BTWxdg-utils-1.1.1has a fallback to generic open in that case, but Debian package is too old for that) - after unsetting
$GNOME_DESKTOP_SESSION_ID:- tries
xdg-mime query default, but none is set - calls
mimeopen- which fails (the original problem reported in this ticket - usage ofevince-previewerinstead ofevince) - finally calls
run-mailcap, which properly callsevince
- tries
- by default tries to call
All of this looks like a big mess... And that is only for PDF, haven't checked other file types.
This is probably the worst time for switching to another tool here, but not sure if some ugly workaround would be better (like messing with defaults.list in user home directory)? Or maybe I'm missing something?
Some other option would be writing own tool for that (which probably would use xdg-mime). But I doubt we are smart enough to cover all the corner cases (apparently lots of people failed here). I guess it would be rather just another buggy tool...
|
Solved mystery of
There is no support for any global defaults list (like This isn't the first time we have such problem with Lets consider switching to some other tool (
This results is:
All of this looks like a big mess... And that is only for PDF, haven't checked other file types. This is probably the worst time for switching to another tool here, but not sure if some ugly workaround would be better (like messing with Some other option would be writing own tool for that (which probably would use |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Jan 23, 2016
Member
I think the only way to do-this-right(tm) [without opening up for
maintenance hell and new issues] is to report these issues upstream in
generic terms. Then either waiting or applying their patches.
|
I think the only way to do-this-right(tm) [without opening up for |
marmarek
referenced this issue
Jan 23, 2016
Closed
double terminals shortcuts with one right click #1670
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 25, 2016
Member
Apparently mimeapps.list is a standard: http://standards.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html
Regarding global preferences in mimeopen: mbeijen/File-MimeInfo#20
There is also a bug about using mimeapps.list instead of non-standard defaults.list (mbeijen/File-MimeInfo#8), but apparently it is already implemented (in libxml branch, not master yet).
In Fedora those problems would be solved by switching to xdg-open, which use xdg-mime (so mimeapps.list, including global one), even in case of $GNOME_DESKTOP_SESSION_ID being set but no gvfs-open installed (for example in minimal template).
Regarding Debian problems - almost all of them (besides above mimeopen issue) are solved in xdg-utils-1.1.1, while Debian 8 have xdg-utils-1.1.0-rc1 (so not even 1.1.0 as I thought). AFAIR Debian policy forbids package updates other than security fixes in stable release, am I right @adrelanos ? In that case there is no way to fix the issue in Debian, other than some local workaround, or maintaining xdg-utils backport (both options are not great). Debian 9 (stretch) already have xdg-utils-1.1.1. But obviously waiting for it (with R3.1 stable release) is not an option.
|
Apparently Regarding global preferences in In Fedora those problems would be solved by switching to Regarding Debian problems - almost all of them (besides above |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Jan 25, 2016
Member
Marek Marczykowski-Górecki:
AFAIR
Debian policy forbids package updates other than security fixes in
stable release, am I right @adrelanos ?
Right. [For completeness sake: There might have been an exception
sometime somehwere irrc packages that are otherwise not maintainable -
namely iceweasel or so. But no hope for this case.]
|
Marek Marczykowski-Górecki:
Right. [For completeness sake: There might have been an exception |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 25, 2016
Member
Hmm, what about creating qubes-open script which would call appropriate tool (like mimeopen or xdg-open)? Having it as a script, instead of hardcoded into /usr/lib/qubes/vm-file-editor (binary program) would make it much easier to customize and test new solutions. Or even different implementations for different distributions.
|
Hmm, what about creating |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Jan 26, 2016
Member
Yes. Wondering, why /usr/lib/qubes/vm-file-editor is a compiled program
anyhow?
|
Yes. Wondering, why /usr/lib/qubes/vm-file-editor is a compiled program |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 26, 2016
Member
Wondering, why /usr/lib/qubes/vm-file-editor is a compiled program anyhow?
To handle qfile-format input stream (binary header, no need to parse anything, just load into struct and use). Probably also possible in python or such, but not sure if easier.
To handle qfile-format input stream (binary header, no need to parse anything, just load into struct and use). Probably also possible in python or such, but not sure if easier. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 26, 2016
Member
Hmm, actually here is only simplified version of that protocol (just filename, without file attributes). @woju what do you think about converting it into python script (in R4.0)?
|
Hmm, actually here is only simplified version of that protocol (just filename, without file attributes). @woju what do you think about converting it into python script (in R4.0)? |
added a commit
to marmarek/old-qubes-core-admin
that referenced
this issue
Jan 29, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jan 29, 2016
Member
Created some tests for opening different file types. Two types of failures:
- Really not installed applications (intentional):
- Debian: no PDF viewer, no LibreOffice
- Fedora: no LibreOffice (
docandpptxfails)- Wrong application chosen/failed to open file at all:
- Debian:
txtopened with LibreOffice (when installed) - overkill? ; fail to openpdf - Fedora - fail to open
txtandpdfviaqvm-open-in-vmbut succeed viaqvm-open-in-dvm(?!)
There are some minor differences between versions - for example in Debian 7 template opening txt files works properly, in one of Fedora 23 templates all is ok. Those templates are not exactly clean R3.1 install (some of them are upgraded from R3.0).
|
Created some tests for opening different file types. Two types of failures:
There are some minor differences between versions - for example in Debian 7 template opening |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 2, 2016
Member
xdg-open solves some of the problems with qvm-open-in-vm (non-DisposableVM), but completely breaks qvm-open-in-dvm (DisposableVM). Generally because it doesn't wait for the editor to finish. So when xdg-open exits, it doesn't mean user has closed the editor. But after "editor process" (which is xdg-open in this case) is terminated, DisposableVM is destroyed.
This is somehow generic problem with things like D-Bus activation (used by gvfs-open called from xdg-open here). It affects also some other use cases (email client removes temporary saved attachment file after viewer app is closed):
- https://bugzilla.redhat.com/show_bug.cgi?id=653249
- https://bugzilla.gnome.org/show_bug.cgi?id=652262
There is workaround for this is in the first link - set DE=generic to not use any environment-specific tool (even when available) and force usage of xdg-mime and application call directly from xdg-open. Generally it works - the only failure I've got then, is opening txt with LibreOffice. I think it shouldn't be even considered a failure.
But the problem will return, once more and more applications will use D-Bus activation. The issue is already discussed in the second link - an API for notification about application close. But the discussion stalled about a year ago...
|
This is somehow generic problem with things like D-Bus activation (used by
There is workaround for this is in the first link - set But the problem will return, once more and more applications will use D-Bus activation. The issue is already discussed in the second link - an API for notification about application close. But the discussion stalled about a year ago... |
added a commit
to marmarek/old-qubes-core-agent-linux
that referenced
this issue
Feb 2, 2016
marmarek
closed this
in
marmarek/old-qubes-core-agent-linux@dca5265
Feb 2, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 8, 2016
Member
Automated announcement from builder-github
The package python2-dnf-plugins-qubes-hooks-3.1.13-1.fc21 has been pushed to the r3.1 testing repository for the Fedora fc21 template.
To test this update, please install it with the following command:
sudo yum update --enablerepo=qubes-vm-r3.1-current-testing
|
Automated announcement from builder-github The package
|
marmarek
added
the
r3.1-fc21-cur-test
label
Feb 8, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 8, 2016
Member
Automated announcement from builder-github
The package python2-dnf-plugins-qubes-hooks-3.1.13-1.fc22 has been pushed to the r3.1 testing repository for the Fedora fc22 template.
To test this update, please install it with the following command:
sudo yum update --enablerepo=qubes-vm-r3.1-current-testing
|
Automated announcement from builder-github The package
|
marmarek
added
the
r3.1-fc22-cur-test
label
Feb 8, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 8, 2016
Member
Automated announcement from builder-github
The package python2-dnf-plugins-qubes-hooks-3.1.13-1.fc23 has been pushed to the r3.1 testing repository for the Fedora fc23 template.
To test this update, please install it with the following command:
sudo yum update --enablerepo=qubes-vm-r3.1-current-testing
|
Automated announcement from builder-github The package
|
marmarek
added
the
r3.1-fc23-cur-test
label
Feb 8, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 11, 2016
Member
Automated announcement from builder-github
The package qubes-core-agent_3.1.13-1+deb8u1 has been pushed to the r3.1 testing repository for the Debian jessie template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing jessie-testing, then use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
|
Automated announcement from builder-github The package
|
marmarek
added
the
r3.1-jessie-cur-test
label
Feb 11, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 11, 2016
Member
Automated announcement from builder-github
The package qubes-core-agent_3.1.13-1+deb9u1 has been pushed to the r3.1 testing repository for the Debian stretch template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing stretch-testing, then use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
|
Automated announcement from builder-github The package
|
marmarek
added
the
r3.1-stretch-cur-test
label
Feb 11, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 11, 2016
Member
Automated announcement from builder-github
The package qubes-core-agent_3.1.13-1+deb7u1 has been pushed to the r3.1 testing repository for the Debian wheezy template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing wheezy-testing, then use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
|
Automated announcement from builder-github The package
|
marmarek
added
the
r3.1-wheezy-cur-test
label
Feb 11, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 22, 2016
Member
Automated announcement from builder-github
The package python2-dnf-plugins-qubes-hooks-3.1.13-1.fc21 has been pushed to the r3.1 stable repository for the Fedora fc21 template.
To install this update, please use the standard update command:
sudo yum update
|
Automated announcement from builder-github The package
|
marmarek
added
r3.1-fc21-stable
and removed
r3.1-fc21-cur-test
labels
Feb 22, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 22, 2016
Member
Automated announcement from builder-github
The package python2-dnf-plugins-qubes-hooks-3.1.13-1.fc22 has been pushed to the r3.1 stable repository for the Fedora fc22 template.
To install this update, please use the standard update command:
sudo yum update
|
Automated announcement from builder-github The package
|
marmarek
added
r3.1-fc22-stable
and removed
r3.1-fc22-cur-test
labels
Feb 22, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 22, 2016
Member
Automated announcement from builder-github
The package python2-dnf-plugins-qubes-hooks-3.1.13-1.fc23 has been pushed to the r3.1 stable repository for the Fedora fc23 template.
To install this update, please use the standard update command:
sudo yum update
|
Automated announcement from builder-github The package
|
marmarek
added
r3.1-fc23-stable
and removed
r3.1-fc23-cur-test
labels
Feb 22, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 22, 2016
Member
Automated announcement from builder-github
The package qubes-core-agent_3.1.13-1+deb8u1 has been pushed to the r3.1 stable repository for the Debian jessie template.
To install this update, please use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
|
Automated announcement from builder-github The package
|
marmarek
added
r3.1-jessie-stable
and removed
r3.1-jessie-cur-test
labels
Feb 22, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 22, 2016
Member
Automated announcement from builder-github
The package qubes-core-agent_3.1.13-1+deb9u1 has been pushed to the r3.1 stable repository for the Debian stretch template.
To install this update, please use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
|
Automated announcement from builder-github The package
|
marmarek
added
r3.1-stretch-stable
and removed
r3.1-stretch-cur-test
labels
Feb 22, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 22, 2016
Member
Automated announcement from builder-github
The package qubes-core-agent_3.1.13-1+deb7u1 has been pushed to the r3.1 stable repository for the Debian wheezy template.
To install this update, please use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
|
Automated announcement from builder-github The package
|
marmarek
added
r3.1-wheezy-stable
and removed
r3.1-wheezy-cur-test
labels
Feb 22, 2016
added a commit
to QubesOS/qubes-core-admin
that referenced
this issue
Feb 29, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
unman
May 21, 2016
Member
@marmarek
I've just pulled down and installed the fedora-23 template and it is still showing this behavior. That template has version 3.0.4-201601120722, so I guess the repo needs to be refreshed.
|
@marmarek |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@unman did you installed updates after fetching that template? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
unman
May 31, 2016
Member
@marmarek No - my point is that it seems strange that the repo doesn't have an up to date template incorporating fixes, and that one has to do an immediate update. (Yes, installing the updates fixes the issue.)
|
@marmarek No - my point is that it seems strange that the repo doesn't have an up to date template incorporating fixes, and that one has to do an immediate update. (Yes, installing the updates fixes the issue.) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
May 31, 2016
Member
This isn't anything strange - it is exactly the same with any other Linux distribution, or even different OS (like Windows) - when you install OS, you get package versions from the time of release, even if it is a year(s) ago.
|
This isn't anything strange - it is exactly the same with any other Linux distribution, or even different OS (like Windows) - when you install OS, you get package versions from the time of release, even if it is a year(s) ago. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
unman
May 31, 2016
Member
I understand this, of course. But this is a package in the repository and people who get it from there would expect it to be more up to date imo. That is, they wouldn't expect the repository to hold out of date packages, and the templates are just packages.
Not a big issue though.
|
I understand this, of course. But this is a package in the repository and people who get it from there would expect it to be more up to date imo. That is, they wouldn't expect the repository to hold out of date packages, and the templates are just packages. |
rootkovska commentedJan 14, 2016
It works for many other files. But when sending a PDF to open I'm consistently getting an error about not being able to find the proper MIME handler. My DispVM is based on fc23. Fresh 3.1-rc2.