<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linux-kvm.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ormaaj</id>
	<title>KVM - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://linux-kvm.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ormaaj"/>
	<link rel="alternate" type="text/html" href="https://linux-kvm.org/page/Special:Contributions/Ormaaj"/>
	<updated>2026-04-06T03:59:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://linux-kvm.org/index.php?title=SPICE&amp;diff=173583</id>
		<title>SPICE</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=SPICE&amp;diff=173583"/>
		<updated>2015-12-26T10:24:59Z</updated>

		<summary type="html">&lt;p&gt;Ormaaj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Example using SPICE and QXL for improved Graphics experience in the guest ==&lt;br /&gt;
&lt;br /&gt;
This example is based on qemu-kvm (0.15.0) as installed in Fedora 15.&lt;br /&gt;
Will first show how to do this manually, and second how to do it using the virt-manager tool.&lt;br /&gt;
&lt;br /&gt;
For extensive details on SPICE, visit http://spice-space.org&lt;br /&gt;
&lt;br /&gt;
== Manually, using qemu-kvm command line directly ==&lt;br /&gt;
&lt;br /&gt;
The simplest part is adding the qxl graphics device to the guest.  By adding &amp;lt;code&amp;gt;-vga qxl&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 # /usr/bin/qemu-kvm -m 1024 -name f15 -drive file=/images/f15.img,if=virtio -vga qxl&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see a normal SDL window pop up, and if you poke inside the guest you&#039;ll find that X is using the qxl device to display:&lt;br /&gt;
&lt;br /&gt;
 $ lspci&lt;br /&gt;
 ...&lt;br /&gt;
 00:02.0 VGA compatible controller: Red Hat, Inc. Device 0100 (rev 03)&lt;br /&gt;
&lt;br /&gt;
 $ grep QXL /var/log/Xorg.0.log&lt;br /&gt;
 [    15.878] (II) qxl: Driver for QXL virtual graphics: QXL 1&lt;br /&gt;
 &lt;br /&gt;
However, this is not enough to use SPICE.  We need to enable the spice server in qemu-kvm.  We also need a client to view the guest.  So first be sure the client is installed:&lt;br /&gt;
&lt;br /&gt;
 # yum install spice-client&lt;br /&gt;
&lt;br /&gt;
To keep it simple, we&#039;ll not require authentication and simply bind the server to 127.0.0.1 on port 5900.&lt;br /&gt;
&lt;br /&gt;
 # /usr/bin/qemu-kvm -m 1024 -name f15 -drive file=/images/f15.img,if=virtio -vga qxl  -spice port=5900,addr=127.0.0.1,disable-ticketing&lt;br /&gt;
&lt;br /&gt;
This will not pop up an SDL window, so launch the client to connect to the guest.&lt;br /&gt;
&lt;br /&gt;
 $ spicec -h 127.0.0.1 -p 5900&lt;br /&gt;
&lt;br /&gt;
We&#039;re getting closer.  Now the only thing left is to improve the experience by&lt;br /&gt;
enabling the spice agent communication channel between the host and the guest (you wanted copy and paste between host and guest right? ;)&lt;br /&gt;
&lt;br /&gt;
This part is a bit arcane.  We need to add a virtio-serial device to the guest, and open a port for the spice vdagent.  We also need to install the spice vdagent in guest.  Be sure the agent is running (and for future, started automatically).&lt;br /&gt;
&lt;br /&gt;
First the guest side, since the guest is running.&lt;br /&gt;
&lt;br /&gt;
 # yum install spice-vdagent&lt;br /&gt;
 # chkconfig --add spice-vdagentd&lt;br /&gt;
&lt;br /&gt;
Now stop the guest and we&#039;ll build up the hostside qemu-kvm commandline.&lt;br /&gt;
We need to add the virtio-serial device: &amp;lt;code&amp;gt;-device virtio-serial-pci&amp;lt;/code&amp;gt;&lt;br /&gt;
We need to add a port for spice in that device: &amp;lt;code&amp;gt;-device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0&amp;lt;/code&amp;gt;&lt;br /&gt;
And we need a spicevmc chardev for that port: &amp;lt;code&amp;gt;-chardev spicevmc,id=spicechannel0,name=vdagent&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s important that the virserialport &amp;lt;code&amp;gt;chardev=&amp;lt;/code&amp;gt; option matches the &amp;lt;code&amp;gt;id=&amp;lt;/code&amp;gt; given the chardev (&amp;lt;code&amp;gt;spicechannel0&amp;lt;/code&amp;gt; in this example).  It&#039;s also important that the port&#039;s &amp;lt;code&amp;gt;name=&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;com.redhat.spice.0&amp;lt;/code&amp;gt;, because that&#039;s the namespace spice-vdagentd is looking for in the guest. And finally, you need to specify &amp;lt;code&amp;gt;name=vdagent&amp;lt;/code&amp;gt; so spice knows what this channel is for.&lt;br /&gt;
&lt;br /&gt;
So we launch the guest one last time with the complete command line:&lt;br /&gt;
&lt;br /&gt;
 # /usr/bin/qemu-kvm -m 1024 -name f15 -drive file=/images/f15.img,if=virtio -vga qxl -spice port=5900,addr=127.0.0.1,disable-ticketing -device virtio-serial-pci -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 -chardev spicevmc,id=spicechannel0,name=vdagent&lt;br /&gt;
&lt;br /&gt;
And kick off a spice client:&lt;br /&gt;
&lt;br /&gt;
 $ spicec -h 127.0.0.1 -p 5900&lt;br /&gt;
&lt;br /&gt;
Now you can login to the guest, and you&#039;ll still see the qxl display device.  In addition, you&#039;ll see the virtio-serial port:&lt;br /&gt;
&lt;br /&gt;
 $ ls /dev/virtio-ports/&lt;br /&gt;
 com.redhat.spice.0&lt;br /&gt;
&lt;br /&gt;
Now test it out.  Grab some text and copy it to the clipboard in the guest.&lt;br /&gt;
(In gnome-terminal it&#039;s Shift-Ctrl-C to copy).  And paste it in the host (again, Shift-Ctrl-V to paste in gnome-terminal).&lt;br /&gt;
&lt;br /&gt;
== Enabling SPICE using virt-manager ==&lt;br /&gt;
&lt;br /&gt;
This assumes you&#039;ve already installed a guest with virt-manager or virt-install and it&#039;s shut off.&lt;br /&gt;
&lt;br /&gt;
Start virt-manager, and open your VM by double clicking on it.  Click the virtual hardware details (lightbulb).&lt;br /&gt;
&lt;br /&gt;
First we need to make the Video card a qxl device.  Click on Video, and in the Model pulldown, choose, qxl.  And Apply.&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot-video-qxl.png]]&lt;br /&gt;
&lt;br /&gt;
Next we need to change the display from VNC to Spice.  Click on Display VNC, and in the Type pulldown, choose Spice.  And Apply.  You&#039;ll be prompted to add the Spice agent channels, click Yes. (notice the additional Controller Virtio Serial too).&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot-display-Spice.png]]&lt;br /&gt;
&lt;br /&gt;
Now start the VM.  virt-manager has a spice-gtk client built-in.  So you don&#039;t need to fuss with a manual spice client like you did above.  You still need to be sure that the guest has spice-vdagent installed and running.  In the guest:&lt;br /&gt;
&lt;br /&gt;
 # yum install spice-vdagent&lt;br /&gt;
 # chkconfig --add spice-vdagentd&lt;br /&gt;
 # service start spice-vdagentd&lt;br /&gt;
 ... log out of X, and log back in, verify agent is running...&lt;br /&gt;
 $ ps -ef | grep vdagent&lt;br /&gt;
 root      1653     1  0 14:54 ?        00:00:00 /usr/sbin/spice-vdagentd&lt;br /&gt;
 gdm       1703     1  0 14:54 ?        00:00:00 /usr/bin/spice-vdagent&lt;br /&gt;
 chrisw    1932     1  0 14:55 ?        00:00:00 /usr/bin/spice-vdagent&lt;br /&gt;
&lt;br /&gt;
And you&#039;re done.  Test copy and paste and enjoy.&lt;/div&gt;</summary>
		<author><name>Ormaaj</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=KvmOnGentoo&amp;diff=4669</id>
		<title>KvmOnGentoo</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=KvmOnGentoo&amp;diff=4669"/>
		<updated>2013-04-10T10:22:20Z</updated>

		<summary type="html">&lt;p&gt;Ormaaj: printf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirement ==&lt;br /&gt;
* a Gentoo install on a vt (Intel) or svm (AMD) machine&lt;br /&gt;
* kernel compiled with at least, either y or m&lt;br /&gt;
&lt;br /&gt;
      CONFIG_HAVE_KVM=y&lt;br /&gt;
      CONFIG_HAVE_KVM_IRQCHIP=y&lt;br /&gt;
      CONFIG_HAVE_KVM_EVENTFD=y&lt;br /&gt;
      CONFIG_KVM=y&lt;br /&gt;
&lt;br /&gt;
      and CONFIG_KVM_INTEL=y or CONFIG_KVM_AMD=y depending if you are using Intel or AMD CPU&lt;br /&gt;
      &lt;br /&gt;
      optionally (if you want to use vhost)&lt;br /&gt;
      CONFIG_VHOST_NET=y&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
* printf &#039;%s\n&#039; &#039;QEMU_SOFTMMU_TARGETS=&amp;quot;i386 x86_64&amp;quot;&#039; &#039;QEMU_USER_TARGETS=&amp;quot;i386 x86_64&amp;quot;&#039; &amp;gt;&amp;gt; /etc/make.conf&lt;br /&gt;
* emerge app-emulation/qemu-kvm&lt;br /&gt;
&lt;br /&gt;
== Network setup ==&lt;br /&gt;
=== Bridged ===&lt;br /&gt;
* edit /etc/conf.d/net&lt;br /&gt;
      config_eth0=&amp;quot;null&amp;quot; # any any other interfaces you want to bridge&lt;br /&gt;
      bridge_brkvm=&amp;quot;eth0&amp;quot;&lt;br /&gt;
      config_brkvm=&amp;quot;192.168.254.254/24&amp;quot;  # the ip of the original eth0, or dhcp&lt;br /&gt;
      brctl_brkvm=&amp;quot;setfd 0&lt;br /&gt;
         sethello 30&lt;br /&gt;
         stp off&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* cd /etc/init.d&lt;br /&gt;
* ln -s net.lo net.brkvm&lt;br /&gt;
* rc-update add net.brkvm default&lt;br /&gt;
* rc-update del net.eth0 default&lt;br /&gt;
&lt;br /&gt;
== VM start/stop ==&lt;br /&gt;
* there are no standard Gentoo way to do this, you will need 3rd party scripts/front-ends.&lt;br /&gt;
&lt;br /&gt;
== Spice ==&lt;br /&gt;
(TODO)&lt;/div&gt;</summary>
		<author><name>Ormaaj</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=KvmOnGentoo&amp;diff=4668</id>
		<title>KvmOnGentoo</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=KvmOnGentoo&amp;diff=4668"/>
		<updated>2013-04-10T10:20:44Z</updated>

		<summary type="html">&lt;p&gt;Ormaaj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirement ==&lt;br /&gt;
* a Gentoo install on a vt (Intel) or svm (AMD) machine&lt;br /&gt;
* kernel compiled with at least, either y or m&lt;br /&gt;
&lt;br /&gt;
      CONFIG_HAVE_KVM=y&lt;br /&gt;
      CONFIG_HAVE_KVM_IRQCHIP=y&lt;br /&gt;
      CONFIG_HAVE_KVM_EVENTFD=y&lt;br /&gt;
      CONFIG_KVM=y&lt;br /&gt;
&lt;br /&gt;
      and CONFIG_KVM_INTEL=y or CONFIG_KVM_AMD=y depending if you are using Intel or AMD CPU&lt;br /&gt;
      &lt;br /&gt;
      optionally (if you want to use vhost)&lt;br /&gt;
      CONFIG_VHOST_NET=y&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
* printf &#039;%s\n&#039; &#039;QEMU_SOFTMMU_TARGETS=&amp;quot;i386 x86_64&amp;quot;&#039; &#039;QEMU_USER_TARGETS=&amp;quot;i386 x86_64&amp;quot;\n&#039; &amp;gt;&amp;gt; /etc/make.conf&lt;br /&gt;
* emerge app-emulation/qemu-kvm&lt;br /&gt;
&lt;br /&gt;
== Network setup ==&lt;br /&gt;
=== Bridged ===&lt;br /&gt;
* edit /etc/conf.d/net&lt;br /&gt;
      config_eth0=&amp;quot;null&amp;quot; # any any other interfaces you want to bridge&lt;br /&gt;
      bridge_brkvm=&amp;quot;eth0&amp;quot;&lt;br /&gt;
      config_brkvm=&amp;quot;192.168.254.254/24&amp;quot;  # the ip of the original eth0, or dhcp&lt;br /&gt;
      brctl_brkvm=&amp;quot;setfd 0&lt;br /&gt;
         sethello 30&lt;br /&gt;
         stp off&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* cd /etc/init.d&lt;br /&gt;
* ln -s net.lo net.brkvm&lt;br /&gt;
* rc-update add net.brkvm default&lt;br /&gt;
* rc-update del net.eth0 default&lt;br /&gt;
&lt;br /&gt;
== VM start/stop ==&lt;br /&gt;
* there are no standard Gentoo way to do this, you will need 3rd party scripts/front-ends.&lt;br /&gt;
&lt;br /&gt;
== Spice ==&lt;br /&gt;
(TODO)&lt;/div&gt;</summary>
		<author><name>Ormaaj</name></author>
	</entry>
</feed>