How to run Spice Agent: Difference between revisions

From Alpine Linux
(Created page with "=How To Run Spice Agent in Alpine= This is a guide on how to run Spice Agent in Alpine Linux 3.12.1-standard. The Spice Agent can be used to get some additional features wh...")
 
No edit summary
Line 20: Line 20:
=Before You Start=
=Before You Start=
Most features of the Spice Agent are only useful when running a graphical interface.
Most features of the Spice Agent are only useful when running a graphical interface.
I roughly followed the (TODO: LINK TO AWESOME SETUP GUIDE) guide, but substituted <code>awesome</code> with <code>i3wm</code> as that has my preference (you have to install <code>i3status</code> manually, and use <code>i3</code> in the <code>.xinitrc</code> file).
I roughly followed the [[Awesome(wm)_Setup]] guide, but substituted <code>awesome</code> with <code>i3wm</code> as that has my preference (you have to install <code>i3status</code> manually, and use <code>i3</code> in the <code>.xinitrc</code> file).


For the Spice Agent to work, don't remove the <code>Channel spice</code> that is automatically added by Libvirt.
For the Spice Agent to work, don't remove the <code>Channel spice</code> that is automatically added by Libvirt.

Revision as of 14:22, 1 November 2020

How To Run Spice Agent in Alpine

This is a guide on how to run Spice Agent in Alpine Linux 3.12.1-standard.

The Spice Agent can be used to get some additional features when running Alpine Linux in a Qemu/Libvirt VM.

Features

Working:

  • Client mouse mode
  • Automatic adjustment of the X-session resolution
  • Clipboard sharing

Not working:

  • The State field in Libvirt - it always shows "disconnected", even when it is working

Not tested:

  • Transferring files
  • Multiple displays/screens

Before You Start

Most features of the Spice Agent are only useful when running a graphical interface. I roughly followed the Awesome(wm)_Setup guide, but substituted awesome with i3wm as that has my preference (you have to install i3status manually, and use i3 in the .xinitrc file).

For the Spice Agent to work, don't remove the Channel spice that is automatically added by Libvirt.

Building the Spice Agent

Install the dependencies:

 # apk add alpine-sdk autoconf automake glib-dev libxfixes-dev libxrandr-dev libxinerama-dev spice-protocol alsa-lib-dev dbus-dev libdrm-dev libpciaccess-dev

Get the source code:

 $ git clone (TODO: LINK TO VDAGENT GIT ON FREEDESKTOP GITLAB)
 $ cd vd_agent
 $ git checkout spice-vdagent-0.20.0

We need this specific version because the newest version requires a newer spice-protocol version than is provided by the repositories (version 0.14.1). If you follow this guide with a later version of Alpine, you may want to get a newer version from git as well.

Build the code (still in the vd_agent directory):

 $ ./autogen.sh
 $ make

Install the program (should be optional, but I haven't tried it without yet):

 # make install


Running the Spice Agent

This material is work-in-progress ...

While this works, it's very rough and the steps need to be performed every time you want to run it. It would be nice to have init scripts to do this.
(Last edited by MartinJM on 1 Nov 2020.)

First start the spice-vdagentd:

 # modprobe uinput
 # mkdir /run/spice-vdagentd
 # spice-vdagentd -d -x -X

You can also remove the lower-case -x flag to deamonize the spice-vdagentd.

Then start the spice-vdagent:

 $ spice-vdagent -x -d

Notice that there is no need to run this last command as root.

Using the virt edition of Alpine

This currently does not work on the virt edition (version 3.12.1), as it doesn't have the uinput module enabled in the kernel.

You can still make the spice-vdagentd work by starting it as follows, but it will disable the cursor while the spice-vdagent is running:

 # mkdir /run/spice-vdagentd
 # spice-vdagentd -d -x -X -u /dev/null -f