Use vnc to manage virtual machines through esxi

Foreword: Existing requirements, I have a virtual machine in my virtualization, this virtual machine has ipv4 and ipv6 network environment, in order to prevent network disorder, disable its ipv4 service and only use ipv6, so there is a problem, how to to manage this ipv6 machine in an ipv4 environment? Finally found a solution on the Internet, which enables us to jump to the virtual machine through esxi when using the vnc tool to connect.

1. First, turn on the ssh function of the esxi host, configure-security configuration file-properties-ssh.
Insert picture description here
2. After logging in to the host with SSH, create a new vnc firewall rule

[root@localhost:~] cd /etc/vmware/firewall
[root@localhost:/etc/vmware/firewall] ls
fdm.xml         service.xml     vsanhealth.xml
#新增规则配置文件vnc.xml
cat >>/etc/vmware/firewall/vnc.xml<<EOF
<!-- FirewallRule for  VNC Console--> 
<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>
EOF

3. esxi refresh firewall rules

esxcli network firewall refresh
#检查规则是否生效,生效显示true
esxcli network firewall ruleset list | grep VNC

4. Add configuration parameters to the virtual machine
Insert picture description here
Insert picture description here

#添加3行参数参数
RemoteDisplay.vnc.enabled= true     
RemoteDisplay.vnc.password=<password>
RemoteDisplay.vnc.port= <port>
#RemoteDisplay.vnc.password后面输入设置连接vnc的密码
#RemoteDisplay.vnc.port后面设置连接vnc的端口

5. Use vnc viewer to connect. The
connection address ip is the esxi host ip, and the port is the port number set by RemoteDisplay.vnc.port.
Insert picture description here
Reference blog: https://blog.51cto.com/68240021/1970732

Guess you like

Origin blog.csdn.net/qq_43316775/article/details/111314838