Ubuntu 21.04
Sponsored Link

KVM : SPICE Server2021/05/10

Install Desktop Virtualization "SPICE ( Simple Protocol for Independent Computing Environment )".
It's possible to connect to virtual machines from remote client computer.
[1] Edit existing virtual machine's setting-file and start virtual machine with SPICE like follows.
The 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 graphics, Replace the existing "<graphics>***" and " <video>***" sections to the example below.
# edit the configration of [ubuntu2104]

virsh edit ubuntu2104
<domain type='kvm'>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://ubuntu.com/ubuntu/20.04"/>


    # 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=''/>
      <model type='qxl' ram='65536' vram='32768' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    <rng model='virtio'>
      <backend model='random'>/dev/urandom</backend>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>

Domain 'ubuntu2104' XML configuration edited.

virsh start ubuntu2104

Domain ubuntu2004 started
That's OK, Refer to the next section to connect to SPICE server from SPICE client.
[3] 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.
By the way, if you'd like to use VNC, replace the [spice] word to [vnc].
virt-install \
--name Win2k19 \
--ram 6144 \
--disk path=/var/kvm/images/Win2k19.img,size=100 \
--vcpus 4 \
--os-variant win2k19 \
--network bridge=br0 \
--graphics spice,listen=,password=password \
--video qxl \
--cdrom /tmp/Win2019_JA-JP.ISO
Matched Content