<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MartinJM</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MartinJM"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/MartinJM"/>
	<updated>2026-05-05T22:20:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18637</id>
		<title>How to run Spice Agent</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18637"/>
		<updated>2021-02-08T15:44:06Z</updated>

		<summary type="html">&lt;p&gt;MartinJM: Added information on autostarting spice-vdagent instead of just spice-vdagentd.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=How To Run Spice Agent in Alpine=&lt;br /&gt;
&lt;br /&gt;
This is a guide on how to run Spice Agent in Alpine Linux 3.12.1-standard. &lt;br /&gt;
&lt;br /&gt;
The Spice Agent can be used to get some additional features when running Alpine Linux in a Qemu/Libvirt VM.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
Working:&lt;br /&gt;
* Client mouse mode&lt;br /&gt;
* Automatic adjustment of the X-session resolution&lt;br /&gt;
* Clipboard sharing&lt;br /&gt;
&lt;br /&gt;
Not working:&lt;br /&gt;
* The &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; field in Libvirt - it always shows &amp;quot;disconnected&amp;quot;, even when it is working&lt;br /&gt;
&lt;br /&gt;
Not tested:&lt;br /&gt;
* Transferring files&lt;br /&gt;
* Multiple displays/screens&lt;br /&gt;
&lt;br /&gt;
=Before You Start=&lt;br /&gt;
Most features of the Spice Agent are only useful when running a graphical interface.&lt;br /&gt;
I roughly followed the [[Awesome(wm)_Setup]] guide, but substituted &amp;lt;code&amp;gt;awesome&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;i3wm&amp;lt;/code&amp;gt; as that has my preference (you have to install &amp;lt;code&amp;gt;i3status&amp;lt;/code&amp;gt; manually, and use &amp;lt;code&amp;gt;i3&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;.xinitrc&amp;lt;/code&amp;gt; file).&lt;br /&gt;
&lt;br /&gt;
For the Spice Agent to work, don&#039;t remove the &amp;lt;code&amp;gt;Channel spice&amp;lt;/code&amp;gt; that is automatically added by Libvirt.&lt;br /&gt;
&lt;br /&gt;
=Building the Spice Agent=&lt;br /&gt;
Install the dependencies:&lt;br /&gt;
  # 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&lt;br /&gt;
&lt;br /&gt;
Get the source code:&lt;br /&gt;
  $ git clone https://gitlab.freedesktop.org/spice/linux/vd_agent.git&lt;br /&gt;
  $ cd vd_agent&lt;br /&gt;
  $ git checkout spice-vdagent-0.20.0&lt;br /&gt;
We need this specific version because the newest version requires a newer &amp;lt;code&amp;gt;spice-protocol&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Build the code (still in the {{Path|vd_agent}} directory):&lt;br /&gt;
  $ ./autogen.sh&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
Install the program (should be optional when running manually, but I haven&#039;t tried it without yet):&lt;br /&gt;
  # make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Running the Spice Agent=&lt;br /&gt;
&lt;br /&gt;
==Running manually==&lt;br /&gt;
First start the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;:&lt;br /&gt;
  # modprobe uinput&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X&lt;br /&gt;
&amp;lt;small&amp;gt;You can also remove the lower-case &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to deamonize the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then start the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt;:&lt;br /&gt;
  $ spice-vdagent -x -d&lt;br /&gt;
Notice that there is no need to run this last command as root.&lt;br /&gt;
&lt;br /&gt;
==Running with init script==&lt;br /&gt;
&#039;&#039;This assumes you ran &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; at the end of building. If you have not, you&#039;ll have to change this accordingly. It also requires that &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; can be loaded with &amp;lt;code&amp;gt;modprobe&amp;lt;/code&amp;gt;. If you cannot, look at [[#Using_the_virt_edition_of_Alpine]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To run with an init script, we will use the Gentoo init script, although we have to change the paths to make it work properly (latest commit is &amp;lt;code&amp;gt;b3b3e1d9a13c389f17e01c78c6c1a996d08420b5&amp;lt;/code&amp;gt; at the time of writing):&lt;br /&gt;
  $ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/app-emulation/spice-vdagent/files/spice-vdagent.initd-4&lt;br /&gt;
  $ sed &#039;s,/var/run,/run,g;s,/usr/sbin,/usr/local/sbin,g&#039; spice-vdagent.initd-4 &amp;gt; spice-vdagentd&lt;br /&gt;
Then we move the file to the right location, change the ownership, make it executable and add it to the default runlevel:&lt;br /&gt;
  # mv spice-vdagentd /etc/init.d/&lt;br /&gt;
  # chown root:root /etc/init.d/spice-vdagentd&lt;br /&gt;
  # chmod +x /etc/init.d/spice-vdagentd&lt;br /&gt;
  # rc-update add spice-vdagentd default&lt;br /&gt;
&lt;br /&gt;
The above will start the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;, but not the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt;. As the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt; should be started with the de/wm you&#039;re using, there is not one general way which works for all setups. If you want to find a way that works for you, [https://wiki.archlinux.org/index.php/Autostarting#On_desktop_environment_startup the Arch wiki has a decent page on autostarting].&lt;br /&gt;
&lt;br /&gt;
=Using the virt edition of Alpine=&lt;br /&gt;
This currently does not work on the virt edition (version 3.12.1), as it doesn&#039;t have &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; enabled in the kernel. However, there are still several ways to get it working.&lt;br /&gt;
&lt;br /&gt;
==Run without uinput==&lt;br /&gt;
You can make the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt; work without the uinput module by starting it as follows, but it will disable the cursor while the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt; is running:&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X -u /dev/null -f&lt;br /&gt;
&lt;br /&gt;
==Build uinput as module==&lt;br /&gt;
{{Draft|The following contains all necessary information, but has to be rewritten to be more clear.}}&lt;br /&gt;
Follow the steps in [[Creating_an_Alpine_package#Setup_your_system_and_account|Setup your system and account for building packages]] and cd to the {{Path|aports/main/linux-lts}} directory.&lt;br /&gt;
Check that the kernel version you&#039;ve pulled is the same that you&#039;re running with &amp;lt;code&amp;gt;uname -r&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;head APKBUILD&amp;lt;/code&amp;gt;.&lt;br /&gt;
If they mismatch, checkout the aports branch that has the same kernel version.&lt;br /&gt;
If they are the same, continue with the following steps:&lt;br /&gt;
  $ abuild deps&lt;br /&gt;
  $ abuild fetch verify&lt;br /&gt;
  $ abuild unpack&lt;br /&gt;
  $ abuild prepare&lt;br /&gt;
  $ cd src/build-virt-x86_64&lt;br /&gt;
Now change &amp;lt;code&amp;gt;CONFIG_INPUT_UINPUT&amp;lt;/code&amp;gt; from not being included to &amp;lt;code&amp;gt;CONFIG_INPUT_UINPUT=m&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;.config&amp;lt;/code&amp;gt; file. Then proceed as follows:&lt;br /&gt;
  $ make modules_prepare&lt;br /&gt;
  $ make drivers/input/misc/uinput.ko&lt;br /&gt;
This builds the &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; module in the current directory. Every time you want to use it, you&#039;ll have to load it like this (still from {{Path|aports/main/linux-lts/src/build-virt-x86_64}}):&lt;br /&gt;
  # insmod drivers/input/misc/uinput.ko&lt;br /&gt;
After this, you can use the spice agent as described in [[How_to_run_Spice_Agent#Running_the_Spice_Agent|Running the Spice Agent]], except that the &amp;lt;code&amp;gt;modprobe uinput&amp;lt;/code&amp;gt; is not necessary.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can &amp;quot;install&amp;quot; the module by copying it to {{Path|/lib/modules/`uname -r`/extra}} (which you&#039;ll most likely have to create first) and running &amp;lt;code&amp;gt;depmod&amp;lt;/code&amp;gt; (as root).&lt;br /&gt;
After this, you can load the module normally with &amp;lt;code&amp;gt;modprobe uinput&amp;lt;/code&amp;gt;.&lt;br /&gt;
This is necessary if you want to use the init script as described in [[#Running_with_init_script]].&lt;br /&gt;
&lt;br /&gt;
==Rebuild the kernel to include uinput==&lt;br /&gt;
See [[Custom_Kernel]] for pointers on how to build a custom kernel. The option you&#039;ll need to change in the config is &amp;lt;code&amp;gt;CONFIG_INPUT_UINPUT&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>MartinJM</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18626</id>
		<title>How to run Spice Agent</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18626"/>
		<updated>2021-02-05T15:47:34Z</updated>

		<summary type="html">&lt;p&gt;MartinJM: Added information on init script and installing the uinput module when using the virt kernel.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=How To Run Spice Agent in Alpine=&lt;br /&gt;
&lt;br /&gt;
This is a guide on how to run Spice Agent in Alpine Linux 3.12.1-standard. &lt;br /&gt;
&lt;br /&gt;
The Spice Agent can be used to get some additional features when running Alpine Linux in a Qemu/Libvirt VM.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
Working:&lt;br /&gt;
* Client mouse mode&lt;br /&gt;
* Automatic adjustment of the X-session resolution&lt;br /&gt;
* Clipboard sharing&lt;br /&gt;
&lt;br /&gt;
Not working:&lt;br /&gt;
* The &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; field in Libvirt - it always shows &amp;quot;disconnected&amp;quot;, even when it is working&lt;br /&gt;
&lt;br /&gt;
Not tested:&lt;br /&gt;
* Transferring files&lt;br /&gt;
* Multiple displays/screens&lt;br /&gt;
&lt;br /&gt;
=Before You Start=&lt;br /&gt;
Most features of the Spice Agent are only useful when running a graphical interface.&lt;br /&gt;
I roughly followed the [[Awesome(wm)_Setup]] guide, but substituted &amp;lt;code&amp;gt;awesome&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;i3wm&amp;lt;/code&amp;gt; as that has my preference (you have to install &amp;lt;code&amp;gt;i3status&amp;lt;/code&amp;gt; manually, and use &amp;lt;code&amp;gt;i3&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;.xinitrc&amp;lt;/code&amp;gt; file).&lt;br /&gt;
&lt;br /&gt;
For the Spice Agent to work, don&#039;t remove the &amp;lt;code&amp;gt;Channel spice&amp;lt;/code&amp;gt; that is automatically added by Libvirt.&lt;br /&gt;
&lt;br /&gt;
=Building the Spice Agent=&lt;br /&gt;
Install the dependencies:&lt;br /&gt;
  # 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&lt;br /&gt;
&lt;br /&gt;
Get the source code:&lt;br /&gt;
  $ git clone https://gitlab.freedesktop.org/spice/linux/vd_agent.git&lt;br /&gt;
  $ cd vd_agent&lt;br /&gt;
  $ git checkout spice-vdagent-0.20.0&lt;br /&gt;
We need this specific version because the newest version requires a newer &amp;lt;code&amp;gt;spice-protocol&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Build the code (still in the {{Path|vd_agent}} directory):&lt;br /&gt;
  $ ./autogen.sh&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
Install the program (should be optional when running manually, but I haven&#039;t tried it without yet):&lt;br /&gt;
  # make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Running the Spice Agent=&lt;br /&gt;
&lt;br /&gt;
==Running manually==&lt;br /&gt;
First start the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;:&lt;br /&gt;
  # modprobe uinput&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X&lt;br /&gt;
&amp;lt;small&amp;gt;You can also remove the lower-case &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to deamonize the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then start the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt;:&lt;br /&gt;
  $ spice-vdagent -x -d&lt;br /&gt;
Notice that there is no need to run this last command as root.&lt;br /&gt;
&lt;br /&gt;
==Running with init script==&lt;br /&gt;
&#039;&#039;This assumes you ran &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; at the end of building. If you have not, you&#039;ll have to change this accordingly. It also requires that &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; can be loaded with &amp;lt;code&amp;gt;modprobe&amp;lt;/code&amp;gt;. If you cannot, look at [[#Using_the_virt_edition_of_Alpine]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To run with an init script, we will use the Gentoo init script, although we have to change the paths to make it work properly (latest commit is &amp;lt;code&amp;gt;b3b3e1d9a13c389f17e01c78c6c1a996d08420b5&amp;lt;/code&amp;gt; at the time of writing):&lt;br /&gt;
  $ wget https://gitweb.gentoo.org/repo/gentoo.git/plain/app-emulation/spice-vdagent/files/spice-vdagent.initd-4&lt;br /&gt;
  $ sed &#039;s,/var/run,/run,g;s,/usr/sbin,/usr/local/sbin,g&#039; spice-vdagent.initd-4 &amp;gt; spice-vdagentd&lt;br /&gt;
Then we move the file to the right location, change the ownership, make it executable and add it to the default runlevel:&lt;br /&gt;
  # mv spice-vdagentd /etc/init.d/&lt;br /&gt;
  # chown root:root /etc/init.d/spice-vdagentd&lt;br /&gt;
  # chmod +x /etc/init.d/spice-vdagentd&lt;br /&gt;
  # rc-update add spice-vdagentd default&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using the virt edition of Alpine=&lt;br /&gt;
This currently does not work on the virt edition (version 3.12.1), as it doesn&#039;t have &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; enabled in the kernel. However, there are still several ways to get it working.&lt;br /&gt;
&lt;br /&gt;
==Run without uinput==&lt;br /&gt;
You can make the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt; work without the uinput module by starting it as follows, but it will disable the cursor while the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt; is running:&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X -u /dev/null -f&lt;br /&gt;
&lt;br /&gt;
==Build uinput as module==&lt;br /&gt;
{{Draft|The following contains all necessary information, but has to be rewritten to be more clear.}}&lt;br /&gt;
Follow the steps in [[Creating_an_Alpine_package#Setup_your_system_and_account|Setup your system and account for building packages]] and cd to the {{Path|aports/main/linux-lts}} directory.&lt;br /&gt;
Check that the kernel version you&#039;ve pulled is the same that you&#039;re running with &amp;lt;code&amp;gt;uname -r&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;head APKBUILD&amp;lt;/code&amp;gt;.&lt;br /&gt;
If they mismatch, checkout the aports branch that has the same kernel version.&lt;br /&gt;
If they are the same, continue with the following steps:&lt;br /&gt;
  $ abuild deps&lt;br /&gt;
  $ abuild fetch verify&lt;br /&gt;
  $ abuild unpack&lt;br /&gt;
  $ abuild prepare&lt;br /&gt;
  $ cd src/build-virt-x86_64&lt;br /&gt;
Now change &amp;lt;code&amp;gt;CONFIG_INPUT_UINPUT&amp;lt;/code&amp;gt; from not being included to &amp;lt;code&amp;gt;CONFIG_INPUT_UINPUT=m&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;.config&amp;lt;/code&amp;gt; file. Then proceed as follows:&lt;br /&gt;
  $ make modules_prepare&lt;br /&gt;
  $ make drivers/input/misc/uinput.ko&lt;br /&gt;
This builds the &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; module in the current directory. Every time you want to use it, you&#039;ll have to load it like this (still from {{Path|aports/main/linux-lts/src/build-virt-x86_64}}):&lt;br /&gt;
  # insmod drivers/input/misc/uinput.ko&lt;br /&gt;
After this, you can use the spice agent as described in [[How_to_run_Spice_Agent#Running_the_Spice_Agent|Running the Spice Agent]], except that the &amp;lt;code&amp;gt;modprobe uinput&amp;lt;/code&amp;gt; is not necessary.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can &amp;quot;install&amp;quot; the module by copying it to {{Path|/lib/modules/`uname -r`/extra}} (which you&#039;ll most likely have to create first) and running &amp;lt;code&amp;gt;depmod&amp;lt;/code&amp;gt; (as root).&lt;br /&gt;
After this, you can load the module normally with &amp;lt;code&amp;gt;modprobe uinput&amp;lt;/code&amp;gt;.&lt;br /&gt;
This is necessary if you want to use the init script as described in [[#Running_with_init_script]].&lt;br /&gt;
&lt;br /&gt;
==Rebuild the kernel to include uinput==&lt;br /&gt;
See [[Custom_Kernel]] for pointers on how to build a custom kernel. The option you&#039;ll need to change in the config is &amp;lt;code&amp;gt;CONFIG_INPUT_UINPUT&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>MartinJM</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18178</id>
		<title>How to run Spice Agent</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18178"/>
		<updated>2020-11-11T13:58:48Z</updated>

		<summary type="html">&lt;p&gt;MartinJM: Added information on how to get uinput working on the virt edition.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=How To Run Spice Agent in Alpine=&lt;br /&gt;
&lt;br /&gt;
This is a guide on how to run Spice Agent in Alpine Linux 3.12.1-standard. &lt;br /&gt;
&lt;br /&gt;
The Spice Agent can be used to get some additional features when running Alpine Linux in a Qemu/Libvirt VM.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
Working:&lt;br /&gt;
* Client mouse mode&lt;br /&gt;
* Automatic adjustment of the X-session resolution&lt;br /&gt;
* Clipboard sharing&lt;br /&gt;
&lt;br /&gt;
Not working:&lt;br /&gt;
* The &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; field in Libvirt - it always shows &amp;quot;disconnected&amp;quot;, even when it is working&lt;br /&gt;
&lt;br /&gt;
Not tested:&lt;br /&gt;
* Transferring files&lt;br /&gt;
* Multiple displays/screens&lt;br /&gt;
&lt;br /&gt;
=Before You Start=&lt;br /&gt;
Most features of the Spice Agent are only useful when running a graphical interface.&lt;br /&gt;
I roughly followed the [[Awesome(wm)_Setup]] guide, but substituted &amp;lt;code&amp;gt;awesome&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;i3wm&amp;lt;/code&amp;gt; as that has my preference (you have to install &amp;lt;code&amp;gt;i3status&amp;lt;/code&amp;gt; manually, and use &amp;lt;code&amp;gt;i3&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;.xinitrc&amp;lt;/code&amp;gt; file).&lt;br /&gt;
&lt;br /&gt;
For the Spice Agent to work, don&#039;t remove the &amp;lt;code&amp;gt;Channel spice&amp;lt;/code&amp;gt; that is automatically added by Libvirt.&lt;br /&gt;
&lt;br /&gt;
=Building the Spice Agent=&lt;br /&gt;
Install the dependencies:&lt;br /&gt;
  # 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&lt;br /&gt;
&lt;br /&gt;
Get the source code:&lt;br /&gt;
  $ git clone https://gitlab.freedesktop.org/spice/linux/vd_agent.git&lt;br /&gt;
  $ cd vd_agent&lt;br /&gt;
  $ git checkout spice-vdagent-0.20.0&lt;br /&gt;
We need this specific version because the newest version requires a newer &amp;lt;code&amp;gt;spice-protocol&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Build the code (still in the {{Path|vd_agent}} directory):&lt;br /&gt;
  $ ./autogen.sh&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
Install the program (should be optional, but I haven&#039;t tried it without yet):&lt;br /&gt;
  # make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Running the Spice Agent=&lt;br /&gt;
{{Draft|While this works, it&#039;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.}}&lt;br /&gt;
&lt;br /&gt;
First start the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;:&lt;br /&gt;
  # modprobe uinput&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X&lt;br /&gt;
&amp;lt;small&amp;gt;You can also remove the lower-case &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to deamonize the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then start the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt;:&lt;br /&gt;
  $ spice-vdagent -x -d&lt;br /&gt;
Notice that there is no need to run this last command as root.&lt;br /&gt;
&lt;br /&gt;
=Using the virt edition of Alpine=&lt;br /&gt;
This currently does not work on the virt edition (version 3.12.1), as it doesn&#039;t have &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; enabled in the kernel. However, there are still several ways to get it working.&lt;br /&gt;
&lt;br /&gt;
==Run without the uinput==&lt;br /&gt;
You can make the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt; work without the uinput module by starting it as follows, but it will disable the cursor while the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt; is running:&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X -u /dev/null -f&lt;br /&gt;
&lt;br /&gt;
==Build uinput as module==&lt;br /&gt;
{{Draft|This will build the module, and it can be loaded, but it doesn&#039;t install the module. This has yet to be added.}}&lt;br /&gt;
Follow the steps in [[Creating_an_Alpine_package#Setup_your_system_and_account|Setup your system and account for building packages]] and cd to the {{Path|aports/main/linux-lts}} directory.&lt;br /&gt;
Check that the kernel version you&#039;ve pulled is the same that you&#039;re running with &amp;lt;code&amp;gt;uname -r&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;head APKBUILD&amp;lt;/code&amp;gt;.&lt;br /&gt;
If they mismatch, checkout the aports branch that has the same kernel version.&lt;br /&gt;
If they are the same, continue with the following steps:&lt;br /&gt;
  $ abuild deps&lt;br /&gt;
  $ abuild fetch verify&lt;br /&gt;
  $ abuild unpack&lt;br /&gt;
  $ abuild prepare&lt;br /&gt;
  $ cd src/build-virt-x86_64&lt;br /&gt;
Now change &amp;lt;code&amp;gt;CONFIG_INPUT_UINPUT&amp;lt;/code&amp;gt; from not being included to &amp;lt;code&amp;gt;CONFIG_INPUT_UINPUT=m&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;.config&amp;lt;/code&amp;gt; file. Then proceed as follows:&lt;br /&gt;
  $ make modules_prepare&lt;br /&gt;
  $ make drivers/input/misc/uinput.ko&lt;br /&gt;
This builds the &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; module in the current directory. Every time you want to use it, you&#039;ll have to load it like this (still from {{Path|aports/main/linux-lts/src/build-virt-x86_64}}):&lt;br /&gt;
  # insmod drivers/input/misc/uinput.ko&lt;br /&gt;
After this, you can use the spice agent as described in [[How_to_run_Spice_Agent#Running_the_Spice_Agent|Running the Spice Agent]], except that the &amp;lt;code&amp;gt;modprobe uinput&amp;lt;/code&amp;gt; is not necessary.&lt;br /&gt;
&lt;br /&gt;
==Rebuild the kernel to include uinput==&lt;br /&gt;
See [[Custom_Kernel]] for pointers on how to build a custom kernel. The option you&#039;ll need to change in the config is &amp;lt;code&amp;gt;CONFIG_INPUT_UINPUT&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>MartinJM</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18139</id>
		<title>How to run Spice Agent</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18139"/>
		<updated>2020-11-01T14:22:45Z</updated>

		<summary type="html">&lt;p&gt;MartinJM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=How To Run Spice Agent in Alpine=&lt;br /&gt;
&lt;br /&gt;
This is a guide on how to run Spice Agent in Alpine Linux 3.12.1-standard. &lt;br /&gt;
&lt;br /&gt;
The Spice Agent can be used to get some additional features when running Alpine Linux in a Qemu/Libvirt VM.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
Working:&lt;br /&gt;
* Client mouse mode&lt;br /&gt;
* Automatic adjustment of the X-session resolution&lt;br /&gt;
* Clipboard sharing&lt;br /&gt;
&lt;br /&gt;
Not working:&lt;br /&gt;
* The &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; field in Libvirt - it always shows &amp;quot;disconnected&amp;quot;, even when it is working&lt;br /&gt;
&lt;br /&gt;
Not tested:&lt;br /&gt;
* Transferring files&lt;br /&gt;
* Multiple displays/screens&lt;br /&gt;
&lt;br /&gt;
=Before You Start=&lt;br /&gt;
Most features of the Spice Agent are only useful when running a graphical interface.&lt;br /&gt;
I roughly followed the [[Awesome(wm)_Setup]] guide, but substituted &amp;lt;code&amp;gt;awesome&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;i3wm&amp;lt;/code&amp;gt; as that has my preference (you have to install &amp;lt;code&amp;gt;i3status&amp;lt;/code&amp;gt; manually, and use &amp;lt;code&amp;gt;i3&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;.xinitrc&amp;lt;/code&amp;gt; file).&lt;br /&gt;
&lt;br /&gt;
For the Spice Agent to work, don&#039;t remove the &amp;lt;code&amp;gt;Channel spice&amp;lt;/code&amp;gt; that is automatically added by Libvirt.&lt;br /&gt;
&lt;br /&gt;
=Building the Spice Agent=&lt;br /&gt;
Install the dependencies:&lt;br /&gt;
  # 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&lt;br /&gt;
&lt;br /&gt;
Get the source code:&lt;br /&gt;
  $ git clone https://gitlab.freedesktop.org/spice/linux/vd_agent.git&lt;br /&gt;
  $ cd vd_agent&lt;br /&gt;
  $ git checkout spice-vdagent-0.20.0&lt;br /&gt;
We need this specific version because the newest version requires a newer &amp;lt;code&amp;gt;spice-protocol&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Build the code (still in the &amp;lt;code&amp;gt;vd_agent&amp;lt;/code&amp;gt; directory):&lt;br /&gt;
  $ ./autogen.sh&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
Install the program (should be optional, but I haven&#039;t tried it without yet):&lt;br /&gt;
  # make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Running the Spice Agent=&lt;br /&gt;
{{Draft|While this works, it&#039;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.}}&lt;br /&gt;
&lt;br /&gt;
First start the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;:&lt;br /&gt;
  # modprobe uinput&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X&lt;br /&gt;
&amp;lt;small&amp;gt;You can also remove the lower-case &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to deamonize the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then start the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt;:&lt;br /&gt;
  $ spice-vdagent -x -d&lt;br /&gt;
Notice that there is no need to run this last command as root.&lt;br /&gt;
&lt;br /&gt;
=Using the virt edition of Alpine=&lt;br /&gt;
This currently does not work on the virt edition (version 3.12.1), as it doesn&#039;t have the &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; module enabled in the kernel.&lt;br /&gt;
&lt;br /&gt;
You can still make the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt; work by starting it as follows, but it will disable the cursor while the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt; is running:&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X -u /dev/null -f&lt;/div&gt;</summary>
		<author><name>MartinJM</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18138</id>
		<title>How to run Spice Agent</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18138"/>
		<updated>2020-11-01T14:22:23Z</updated>

		<summary type="html">&lt;p&gt;MartinJM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=How To Run Spice Agent in Alpine=&lt;br /&gt;
&lt;br /&gt;
This is a guide on how to run Spice Agent in Alpine Linux 3.12.1-standard. &lt;br /&gt;
&lt;br /&gt;
The Spice Agent can be used to get some additional features when running Alpine Linux in a Qemu/Libvirt VM.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
Working:&lt;br /&gt;
* Client mouse mode&lt;br /&gt;
* Automatic adjustment of the X-session resolution&lt;br /&gt;
* Clipboard sharing&lt;br /&gt;
&lt;br /&gt;
Not working:&lt;br /&gt;
* The &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; field in Libvirt - it always shows &amp;quot;disconnected&amp;quot;, even when it is working&lt;br /&gt;
&lt;br /&gt;
Not tested:&lt;br /&gt;
* Transferring files&lt;br /&gt;
* Multiple displays/screens&lt;br /&gt;
&lt;br /&gt;
=Before You Start=&lt;br /&gt;
Most features of the Spice Agent are only useful when running a graphical interface.&lt;br /&gt;
I roughly followed the [[Awesome(wm)_Setup]] guide, but substituted &amp;lt;code&amp;gt;awesome&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;i3wm&amp;lt;/code&amp;gt; as that has my preference (you have to install &amp;lt;code&amp;gt;i3status&amp;lt;/code&amp;gt; manually, and use &amp;lt;code&amp;gt;i3&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;.xinitrc&amp;lt;/code&amp;gt; file).&lt;br /&gt;
&lt;br /&gt;
For the Spice Agent to work, don&#039;t remove the &amp;lt;code&amp;gt;Channel spice&amp;lt;/code&amp;gt; that is automatically added by Libvirt.&lt;br /&gt;
&lt;br /&gt;
=Building the Spice Agent=&lt;br /&gt;
Install the dependencies:&lt;br /&gt;
  # 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&lt;br /&gt;
&lt;br /&gt;
Get the source code:&lt;br /&gt;
  $ git clone (TODO: LINK TO VDAGENT GIT ON FREEDESKTOP GITLAB)&lt;br /&gt;
  $ cd vd_agent&lt;br /&gt;
  $ git checkout spice-vdagent-0.20.0&lt;br /&gt;
We need this specific version because the newest version requires a newer &amp;lt;code&amp;gt;spice-protocol&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Build the code (still in the &amp;lt;code&amp;gt;vd_agent&amp;lt;/code&amp;gt; directory):&lt;br /&gt;
  $ ./autogen.sh&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
Install the program (should be optional, but I haven&#039;t tried it without yet):&lt;br /&gt;
  # make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Running the Spice Agent=&lt;br /&gt;
{{Draft|While this works, it&#039;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.}}&lt;br /&gt;
&lt;br /&gt;
First start the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;:&lt;br /&gt;
  # modprobe uinput&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X&lt;br /&gt;
&amp;lt;small&amp;gt;You can also remove the lower-case &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to deamonize the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then start the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt;:&lt;br /&gt;
  $ spice-vdagent -x -d&lt;br /&gt;
Notice that there is no need to run this last command as root.&lt;br /&gt;
&lt;br /&gt;
=Using the virt edition of Alpine=&lt;br /&gt;
This currently does not work on the virt edition (version 3.12.1), as it doesn&#039;t have the &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; module enabled in the kernel.&lt;br /&gt;
&lt;br /&gt;
You can still make the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt; work by starting it as follows, but it will disable the cursor while the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt; is running:&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X -u /dev/null -f&lt;/div&gt;</summary>
		<author><name>MartinJM</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18137</id>
		<title>How to run Spice Agent</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_run_Spice_Agent&amp;diff=18137"/>
		<updated>2020-11-01T14:20:48Z</updated>

		<summary type="html">&lt;p&gt;MartinJM: Created page with &amp;quot;=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...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=How To Run Spice Agent in Alpine=&lt;br /&gt;
&lt;br /&gt;
This is a guide on how to run Spice Agent in Alpine Linux 3.12.1-standard. &lt;br /&gt;
&lt;br /&gt;
The Spice Agent can be used to get some additional features when running Alpine Linux in a Qemu/Libvirt VM.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
Working:&lt;br /&gt;
* Client mouse mode&lt;br /&gt;
* Automatic adjustment of the X-session resolution&lt;br /&gt;
* Clipboard sharing&lt;br /&gt;
&lt;br /&gt;
Not working:&lt;br /&gt;
* The &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; field in Libvirt - it always shows &amp;quot;disconnected&amp;quot;, even when it is working&lt;br /&gt;
&lt;br /&gt;
Not tested:&lt;br /&gt;
* Transferring files&lt;br /&gt;
* Multiple displays/screens&lt;br /&gt;
&lt;br /&gt;
=Before You Start=&lt;br /&gt;
Most features of the Spice Agent are only useful when running a graphical interface.&lt;br /&gt;
I roughly followed the (TODO: LINK TO AWESOME SETUP GUIDE) guide, but substituted &amp;lt;code&amp;gt;awesome&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;i3wm&amp;lt;/code&amp;gt; as that has my preference (you have to install &amp;lt;code&amp;gt;i3status&amp;lt;/code&amp;gt; manually, and use &amp;lt;code&amp;gt;i3&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;.xinitrc&amp;lt;/code&amp;gt; file).&lt;br /&gt;
&lt;br /&gt;
For the Spice Agent to work, don&#039;t remove the &amp;lt;code&amp;gt;Channel spice&amp;lt;/code&amp;gt; that is automatically added by Libvirt.&lt;br /&gt;
&lt;br /&gt;
=Building the Spice Agent=&lt;br /&gt;
Install the dependencies:&lt;br /&gt;
  # 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&lt;br /&gt;
&lt;br /&gt;
Get the source code:&lt;br /&gt;
  $ git clone (TODO: LINK TO VDAGENT GIT ON FREEDESKTOP GITLAB)&lt;br /&gt;
  $ cd vd_agent&lt;br /&gt;
  $ git checkout spice-vdagent-0.20.0&lt;br /&gt;
We need this specific version because the newest version requires a newer &amp;lt;code&amp;gt;spice-protocol&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Build the code (still in the &amp;lt;code&amp;gt;vd_agent&amp;lt;/code&amp;gt; directory):&lt;br /&gt;
  $ ./autogen.sh&lt;br /&gt;
  $ make&lt;br /&gt;
&lt;br /&gt;
Install the program (should be optional, but I haven&#039;t tried it without yet):&lt;br /&gt;
  # make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Running the Spice Agent=&lt;br /&gt;
{{Draft|While this works, it&#039;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.}}&lt;br /&gt;
&lt;br /&gt;
First start the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;:&lt;br /&gt;
  # modprobe uinput&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X&lt;br /&gt;
&amp;lt;small&amp;gt;You can also remove the lower-case &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to deamonize the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt;.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then start the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt;:&lt;br /&gt;
  $ spice-vdagent -x -d&lt;br /&gt;
Notice that there is no need to run this last command as root.&lt;br /&gt;
&lt;br /&gt;
=Using the virt edition of Alpine=&lt;br /&gt;
This currently does not work on the virt edition (version 3.12.1), as it doesn&#039;t have the &amp;lt;code&amp;gt;uinput&amp;lt;/code&amp;gt; module enabled in the kernel.&lt;br /&gt;
&lt;br /&gt;
You can still make the &amp;lt;code&amp;gt;spice-vdagentd&amp;lt;/code&amp;gt; work by starting it as follows, but it will disable the cursor while the &amp;lt;code&amp;gt;spice-vdagent&amp;lt;/code&amp;gt; is running:&lt;br /&gt;
  # mkdir /run/spice-vdagentd&lt;br /&gt;
  # spice-vdagentd -d -x -X -u /dev/null -f&lt;/div&gt;</summary>
		<author><name>MartinJM</name></author>
	</entry>
</feed>