Accessing your RHEV VMs with your iPad and Spice!

A friend of mine sent me a link to a new project that aim to provide a HTML5 client for the Spice protocol (http://www.spice-space.org/page/Html5). He asked me to check if I can access my VMs under RHEV with my iPad.

The page above describe the steps required to connect to a standalone Spice server. Unfortunately, I didn’t find any information about how to connect to a VM running in RHEV. The problem is that you cannot find the address, port and password to connect to the Spice console in the RHEV-M interface. After a bit of research, I found that all the information is there, you just have to search a little bit to get it. Here is the step from the beginning :

  • Download the Spice HTML5 client on a server that run Apache (or any other web server) using :
  • You can also use the one hosted directly on the Spice project at : http://spice-space.org/spice-html5/spice.html
  • On your RHEV server (it should be possible to run this elsewhere), download websockify using :
  • Be sure that the VM you want to connect is using Spice as it’s console protocol. You can verify using the RHEV-M interface.
  • Now, run the RHEV CLI console (you must have rhevm-cli package installed) using :
    • rhevm-shell --url https://your_rhev.server.com --user admin@internal --password your_passwd --ca-file /etc/pki/ovirt-engine/ca.pem
  • In the console, run the following command to obtain information about the VM you want to connect :
    • show vm your_vm_name
  • You should check for the following key in the output (id is the VM uuid) :
    • id : d1980fd0-5cd5-4971-8ef8-974c2e14b0c5
    • display-port : 5900
    • display-secure_port : 5901
    • display-type : spice
    • host-id : e992a3aa-64c4-11e2-a9d3-0800270e7f13

  • After that, run the following command, using the host-id you just got above :
    • show host e992a3aa-64c4-11e2-a9d3-0800270e7f13
  • You should check for the following key in the output :
    • name : your_host_name
  • You now know on which host your VM run. Now, leave the RHEV CLI console open as we will need it in a moment.
  • Connect to the server you put websockify on, change to it’s folder and run the following command (replace with the DNS or IP of the host that run your VM and the secure port gathered above) :
    • ./websockify.py 5959 --ssl-target your_host_name_dns_or_ip:5901
  • This will open websockify and listen on port 5959. Be sure that your firewall allow connection to be made on this port. Also, we use the “–ssl-target” because we want to connect to the secure port. Now, go back to the RHEV CLI console and run the following command :
    • action vm your_vm_name ticket
  • And watch for the following output :
    • ticket-expiry: 7200
    • ticket-value : EulAFfVi17LB
  • The number 7200 is the time that the ticket is valid in seconds.
  • Now, we have all the pieces. Open a web brower on your iPad (or any other browser) and go to the Spice HTML5 client downloaded previously (or use the one on the Spice project). Enter the DNS or IP of the server that run websockify, enter 5959 for the port and enter the ticket-value we just got above for the password. Click start and you should normally have a Spice console for your VM just there!

That’s it, you can now use your VM on your iPad directly from a web browser! I only have VM running in text console, so I didn’t test running a GUI on the iPad. For the text console, the only problem is that the keyboard don’t come up when you click inside the terminal. This can be solved by using an external bluetooth keyboard.

I must give credit to the following pages for helping me to put all of this together :

  1. http://www.ovirt.org/How_to_Connect_to_SPICE_Console_Without_Portal
  2. http://www.spice-space.org/page/Html5

One thought on “Accessing your RHEV VMs with your iPad and Spice!

  1. 🙂

    Nice.
    For the ‘nonApple’-users on Androidish tablets : there are spice clients running like a charm, and then no need for the websockifiy …… although there is nothing more sexy than running desktops via browser🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s