vncsnapshot on XenServer - How to take a screenshot of a virtual machine from one XenServer host - Developer to Developer

8:51 PM
vncsnapshot on XenServer - How to take a screenshot of a virtual machine from one XenServer host - Developer to Developer -

There are many tools available on Citrix XenServer that are useful to system administrators and QA analysts looking to automate scripts and running tests on XenServer.

These third-party tools are generally not officially supported as part of the distribution of products namely Citrix XenServer we can not guarantee their permanent availability and provide support for bugs or defects in tools. As such these tools are often undocumented and I am learning new all the time.

In practice, these tools can be very useful and are of great quality. This week I saw my colleague Robert using a small tool rather cute (of vncsnapshot) for the script taking screenshots of the screen, the user sees in a VM host. Our own QA department use to automatically collect the particular certification results when running a large number of virtual machines on a host, and it struck me that others might be interested.

Most of XenServer VM times have a VNC flow. Another of my colleagues wrote a blog about using VNC to connect to XenServer that provides useful context, it is available here, and also describes how to do it remotely through a tunnel. (When GPU pass-through is being VNC feed use is generally disabled then I fear that this technique does not work, but it should work with vGPU.)

Key controls are:

 xe vm-list params = dom-id name-label =  

to give you the domain ID.

 xenstore read / local / domain /  / console / VNC port 

gives you the VNC port. Subtract 500 for the VNC display number to use in order vncsnapshot thus:

 vncsnapshot localhost:  test.jpg 

Example:

 [root@test58 dev] # xe vm-list params = dom-id name-label = xenrt-iscsi-target dom-id (RO) 1 [root@test58 dev] # xenstore-reading / / area / 1 / console / local VNC port 502 

Subtract 500, gives a VNC display number 2 that can now be provided utility vncsnapshot

 [root@test58 dev] # vncsnapshot localhost: 2 test.jpg VNC server supports version 3.3 of the protocol (viewer 3.3) No authentication required name Desktop "XenServer Virtual Terminal" Connected the VNC server, using the default format version 3.3 protocol VNC server: 8 bits per pixel true color. max 7 red green blue 7 3 redshift 5 green blue 2 0 32 bits per pixel. significant byte first in each pixel. True color: red green max 255 255 255 blue, red shift 0 8 green 16 blue same machine: preferring saved encoding picture crude (local host) 640x384 screen test.jpg using 640x384 + 0 + 0 rectangle [root@test58 dev] # 

If you are interested in writing your own scripts to automate tasks or custom tests for your own installation of XenServer it is useful to remember that you also have the option use the XenServer PowerShell cmdlets (or XenServer C, C #, Java or python API) and also integrate your scripts in the XenCenter GUI via XenCenter plugins. PowerShell is a particularly popular choice with XenDesktop administrators

I also recommend watching my colleague Jesse's blog. Jesse is a support ninja who often blogs about scripts and tools available on XenServer and other Citrix products.

Previous
Next Post »
0 Komentar