如何在 vmware esxi 5.5 中开放 VNC 端口
1、编辑/etc/vmware/firewall/service.xml vi /etc/vmware/firewall/service.xml  2、在该文件重中倒数第二行开始添加以下内容： !-- Firewall configuration information for VNC -- service id='0040' idVNC/id rule id='0000' directioninbound/direction protocoltcp/protocol porttypedst/porttype port begin40000/begin end60000/end /port /rule enabledtrue/enabled requiredfalse/required /service  3、执行以下命令以使配置文件生效： esxcli network firewall refresh 4、查看时候已经生效： esxcli network firewall rulese
VNC
1、编辑/etc/vmware/firewall/service.xml vi /etc/vmware/firewall/service.xml  2、在该文件重中倒数第二行开始添加以下内容： !-- Firewall configuration information for VNC -- service id='0040' idVNC/id rule id='0000' directioninbound/direction protocoltcp/protocol porttypedst/porttype port begin40000/begin end60000/end /port /rule enabledtrue/enabled requiredfalse/required /service  3、执行以下命令以使配置文件生效： esxcli network firewall refresh 4、查看时候已经生效： esxcli network firewall rulese
![](/data/attachment/album/201506/18/154855fksg81zozwcpwoph.png)


1、编辑/etc/vmware/firewall/service.xml 



```
vi /etc/vmware/firewall/service.xml 
```

2、在该文件重中倒数第二行开始添加以下内容：



```
<!-- Firewall configuration information for VNC --> 
<service id='0040'>
    <id>VNC</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>
        <begin>40000</begin>
        <end>60000</end>
      </port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
 </service> 
```

3、执行以下命令以使配置文件生效：



```
esxcli network firewall refresh
```

4、查看是否已经生效：



```
esxcli network firewall ruleset list | grep VNC
VNC                  true
```
