Bug 1063238

Summary: remote-viewer not invoked from "xdg-open console.vv" command
Product: Red Hat Enterprise Linux 6 Reporter: Christophe Fergeau <cfergeau>
Component: virt-viewerAssignee: Christophe Fergeau <cfergeau>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.6CC: agajania, berrange, cfergeau, codong, dblechte, dyuan, lcui, marcandre.lureau, mzhan, rbalakri, tzheng, zsong
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-viewer-0.6.0-7.el6 Doc Type: Bug Fix
Doc Text:
Cause: Install virt-viewer and attempt to open a SPICE console in Native Mode. Consequence: The client is not associated with the file MIME type. Fix: Rebuild mime type database during installation. Result: The client is associated with the file MIME type and the session can be opened with remote-viewer easily.
Story Points: ---
Clone Of: 1044209 Environment:
Last Closed: 2014-10-14 06:30:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1110630    
Bug Blocks:    

Description Christophe Fergeau 2014-02-10 10:46:48 UTC
+++ This bug was initially created as a clone of Bug #1044209 +++

Description of problem:

I have noticed that remote-viewer isn't getting automatically run when I try to bring up a virtual desktop from the RHEV User Portal with the Epiphany web browser.  Instead, the downloaded vv file is opened in gedit.

I have found that when I run the following command, the console.vv file gets opened in gedit instead of remote-viewer.

xdg-open console.vv


Version-Release number of selected component (if applicable):
virt-viewer-0.5.7-1.fc20.x86_64


How reproducible:  
Happens every time.


Steps to Reproduce:
1.  Download a console.vv file from the RHEV User Portal by attempting to open a SPICE console in Native Mode.
2.  Run the command "xdg-open console.vv" on the file that was just downloaded.


Actual results:
The console.vv file is opened with gedit.


Expected results:
The console.vv file should be opened with remote-viewer.

--- Additional comment from Aram Agajanian on 2013-12-17 18:04:39 EST ---

As was suggested on IRC, I ran the following command and the problem went away.

su -c "update-mime-database /usr/share/mime"

--- Additional comment from Christophe Fergeau on 2013-12-18 05:18:03 EST ---

Sent patch upstream 
https://www.redhat.com/archives/virt-tools-list/2013-December/msg00036.html

Comment 3 CongDong 2014-06-09 02:15:34 UTC
I test with virt-viewer-0.6.0-5.el6.x86_64

Steps:
1. Install a spice guest on rhevm
2. Click "Console" button and download the console.vv file for the guest
3. # xdg-open console.vv

Result:
I have two Desktop environment on my machine, gnome and kde
When I log in kde desktop, console.vv can be opend with remote-viewer,
but when I log in gnome desktop, the vv file is opened by gedit.

The result seems not to be the expected.

Comment 4 Marc-Andre Lureau 2014-06-09 11:36:00 UTC
Christophe, can you take a look? thanks

Comment 5 Christophe Fergeau 2014-06-10 12:52:00 UTC
What is the output of
xdg-mime query filetype console.vv
?
(if you are running this through ssh, set GNOME_DESKTOP_SESSION_ID=this-is-deprecated in your environment before running this command)

If this returns application/x-virt-viewer I think what is missing is the call to update-desktop-database added in https://git.fedorahosted.org/cgit/virt-viewer.git/commit/?id=be3ce01096feaca7d3a51ed07cc35b5b2a87633d

If the 'xdg-mime query filetype console.vv' test returned application-x-virt-viewer but 'xdg-open console.vv' is still not working, can you try running as root
update-desktop-database -q /usr/share/applications
and then try again to run 'xdg-open console.vv'?

Comment 6 CongDong 2014-06-11 02:23:36 UTC
Steps:
1. # xdg-mime query filetype console.vv
application/x-virt-viewer
2. # xdg-open console.vv
Still open with gedit
3. # update-desktop-database -q /usr/share/applications
4. # xdg-open console.vv
Open the vv file with remote-viewer.
This is expected.

Comment 7 Christophe Fergeau 2014-06-11 11:54:39 UTC
Thanks for the additional testing, this should be fixed with the next virt-viewer build.

Comment 8 Christophe Fergeau 2014-06-18 08:40:04 UTC
*** Bug 1110630 has been marked as a duplicate of this bug. ***

Comment 9 CongDong 2014-06-18 12:20:40 UTC

Verify with virt-viewer-0.6.0-7.el6.x86_64
Steps:
1. Download the vv file for the guest on rhevm
2. # xdg-mime query filetype console.vv
3. # xdg-open console.vv

Result:
Step2, 
application/x-virt-viewer
Step3,
Open the vv file with remote-viewer.

Also tested with KDE destop.

As the result, VERIFIED

Comment 10 Marc-Andre Lureau 2014-06-18 17:18:55 UTC
*** Bug 1110630 has been marked as a duplicate of this bug. ***

Comment 14 errata-xmlrpc 2014-10-14 06:30:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1379.html