Sponsored Link

KVM : Configure SPICE Server2019/01/18

Install Desktop Virtualization "SPICE ( Simple Protocol for Independent Computing Environment )".
It's possible to connect to virtual machines from remote client computer.
Install SPICE Server if it's not installed yet. ( generally it's already installed with KVM for dependency )
[1] Install SPICE Server.
dlp:~ #
zypper -n install libspice-server1

[2] Edit existing virtual machine's xml-file and start virtual machine with SPICE like follows.
This example on this site shows to create a virtual machine without graphics,
so it's OK to change settings like follows, but if you created virtual machine with a graphics, Remove "<graphics>***" and " <video>***" sections in xml file because qxl is used for graphics.
# edit the configration of [sle15]

dlp:~ #
virsh edit sle15
<domain type='kvm'>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>2</vcpu>
# add follows

# set any password for [passwd=***] section

# specify a uniq number for [slot='0x**']

    <graphics type='spice' port='5900' autoport='no' listen='' passwd='password'>
      <listen type='address' address=''/>
    <sound model='ac97'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
      <model type='qxl' ram='65536' vram='32768' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>

Domain sle15 XML configuration edited.

dlp:~ #
virsh start sle15

Domain sle15 started
[4] By the way, if you'd like to enable SPICE on initial creating of virtual machine, specify like follows. Then, it's possible to install Systems with SPICE which requires GUI like Windows without installing Desktop Environment on KVM Host computer.
dlp:~ #
virt-install \
--name Win2k12R2 \
--ram 6144 \
--disk path=/var/kvm/images/Win2k12R2.img,size=100 \
--vcpus=4 \
--os-type windows \
--os-variant=win2k12r2 \
--network bridge=br0 \
--graphics spice,listen=,password=password,keymap=ja \
--video qxl \
Matched Content