vmware之VMware Remote Console (VMRC) SDK(一)
通过console可以实现类似远程桌面的功能,但它的实现方式和远程桌面不同,一般来说远程桌面必须要有网络支持,在机器关闭或者启动过程中无法连接。而console是通过esx的虚拟化组件实现远程桌面。在其sample代码中有一个用html+js编写ActiveX插件的示例。
下方是一个用winform写的console远程截图。
在vmware的developer center中https://developercenter.vmware.com/sdks,下载vmrc sdk,它会以com组件的形式安装,你可以在vs工具箱中找到。
下面上一段sample代码
using System;
using System.Linq;
using System.Windows.Forms; using Vim25Api;
using AppUtil; namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public AppUtil.AppUtil util = null; public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
String[] arguments = new string[] {
"--url", "https://192.168.0.161/sdk",
"--username","root",
"--password","P@ssw0rd",
"--disablesso", "true",
"--ignorecert", "true"};
try
{
this.axVMwareEmbeddedRemoteConsole1.startup(, VMwareRemoteConsoleTypeLib.VMRC_MessageMode.VMRC_DIALOG_MESSAGES, null); util = AppUtil.AppUtil.initialize("Connect", constructOptions(), arguments.ToArray());
util.connect(); ManagedObjectReference mor = util.getConnection().ServiceRef;
ManagedObjectReference sessionMor = util._connection.Service.RetrieveServiceContent(mor).sessionManager;
string ticket = util._connection.Service.AcquireCloneTicket(sessionMor);
ManagedObjectReference vmMor = util.getServiceUtil().GetDecendentMoRef(null, "VirtualMachine", "test"); axVMwareEmbeddedRemoteConsole1.connect("192.168.0.161", null, true, ticket, null, null, vmMor.Value, null, null);
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString()); this.axVMwareEmbeddedRemoteConsole1.disconnect();
util.disConnect();
}
}
private static OptionSpec[] constructOptions()
{
OptionSpec[] useroptions = new OptionSpec[];
useroptions[] = new OptionSpec("url", "String", , "ser url", null);
useroptions[] = new OptionSpec("username", "String", , "user name", null);
useroptions[] = new OptionSpec("password", "String", , "password", null);
useroptions[] = new OptionSpec("disablesso", "bool", , "disablesso", null);
useroptions[] = new OptionSpec("ignorecert", "bool", , "ignorecert", null);
return useroptions;
} private void button2_Click(object sender, EventArgs e)
{
axVMwareEmbeddedRemoteConsole1.disconnect();
util.disConnect();
}
}
}
在建立connect连接时,有几个重要的参数
url为https://主机ip/sdk,登录帐号也是主机esx的帐号。
disablesso表示禁用sso单点登录验证,这个要加上,因为在我们远程登录验证不会使用sso。
ignorecert这个参数也要加上,不然会证书验证导致The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
这些参数如何运作可以到vsphere sdk中的apputil项目下找到。
vmware之VMware Remote Console (VMRC) SDK(一)的更多相关文章
- vmware之VMware Remote Console (VMRC) SDK(二)
在上篇文章中,我们用winform结合vmware的api做了一个demo,在vmrc sdk中作为plugin单独打包出来vmware-vmrc-win32-x86.exe,上篇文章的demo只能基 ...
- vmware之VMware Remote Console (VMRC) SDK(三)
前两节我们介绍了vmrc sdk的基本用法.在前面的demo中,有一个关键的问题是,我们现在所作的工作都是基于局域网的,作为应用层面上,主机不会直接暴露给用户,而是通过一系列的web service服 ...
- VMware实现控制台功能(VMware Remote Console)
说明: 刚开始一脸懵逼,google了一些资料,发现基本没有能快速落地的,自己做完后梳理了一下发上来供大家参考. 如果帮到你了,请点赞评论关注,以资鼓励,多谢~ 实现VMware控制台功能主要有两种方 ...
- VMware vSphere Client5.0与 Windows8不再有问题,解决VMware 5.0 客户端提示VMRC控制台的连接已断开
问题:VMware 5.0 客户端提示VMRC控制台的连接已断开...正在尝试重新连接,系统是win8的 网上解决办法: WIN8,在安装vmware vsphere client 5.0时出现兼容性 ...
- 通过IMM With Remote Console为服务器安装操作系统
现有IBM System x3750 M4(8722A1C)配置 产品类别 机架式 产品结构 2U CPU类型 Intel 至强E5-4600 CPU型号 Xeon E5-4640 CPU频率 2 ...
- VMware workstation创建虚拟机console
1. 使用VMware workstation创建虚拟机硬件2. 安装操作系统3. 操作系统安装过程 1. 使用VMware workstation创建虚拟机硬件 使用VMware workstati ...
- VMware workstation创建虚拟机console图文
1. 概述2. 配置入口3. 新建虚拟机向导3.1 类型配置3.2 硬件兼容性3.3 操作系统安装3.4 客户机操作系统类型3.5 客户机的名称位置4. 客户机硬件配置选择4.1 客户机处理器配置4. ...
- vmware开发包之vSphere Management SDK
vSphere Management SDK关于vmware管理等相关功能的.net和java的代码示例. 在其5.5的解压包中 eam:esx agent management表示esx虚机生产环境 ...
- VMware vCenter重置web console SSO登录密码
On a Windows Platform Services Controller or vCenter Server with Embedded Platform Services Controll ...
随机推荐
- 函数~匿名方法~lambda的逐渐过渡思想
前提:基于委托实现 (1)使用函数名称 delegate void Printer(string s);//(1)申明委托 static void Main(string[] args) { //(3 ...
- 使用JAVA爬取京东商品价格
有一件物品,你想看看它在京东下所有搜索结果的价格,要怎么办呢? 京东这个网站还是很好爬的,所有价格信息都写在了Html里面,而且跳到第二页之后,url也是有规律的,基本没有什么技术难度. 例如:想找i ...
- 解决办法 Field userService in com.sxsj.controller.RegistLoginController required a bean of type
转自:https://blog.csdn.net/awmw74520/article/details/82687288 APPLICATION FAILED TO START Error starti ...
- UML建模之时序图(Sequence Diagram)<转>
UML建模之时序图(Sequence Diagram) 一.时序图简介(Brief introduction) 二.时序图元素(Sequence Diagram Elements) 角色(Acto ...
- STL源码剖析之组件
本篇文章开始,进行STL源码剖析的一些知识点,后续系列笔记全是参照<STL源码剖析>进行学习记录的 STL在现在的大部分项目中,实用性已经没有Boost库好了,毕竟STL中仅仅提供了一些容 ...
- 从一个子视图或者一个View中刷新其他UITableView
被问到了一个问题:如何从一个子视图或者一个View中刷新其他UITableView,常规的写法可能是这样的 TestTVC*testTVC =[[TestTVC alloc] init];[testT ...
- c3p0、dbcp和proxool比较
现在常用的开源数据连接池主要有c3p0.dbcp和proxool三种,其中: hibernate开发组推荐使用c3p0; spring开发组推荐使用dbcp(dbcp连接池有weblogic连接池同样 ...
- Linux实战教学笔记52:GlusterFS分布式存储系统
一,分布式文件系统理论基础 1.1 分布式文件系统出现 计算机通过文件系统管理,存储数据,而现在数据信息爆炸的时代中人们可以获取的数据成指数倍的增长,单纯通过增加硬盘个数来扩展计算机文件系统的存储容量 ...
- apply-register-acl 参数允许FreeSWITCH分机注册/拨打不验证密码
今天调试 发现 注册的分机 的 `Auth-User` 居然是 `unknown` !!! 怎么回事? 仔细对比检查 发现, internal profile 指定了 `apply-register- ...
- Binormal - 副法线
[Binormal - 副法线] Binormal是垂直于Normal.Tangent平面的直线.Normal.Binormal.Tangent三条线构成一个坐标系. 参考:http://202.11 ...