Intel AMT - enable vnc via linux

Solution 1:

We have need of this as well, and found what to do. Basically, you need to use the wsmancli (Cross-Vendor Web-Services Management API) package to assist you. I've included a template script to get you going. There are other utilities to operate with WS Management, search around if interested.

Install on Ubuntu:

sudo apt-get install wsmancli

After Installed:

ip=<IP of AMT>    
AMT_PASSWORD="<your password for the 'admin' user>"

# Must be exactly *8 characters long* and contain at least one of each:
#   [ lower case, upper case, number, special character ]
VNC_PASSWORD="<what password you want for VNC>"


# Enable KVM
wsman put http://intel.com/wbem/wscim/1/ips-schema/1/IPS_KVMRedirectionSettingData -h $ip -P 16992 -u admin -p ${AMT_PASSWORD} -k RFBPassword=${VNC_PASSWORD}

# Enable KVM redirection to port 5900
wsman put http://intel.com/wbem/wscim/1/ips-schema/1/IPS_KVMRedirectionSettingData -h $ip -P 16992 -u admin -p ${AMT_PASSWORD} -k Is5900PortEnabled=true

# Disable opt-in policy
wsman put http://intel.com/wbem/wscim/1/ips-schema/1/IPS_KVMRedirectionSettingData -h $ip -P 16992 -u admin -p ${AMT_PASSWORD} -k OptInPolicy=false

# Disable session timeout
wsman put http://intel.com/wbem/wscim/1/ips-schema/1/IPS_KVMRedirectionSettingData -h $ip -P 16992 -u admin -p ${AMT_PASSWORD} -k SessionTimeout=0

# Enable KVM
wsman invoke -a RequestStateChange http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_KVMRedirectionSAP -h ${ip} -P 16992 -u admin -p ${AMT_PASSWORD} -k RequestedState=2