1.虚拟机使用vnc
(1)配置Esxi
1)ssh登录主机
2)添加配置
[root@localhost:~] cd /etc/vmware/firewall
[root@localhost:/etc/vmware/firewall] vi /etc/vmware/firewall/vnc.xml
<ConfigRoot>
<service>
<id>VNC</id>
<rule id = '0000'>
<direction>inbound</direction>
<protocol>tcp</protocol>
<porttype>dst</porttype>
<port>
<begin>5900</begin>
<end>5910</end>
</port>
</rule>
<rule id = '0001'>
<direction>outbound</direction>
<protocol>tcp</protocol>
<porttype>dst</porttype>
<port>
<begin>0</begin>
<end>65535</end>
</port>
</rule>
<enabled>true</enabled>
<required>false</required>
</service>
</ConfigRoot>
3)检查规则是否生效成功,生效显示vnc true
esxcli network firewall refresh
esxcli network firewall ruleset list | grep VNC
(2)虚拟机使用vnc配置
选择虚拟机=》编辑=》虚拟机选项=》高级=》配置参数=》添加参数
RemoteDisplay.vnc.enabled = "true" RemoteDisplay.vnc.password = "123456" RemoteDisplay.vnc.port = "5900"