Bug 1122447

Summary: xdg-open cannot open virt-viewer connection file with right application over ssh
Product: Red Hat Enterprise Linux 7 Reporter: CongDong <codong>
Component: xdg-utilsAssignee: Alexander Larsson <alexl>
Status: CLOSED NOTABUG QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: codong, juzhou, lcui, mzhan, tzheng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1134653 (view as bug list) Environment:
Last Closed: 2014-08-29 08:16:00 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:    
Bug Blocks: 1134653    

Description CongDong 2014-07-23 09:43:16 UTC
Description of problem:
when login the host over ssh, xdg-open cannot open virt-viewer connection with right application(remote-viewer)

Version-Release number of selected component (if applicable):
xdg-utils-1.1.0-0.16.20120809git.el7.noarch
virt-viewer-0.6.0-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start a spice guest with qxl on host A
# virsh dumpxml $guest_name
...
    <graphics type='spice' port='5901' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
...
    <video>
      <model type='qxl' ram='65536' vram='65536' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
...
2. Prepare a connection file for the guest:
# cat console.vv
[virt-viewer]
host=$host_A_ip
port=5901
type=spice
3. open console.vv with xdg-open
#xdg-open console.vv
4. login host A on another host B over ssh, and try to open consolve.vv with xdg-open
# ssh root@$host_A_ip -X
# xdg-open console.vv

Actual results:
Step3, a remote-viewer window comes out and connect the guest, this is expected.
Step4, the file console.vv is opened by gedit, this is not right.

Expected results:
Step4, the file should not be opened by gedit, remote-viewer should connect the guest.

Additional info:

Comment 2 Alexander Larsson 2014-08-29 08:16:00 UTC
As in bug 1134653, this works as "expected". xdg-open is really a desktop environment tool, it will not work in a "raw" ssh login. You can either directly use whatever desktop-specific open too you want, or you can set/forward the right environment variables from your source desktop machine into the ssh session so that the right environment is picked up.

Picking different default applications for a file for different desktop environments is "works as intended".