[Spice-devel] Xspice with --vdagent disables mouse

Jordan Sokolic jordan.sokolic at gmail.com
Sun Feb 12 21:51:48 UTC 2017


Hi,

I managed to solve the issue by adding the -X flag to the arguments
passed to spice-vdagentd.
After some reading up on systemd and perusing some source code I
narrowed the problem down to systemd-logind, specifically which
session it reports as the active session.
Xspice successfully launches vdagentd when running from a (non-remote)
local session after correctly identifying the active session through
systemd-logind, evidenced by the following output when spice-vdagentd
is run with -d:

---
spice-vdagentd: Active session: c25
spice-vdagentd: logind match:
type='signal',interface='org.freedesktop.login1.Session',path='/org/freedesktop/login1/session/_3c25'
spice-vdagentd: 0x55e717ef92e0 is now the active session
spice-vdagentd: (systemd-login) class for c25 is user
spice-vdagent[27774]: Screen 0 1024x768+0+0
...
spice-vdagentd: opening vdagent virtio channel
---

However, when running Xspice from a SSH session, spice-vdagentd
chooses the greeter session as the active session, not the SSH session
as expected, and vdagent extensions are unavailable (the 'opening
vdagent virtio channel' message is never displayed'). The only way
around this I have found is to disable systemd-logind integration by
running spice-vdagentd with -X.


Output of 'loginctl show-session c25' (greeter session):
---
Id=c25
User=1001
Name=jordan
...
VTNr=7
Seat=seat0
Display=:0
Remote=no
Service=lightdm
Desktop=xfce
Scope=session-c25.scope
Leader=14512
Audit=0
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
---

Output of 'loginctl show-session 7' (SSH session):
---
Id=7
User=1001
Name=jordan
...
VTNr=0
Remote=yes
RemoteHost=[remote host IP]
Service=sshd
Scope=session-7.scope
Leader=19707
Audit=33
Type=tty
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
---

My question is, why does systemd wrongly report the active session as
the greeter session running on the local display instead of the remote
session, the same one from which Xspice and all its subprocesses are
launched? How can I convince vdagent that it is the remote session I
want and not the local one? Is it perhaps because the session type is
reported as 'tty' instead of 'x11'?

Appreciate the help so far,

Jordan

On Wed, Feb 8, 2017 at 11:19 PM, Jordan Sokolic
<jordan.sokolic at gmail.com> wrote:
> Thanks for your reply Christophe. I can confirm that it's a host issue
> and not related to the remote client.
> I've since upgraded to vdagent 0.17.0 and xspice 0.1.5-3 compiled
> locally from: https://anonscm.debian.org/cgit/pkg-xorg/driver/xserver-xorg-video-qxl.git
>
> Now, I am able to run Xspice successfully with vdagent, but _only_
> when sitting directly in front of the machine!
> When running Xspice locally I see the following output:
>
> spice_vdagentd: opening vdagent virtio channel
>
> I am then able to start up any spice client on the same machine or any
> remote machine and have all vdagent features enabled.
>
> However, if I start Xspice from a SSH session as the same user, with
> exactly the same arguments, even on the same machine, the line I wrote
> above from spice_vdagentd is missing, and vdagent features are
> disabled.
>
> The only difference I can discern is the following line in xorg.log
> (may or may not be relevant):
>
> Local:
> [ 11345.054] (II) config/udev: Adding drm device (/dev/dri/card0)
> [ 11345.054] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 18 paused 1
> [ 11345.054] (EE) Error systemd-logind returned paused fd for drm node
> [ 11345.054] (II) systemd-logind: releasing fd for 226:0
>
> SSH:
> [ 16438.417] (II) xfree86: Adding drm device (/dev/dri/card0)
> [ 16438.418] (EE) systemd-logind: failed to take device
> /dev/dri/card0: Operation not permitted
> [ 16438.418] (EE) /dev/dri/card0: failed to set DRM interface version
> 1.4: Permission denied
>
> Otherwise the logs are identical.
>
> Invoking Xspice from the SSH session still creates vdagent
> subprocesses, all the pipes and sockets are in the right place, etc.
>
> Thank you,
> J
>
> On Wed, Feb 8, 2017 at 5:13 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
>> On Sat, Feb 04, 2017 at 11:55:48PM +0200, Jordan Sokolic wrote:
>>> Hello all,
>>>
>>> I've recently begun using Xspice as a remote desktop solution. I'm
>>> finding its performance to be greatly superior to VNC, RDP or others.
>>> Nice!
>>> I wrote a small wrapper script that launches Xspice on a remote
>>> machine with the following arguments:
>>>
>>>     Xspice  --auto --disable-ticketing --deferred-fps 30
>>> --audio-fifo-dir $AUDIO_FIFO_DIR --xsession startxfce4 :1
>>>
>>> All works well, however I am unable to get vdagent working for
>>> clipboard redirection. What happens instead is no cursor appears in
>>> the remote session, and mouse input is ignored. Only keyboard input
>>> still works.
>>> When I add the --vdagent argument, I see that two additional
>>> subprocesses are started:
>>>
>>>     $ ps -ef | grep Xspice
>>>
>>> jordan   17426 17404  0 22:52 pts/2    00:00:00
>>> /usr/sbin/spice-vdagentd -f -x -S /tmp/xspice-vdagent -s
>>> /tmp/xspice-virtio -u /tmp/xspice-uinput
>>> jordan   17436 17404  0 22:52 pts/2    00:00:00 /usr/bin/spice-vdagent
>>> -x -s /tmp/xspice-virtio -S /tmp/xspice-vdagent
>>>
>>> confirmation that the agent pipes and sockets are created successfully:
>>>     $ ls -la  /tmp | grep xspice-
>>>
>>> prw-r--r--  1 jordan jordan     0 Feb  4 23:43 xspice-uinput
>>> srw-rw-rw-  1 jordan jordan     0 Feb  4 23:43 xspice-vdagent
>>> srwxr-xr-x  1 jordan jordan     0 Feb  4 23:43 xspice-virtio
>>>
>>> I tried running with '--xsession xterm' and got the same results, so
>>> it appears unrelated to XFCE or any of my startup applications.
>>>
>>> (possibly) relevant details:
>>>
>>> * remote machine: Ubuntu 16.04 amd64
>>>     * spice-vdagent 0.17.0-1
>>>     * xserver-xspice 0.1.4-3ubuntu3
>>> * local machine: Xubuntu 16.04 amd64
>>>     * virt-viewer 1.0-1
>>>
>>> Any help would be greatly appreciated.
>>
>> Hey, not really a huge help, but with a remote/local f25, I do not have
>> mouse issues using the same command-line as you did and --xsession
>> xterm. Maybe you can try to boot from a fedora 25 live cd (and install
>> virt-viewer if needed) to check whether that's a client-side or remote
>> issue? virt-viewer 1.0 is 2.5 years old at this point.
>>
>> Christophe


More information about the Spice-devel mailing list