Blog

  • Home
  • Blog
  • Using Spice console in Openstack for managing guests

Using Spice console in Openstack for managing guests

Category: Networking Author: Martin Ivanov Posted: 16 Jul 2018 0 Comments

Benefits

Spice has following benefits, compared to VNC as protocol to access the guest VM console.

  • Copy & Paste of text and images between the guest and client machine

  • Automatic adjustment of resolution when the client screen changes - e.g. if you make the Spice console full screen the guest resolution will adjust to match it rather than letterboxing.

  • Better mouse integration - The mouse can be captured and released without needing to click inside the console or press keys to release it. The performance of mouse movement is also improved.

  • Overall works faster and smoother compared to VNC

Installation

Assuming you have installed Openstack controller and compute (the tests were done on Ocata version,but should work on newer too).

Controller node:

Install following packages from your distro repository:

nova-spiceproxy spice-html5

Spice-html5 is the Spice javascript client, that will appear in the Dashboard of the Controller UI. Nova spiceproxy is simiar to the novnc proxy- will proxy the spice session to the compute.

The service nova-spiceproxy shall be enabled:

systemctl enable openstack-nova-spicehtml5proxy.service

If VNC was used, it should get disabled:

systemctl disable openstack-nova-novncproxy.service

On compute node:

Install from your distro package repository:

spice-server

Configuration

Controller node, /etc/nova/nova.conf:

[DEFAULT]
vnc_enabled= False
novnc_enabled= False
web=/usr/share/spice-html5
...

[vnc]
enabled = False
...

[spice]
enabled = True
html5proxy_host = 0.0.0.0 #address on which spice proxy will accept connections
html5proxy_port = 6082 #port on which spice proxy will accept connections
keymap = en-us


Compute node, /etc/nova/nova.conf:

[vnc]
enabled = False
...

[spice]
enabled = True
html5proxy_base_url = https://10.3.73.94:6082/spice_auto.html # The URL on the controller ,where the spice console will be opened
keymap = en-us
server_listen = 0.0.0.0 # Address of the Compute, where the SPICE server running on the instances should listen
server_proxyclient_address = $my_ip #The address used by nova-spicehtml5proxy client,on controller, to connect to instance console.

Usage

Once all relevant nova services are (re)started and VMs launched, the horizon will show spice console.

Small demo can be seen here.





Copy and paste between guest and host terminal is possible, but it is not supported on the spice-html5 client (more info here)

Other clients, such as remote-viewer are supporting shared clipboard.

It can be run like that:

remote-viewer spice://10.3.73.94:5900

Where the IP address is of the compute and the port is the SPICE server port, as libvirt has it configured.

The port can be seen on the compute:

[root@embeddedboxpc500069kkvd2 nova]# virsh list
Id Name State
----------------------------------------------------
10 instance-0000000a running

[root@embeddedboxpc500069kkvd2 nova]# virsh qemu-monitor-command instance-0000000a --hmp info spice
Server:
address: 0.0.0.0:5900
migrated: false
auth: none
compiled: 0.12.8
mouse-mode: client


Here is demo of copy and paste function:




However we must emphasize, that full options of SPICE guest can be utilized, in case the guest has running spice-vdagent service.

Modern recent VMs have it installed and running - for example cloud/live version of Fedora 27. Here is how to see it functioning:

[root@localhost-live liveuser]# rpmquery spice-vdagent
spice-vdagent-0.17.0-4.fc27.x86_64
[root@localhost-live liveuser]# systemctl status spice-vdagentd
● spice-vdagentd.service - Agent daemon for Spice guests
Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.service; enabled; vend
Active: active (running) since Fri 2018-06-29 11:15:17 EDT; 2h 23min left
Process: 920 ExecStart=/usr/sbin/spice-vdagentd $SPICE_VDAGENTD_EXTRA_ARGS (co
Process: 915 ExecStartPre=/bin/rm -f /var/run/spice-vdagentd/spice-vdagent-soc
Main PID: 931 (spice-vdagentd)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/spice-vdagentd.service
└─931 /usr/sbin/spice-vdagentd




leave a comment


blog categories

Send us a message

If you want to say something to us, feel free to do it


I agree with Privacy policy