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):
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'/>
<model type='qxl' ram='65536' vram='65536' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
2. Prepare a connection file for the guest:
# cat console.vv
3. open console.vv with xdg-open
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
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.
Step4, the file should not be opened by gedit, remote-viewer should connect the guest.
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".