Cross-Platform KVM with vPro using our Java Library

If you are wanting to  exploit the powers of Intel® Active Management Technology across multiple platforms (linux distros, Windows) you are probably looking for ways to do this using Java.

For quite some time we have had the Intel® WS_Management Java Client Library available on our Manageability Community. Let me first introduce this library in case it is new to you:

The Intel® WS-Management Java Client Library is a lightweight WS-Management protocol library designed for software developers who want to quickly and easily support WS-Man but want to avoid the complexity of writing their own Java based WS-Man client library.  The library's original intention was to support Intel® Active Management Technology  development, but can be extended to support management of any CIM resource.    This Java Library is  100% pure java code (no JNI).  It exposes late-binding WS-Man API.  It supports both Digest and Kerberos authentication; http and https connections and has a full set of sample code and JavaDocs.

The Java Client Library currently  contains the following samples:

    • Agent Presence (Local Host)

    • Agent Presence (Remote Configuration Sample)

    • Alarm Clock

    • AMT Version

    • Audit Log

    • Discovery

    • Hardware Asset

    • Remote Control

    • Security Admin

    • Storage

    • Version

But wait a minute!  Where is the KVM Sample??  I thought that since we did not offer a KVM sample, Intel AMT Developers might get some value from this blog if it were to contain some snippets showing how to  manage KVM redirection from this Java Library.   Hopefully this will help you get going with implementing KVM via the Javalibs!  So here they are:

//Snippet to Enable Redirection in general (required to enable KVM Service Access Point)

ManagedReference refToService = connection.newReference("AMT_RedirectionService");

// Enable the Redirection Listener (required to do redirection)

ManagedInstance serviceObj = refToService.get();



//Enable IDER/SOL interfaces

ManagedInstance inputObj = refToService.createMethodInput("RequestStateChange");

inputObj.setProperty("RequestedState", "32771");

//32771=enables both IDER and SOL

ManagedInstance outObj = kvmRef.invoke(inputObj);

String result = outObj.getProperty("ReturnValue").toString();

//"0" means OK

// non zero means error (see SDK docs)

//Snippet to enable KVM Service Access Point

//Get a reference to the CIM_KVMRedirectionSAP ManagedReference

refToService = connection.newReference("CIM_KVMRedirectionSAP");

refToService.addSelector("Name", "KVM Redirection Service Access Point");

ManagedInstance inputObj = refToService.createMethodInput("RequestStateChange");

inputObj.setProperty("RequestedState", "2");


ManagedInstance outObj = refToService.invoke(inputObj);

String result = outObj.getProperty("ReturnValue").toString();

//"0" means OK

// non zero means error (see SDK docs)

//Snippet to enable Set KVM session Paramaters

ManagedReference refToSettings = connection.newReference("IPS_KVMRedirectionSettingData");

ManagedInstance settingsObj = refToSettings.get();

settingsObj.setProperty("DefaultScreen", "1");

settingsObj.setProperty("SessionTimeout", "60");

//Set to true if you want to use VNC port instead of AMT Redirection proxy ports

settingsObj.setProperty("Is5900PortEnabled", "true");

// only need to set RFBPassword if using VNC Port

settingsObj.setProperty("RFBPassword", "P@ssw0rd");

settingsObj.setProperty("OptInPolicy", "true");

//Must have PTAdmin realm to disable OptIN

settingsObj.setProperty("OptInPolicy", "false");

settingsObj.setProperty("OptInPolicyTimeout", "300")



So there you have the whole story.  Let us know if this helps with your KVM development via Intel® Active Management Technology and also if you find this library to be of value to the developer who must write code across various platforms!

For more complete information about compiler optimizations, see our Optimization Notice.