spice and desktop virtualization - kraxel · 2011-05-10 · 6 spice and desktop virtualization |...

25
SPICE and desktop virtualization | Gerd Hoffmann 1 SPICE and desktop virtualization Gerd Hoffmann <[email protected]> Red Hat LinuxTag, May 11th

Upload: others

Post on 19-Feb-2020

6 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann1

SPICE and desktop virtualization

Gerd Hoffmann <[email protected]>Red HatLinuxTag, May 11th

Page 2: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann2

What is SPICE

● Simple Protocol for Independent Computing Environments

● Virtual desktop infrastructure● SPICE network protocol.● Virtual hardware (QXL).● Server and client implementations.

Page 3: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann3

SPICE history

● Created by Qumranet.● Startup company which created KVM.● Acquired by Red Hat.

● freedesktop.org project since January 2010.

● SPICE support merged into qemu during 0.14 development cycle.

Page 4: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann4

Server and desktop virtualization

● Server virtualization is commonplace these days, every hoster has offers.

● Virtual machine.● CPU & memory.● Storage.● Network.

● Administrator access.● Text mode (ssh, serial line).● Low end graphics (vnc).

● For desktop virtualization you need more ...

Page 5: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann5

Wanted: better graphics

● Powerful graphics● ideally 3D which is good enough for desktop effects.

● gnome shell● windows aero

● Multihead support.

Page 6: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann6

SPICE: QXL graphics adapter

● Virtual PCI Device.

● Two variants, with and without VGA compatibility, for multihead.

● 3D support not yet available.

VGA framebuffer (8M)

cmd rings, control fields (8k)

bar 0ram rendering commands,

command data

bar 1vram

surfaces:

offscreen pixmaps(textures)

bar 2rom

qxl device info (8k)

bar 3io

initialization + reset

Page 7: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann7

SPICE: QXL rendering

QEMU VM

Guest

spiceclient

QXL spiceserver display

cursorlfb renderer renderer

vnc / sdl

Page 8: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann8

Wanted: multimedia

Page 9: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann9

SPICE: sound + video

● Sound forwarding.

● Video stream support.● Recognized by screen update patterns.

● Time stamps for synchronization.

Page 10: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann10

QEMU: audio devices

● Intel HDA support (merged in 0.14).● Fix Win7 64bit sound issue.

● Experimental USB audio bits (not merged).

Page 11: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann11

Wanted: Desktop Integration.

● Resize guest display.

● Cut+paste.

● Needs guest cooperation.

Page 12: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann12

SPICE: vm channel & guest agent

● Channel between guest and spice client.● Nowdays a virtio-serial port.● Used to be a PCI device.

● Provides additional features when the agent is installed and active in the guest.

● Guest Display configuration (including multihead).● Cut+paste support.● Absolute mouse events without USB tablet.

Page 13: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann13

Wanted: USB support

Page 14: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann14

SPICE: USB forwarding

● Remote USB protocol (currently in development).

● Will also be usable without SPICE.

Page 15: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann15

QEMU: USB needs some love

● Add physical port handling (started in 0.14).

● savevm / migration support (started in 0.14).

● Remote wake-up support (merged in 0.14).● Fix CPU burning.● Needs guest help.

● Get ready for USB 2.0 and 3.0 (started in 0.14).● Fix, improve and cleanup the USB subsystem.● Finally merge EHCI support.

● Improve isochronous xfers support (started in master).

Page 16: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann16

Wanted: printing

● Print to the printer next to you, not the one in the server room or data center.

Page 17: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann17

SPICE: network tunneling

● Allow guests to access network ressources (i.e. printers) in the client network.

● Experimental, off by default.● Configuration & Security issues.

● Need to check out other options.● USB Printer?● Cloud printing?

Page 18: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann18

Big picture: Network protocol & Guest devicesQEMU VM

spice client

QXL(cirrus)virtio-serial

ES1370AC97HDA

KeyboardMouseTablet

USBDevices

vmc

Guest

vdagent qxl driver standard guest drivers

user's machine

displaycursor

inputsrecord

playbacksmartcard

usb forward

spice server

main

Page 19: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann19

Integrate SPICE

● New spice-gtk client project.● libraries with glib objects and gtk widgets.● gtk-based client application “spicy”.

● virt-manager supports spice (0.8.7+).

● vinagre supports spice (3.0).

Page 20: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann20

Getting started

● Easy way: Fedora 15 & virt-manager.

● Starting qemu + client manually:● qemu command line:qemu -vga qxl -usbdevice tablet \ -spice port=1234,disable-ticketing

● classic spice client command line:spicec -h localhost -p 1234

● spicy: Just start it, comes up with a dialog.Command line options work too.

Page 21: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann21

Enable TLS, server side

● qemu -readconfig spice.cfg

[spice] port = "5920"# disable-ticketing = "on" password = "secret"

tls-port = "5921" x509-cacert-file = "/home/kraxel/mini-ca/data/ca.crt" x509-cert-file = "/home/kraxel/mini-ca/rincewind.crt" x509-key-file = "/home/kraxel/mini-ca/rincewind.key" tls-channel = "main" tls-channel = "inputs" plaintext-channel = "display"

Page 22: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann22

Enable TLS, client side

● spicy -h rincewind.home.kraxel.org \ -p 5920 -s 5921 -w secret \ --ca-file /home/kraxel/mini-ca/data/ca.crt

● CA certificate can also be copyed / symlinked to$HOME/.spicec/spice_truststore.pem

Page 23: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann23

Enable agent, qemu config

● qemu -readconfig vmchannel.cfg

[chardev "vmchannel"] backend = "spicevmc" name = "vdagent"

[device] driver = "virtio-serial"

[device] driver = "virtserialport" name = "com.redhat.spice.0" chardev = "vmchannel"

Page 24: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann24

Enable agent, guest setup

● Windows● Fetch vdagent.zip from spice-space.org, unpack

somewhere.● Run vdservice install

● Fedora 14+15, RHEL 6.1● yum install spice-vdagent

● Other Linux guests:

● Get the bits fromhttp://cgit.freedesktop.org/spice/linux/vd_agent/

Page 25: SPICE and desktop virtualization - kraxel · 2011-05-10 · 6 SPICE and desktop virtualization | Gerd Hoffmann SPICE: QXL graphics adapter Virtual PCI Device. Two variants, with and

SPICE and desktop virtualization | Gerd Hoffmann25

Ressources

● http://www.kraxel.org/slides/2011-linuxtag-spice.pdf

● www.spice-space.org● Wiki, docs, downloads.

[email protected]

● cgit.freedesktop.org● Most git repositories are in the spice section.● The X11 qxl driver is in the x.org drivers section.

● http://gitorious.org/spice-gtk