Changing the port used by the vSphere Client to connect directly to the ESX/ESXi host
search cancel

Changing the port used by the vSphere Client to connect directly to the ESX/ESXi host

book

Article ID: 320270

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

By default, the vSphere Client uses HTTP port 80 and HTTPS port 443 to communicate with ESX/ESXi hosts. You can change these ports with these methods:

  • Change the ports configured in proxy.xml on the host.
  • Change the ports configured for the vSphere Client.


Environment

VMware ESX 4.0.x
VMware vSphere ESXi 5.0
VMware ESX 4.1.x
VMware ESXi 4.0.x Installable
VMware ESXi 4.0.x Embedded
VMware ESXi 4.1.x Installable
VMware ESXi 4.1.x Embedded

Resolution

To change the ports configured in proxy.xml:

ESX

  1. Log in to the service console and acquire root privileges.
  2. Change to the /etc/vmware/hostd/ directory.
  3. Edit the proxy.xml file with a text editor, and add these tags under the <ConfigRoot> tag:

    <httpPort>xx</httpPort>
    <httpsPort>xxx</httpsPort>

    where xx is the port you want to use for HTTP traffic and xxx is the port you want to use for HTTPS traffic.

    Example: To configure port 8080 as the port for the HTTP connection, and port 8081 as the port for the HTTPS connection, add these two lines:

    <httpPort>8080</httpPort>
    <httpsPort>8081</httpsPort>


  4. Enter this command to restart the vmware-hostd process:

    service mgmt-vmware restart

ESXi

  1. Run the vifs command to get a copy of the proxy.xml file to edit:

    • For Linux systems, use this command:

      vifs --server <hostname<em>> --username <username<em>> --get /host/proxy.xml <local_directory_path<em>>/proxy.xml

    • For Windows systems, use this command:

      vifs --server <hostname<em>> --username <username<em>> --get /host/proxy.xml <local_directory_path<em>>\proxy.xml
  2. Edit the proxy.xml file with a text editor, and add these tags under the <ConfigRoot> tag:

    <httpPort>xx</httpPort>
    <httpsPort>xxx</httpsPort>

    where xx is the port you want to use for HTTP traffic and xxx is the port you want to use for HTTPS traffic.

    Example: To configure port 8080 as the port for the http connection, and port 8081 as the port for the https connection, add these two lines:

    <httpPort>8080</httpPort>
    <httpsPort>8081</httpsPort>

  3. Run the vifs command to place the proxy.xml file back on the ESXi host:

    • For Linux systems, use this command:

      vifs --server <hostname> --username <username> --put <local_directory_path>/proxy.xml /host/proxy.xml

    • For Windows systems, use this command:

      vifs --server <hostname> --username <username> --put <local_directory_path>\proxy.xml /host/proxy.xml


    Notes:
    • The vifs command requires the remote CLI application to be installed on the Workstation where the CLI is installed. You can download the vSphere Management Assistant (vMA) from theVMware download center .
    • For vSphere 5.0, if the proxy ports are changed, the new ports are not allowed through the ESXi firewall. For information on how to change the firewall ports, see the vSphere Security Guide.
    • Making changes to the ESXi 5.0 firewall currently do not persist after a reboot.

  4. Use the Restart Management Agents operation through the direct console to restart hostd.

To change the ports configured for the vSphere Client in the client configuration file:

  1. On the system where the vSphere Client is installed, edit the VpxClient.exe.config client configuration file with a text editor. By default, this file is located at C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\
  2. Edit this line in the file to change the HTTP and HTTPS ports:

    <add key = "protocolports" value = "https:443;http:80:" />

    Example: Tto change the HTTP port to 8080 and the HTTPS port to 8081, change the line to:

    <add key = "protocolports" value = "https:8081;http:8080" />

As an alternative to editing the vSphere Client configuration file, you can specify the HTTPS port on the login screen of the vSphere Client by entering <servername>:<https_port_number> in the IP address / Name text box.

Note: For more information about TCP/UDP ports, see TCP and UDP Ports required to access vCenter Server, ESX hosts, and other network components (1012382).

Additional Information


For translated versions of this article, see: