All Things Xen

General ramblings regarding Citrix XenServer & its open source counter part.

VGA over Cirrus in XenServer 6.2

Achieve Higher Resolution and 32Bpp

For many reasons – not exclusive to XenServer – the Cirrus video driver has been a staple wherein a basic/somewhat agnostic video driver is needed.  When one creates a VM within XenServer (specifically 6.2 and previous versions) the Cirrus video driver is used by default for video...and it does the job.

I had been working on a project with my mentor related to an eccentric OS, but I needed a way to get more real-estate to test a HID pointing device by increasing the screen resolution.  This led me to find that at some point in our upstream code there were platform (virtual machine metadata) options that allowed an one to "ditch" Cirrus and 1024x768 resolution for higher resolutions and color depth via a standard VGA driver addition.

This is not tied into GPU Pass through nor is it a hack.  It is a valuable way to achieve 32bpp color in Guest VMs with video support as well as obtaining higher resolutions.

Windows 7: A Before and After Example

To show the difference between "default Cirrus" and the Standard VGA driver (which I will discuss how to switch to shortly), Windows 7 Enterprise had the following resolution to offer me with Cirrus:


Now, after switching to standard VGA for the same Guest VM and rebooting, I now had the following resolution options within Windows 7 Enterprise:

Switching a Guest for VGA

After you create your VM – Windows, Linux, etc – perform the following steps to enable the VGA adapter:

 

  • Halt the Guest VM
  • From the command line, find the UUID of your VM:
 xe vm-list name-label=”Name of your VM”
  • Taking the UUID value, run the following two commands:
 xe vm-param-set uuid=<UUID of your VM> platform:vga=std
 xe vm-param-set uuid=<UUID of your VM> platform:videoram=4
  •  Finally, start your VM and one should be able to achieve higher resolution at 32bpp.

 

It is worth noting that the max amount of "videoram" that can be specified is 16 (megabytes).

Switching Back to Cirrus

If – for one reason or another – you want to reset/remove these settings as to stick with the Cirrus driver, run the following commands:

 xe vm-param-remove uuid=<UUID of your VM> param-name=platform param-key=vga
 xe vm-param-remove uuid=<UUID of your VM> param-name=platform param-key=videoram

Again, reboot your Guest VM and with the lack of VGA preference, the default Cirrus driver will be used.

What is the Catch?

There is no catch and no performance hit.  The VGA driver's "videoram" specification is carved out of the virtual memory allocated to the Guest VM.  So, for example, if you have 4GB allocated to a Guest VM, subtract at max 16 megabytes from 4GB.  Needless to say, that is a pittance and does not impact performance.

Speaking of performance, my own personal tests were simple and repeated several times:

 

  • Utilized a tool that will remain anonymous
  • Use various operating systems with Cirrus and resolution at 1024 x 768
  • Run 2D graphic test suite
  • Write down Product X, Y, or Z’s magic number that represents good or bad performance
  • Apply the changes to the VM to use VGA (keeping the resolution at 1024 x 768 for some kind of balance)
  • Run the same volley of 2D tests after a reboot
  • Write down Product X, Y or Z’s magic number that represents good or bad performance

 

In the end, I personally found from my experience that there was a very minor, but noticeable difference in Cirrus versus VGA.  Cirrus usually came in 10-40 points below VGA at the 1024 x 768 level.  Based on the test suite used, this is nothing spectacular, but it is certainly a benefit as I found no degraded performance across XenServer (other Guests), etc.

I hope this helps and as always: questions and comments are welcomed!

 

--jkbs | @xenfomation

 

Increasing Ubuntu's Resolution
Security bulletin covering "Shellshock"

Related Posts

 

Comments 4

Guest - Chris Beasley on Friday, 10 October 2014 22:52

Pretty cool. Does this work for the Creedence beta's too?

When passing through a physical GPU to a VM, it is possible to remove the in-built VGA adaptor? This makes it easier when in Windows otherwise you have to change the primary display before you can do much with the card.

1
Pretty cool. Does this work for the Creedence beta's too? When passing through a physical GPU to a VM, it is possible to remove the in-built VGA adaptor? This makes it easier when in Windows otherwise you have to change the primary display before you can do much with the card.
JK Benedict on Saturday, 11 October 2014 22:50

Hey, Chris!!

Excellent questions!

So - I think I need to clear up my poor use of words: more importantly, tying words together. :D

Yup! This was tested and is completely usable in Creedence. In fact, Windows 8.x and a few other VMs have these options enabled by default. VGA and Cirrus options have been in the code for a bit and to give quick background, I found these options as I was trolling code to get a very, very obscure OS running.

As for the GPU -- I think it is possible through the Guest VMs device manager to "disable/not use this device". My only concern would be if there were ever problems with the GPU itself and a "faux/pseudo" VGA interface would be needed from XenCenter, etc.

Let me know if this helps and if it doesn't, I will find you answers!

--jkbs | @xenfomation

0
Hey, Chris!! Excellent questions! So - I think I need to clear up my poor use of words: more importantly, tying words together. :D Yup! This was tested and is completely usable in Creedence. In fact, Windows 8.x and a few other VMs have these options enabled by default. VGA and Cirrus options have been in the code for a bit and to give quick background, I found these options as I was trolling code to get a very, very obscure OS running. As for the GPU -- I think it is possible through the Guest VMs device manager to "disable/not use this device". My only concern would be if there were ever problems with the GPU itself and a "faux/pseudo" VGA interface would be needed from XenCenter, etc. Let me know if this helps and if it doesn't, I will find you answers! --jkbs | @xenfomation
Guest - Chris Beasley on Saturday, 11 October 2014 23:03

G'day JK,

Ah I wondered why it was struggling on windows 8 when I tried to make it work, didn't realise it was already active on that template.

With respect to the GPU, you are correct in that disabling in Windows does work... I was more thinking along the lines of ESXi where you can add and remove the default adaptor as necessary... This would allow users to remove the inbuilt adaptor when passing a gpu but then add it again should there be any difficulties with the passthrough... Food for thought I guess!

Cheers,

Chris

0
G'day JK, Ah I wondered why it was struggling on windows 8 when I tried to make it work, didn't realise it was already active on that template. With respect to the GPU, you are correct in that disabling in Windows does work... I was more thinking along the lines of ESXi where you can add and remove the default adaptor as necessary... This would allow users to remove the inbuilt adaptor when passing a gpu but then add it again should there be any difficulties with the passthrough... Food for thought I guess! Cheers, Chris
Guest - Andrew on Tuesday, 16 December 2014 18:46

Hi,

where did you get max videoram is 16MB ? Could you please point to source where I can look up it myself ? I could not find such limit anywhere I looked.

Thanks.

1
Hi, where did you get max videoram is 16MB ? Could you please point to source where I can look up it myself ? I could not find such limit anywhere I looked. Thanks.

About XenServer

XenServer is the leading open source virtualization platform, powered by the Xen Project hypervisor and the XAPI toolstack. It is used in the world's largest clouds and enterprises.
 
Commercial support for XenServer is available from Citrix.