The title of the post says it all. If for whichever reason you need to change the default connection port for communication with ESX or ESXi i host, you might want to know where to go and how to modify it. And also which services (daemons) to restart. This post will teach how and where to change default ports for communication with ESXi host.
Fist of all you must have an access to the console. For the ESXi server you'll need to use vMA – vSphere Management Assistant, because the use of those 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) here.
How to install and use the vMA virtual appliance is explained in excellent new training from Trainsignal – vSphere Troubleshooting Training – created by David Davis. I'm studying this course and I just few days ago I passed the section with the video explaining about how to configure vMA to connect to ESX(i) servers and how to use vMA.
Here is the how to for the change of the default ports on the ESX host:
01. Login to the console and change to /etc/vmware/hostd/ directory.
02. Edit the proxy.xml file there with a text editor, and add the port numbers under the <configRoot> tag:
For example – 8080 for https and 8081 for https access:
<httpsPort>8080</httpsPort>
<httpsPort>8081</httpsPort>
03. Restart the vmware-hostd process by
service mgmt-vmware restart
Here is how to do it on the ESXi host:
01. Execute this command after login in to the vMA:
First you must get a copy of the proxy.xml file and edit it locally:
Now apparently (what the KB says) the commands vary for Windows of Linux systems.
For Linux systems, use this command:
vifs –server hostname –username username –get /host/proxy.xml local_directory_path/proxy.xml
For Windows systems, use this command:
vifs –server hostname –username username –get /host/proxy.xml local_directory_pathproxy.xml
02. Then you can edit the proxy.xml file with a text editor, and add these tags under the tag:
For example, to configure port 8080 as the port for the https connection, and port 8081 as the port for the https connection, add these two lines:
8080
8081
03. Then you'll need to run the vifs command again to place the proxy.xml file back on the ESXi host:
Again the command differ for Linux or Windows systems:
Linux:
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_pathproxy.xml /host/proxy.xml
04. Then via the GUI go and use the Restart Management Agents in the Troubleshooting Mode Option on the console. This restarts the hostd service.
Now you can, but don't have to, change the ports configured for the vSphere Client in the client configuration file. If you don't make the changes in the client configuration file, you can always type your ports after the address of your ESXi server in this format. For example:
Now how to do the change on your system if you don't want to type those different ports in the connection screen:
01. On the system where the vSphere Client is installed, edit the VpxClient.exe.config client configuration file with a text editor.
You must go to the default directory of this file:
c:Program FilesVMwareInfrastructureVirtual Infrastructure ClientLauncher
02. You have to edit the file and change the lines concerning the https and https ports:
For example, to change the HTTP port to 8080 and the HTTPS port to 8081
You must change the line from this: <add key = “protocolports” value = “https:443;https:80:” />
To that: <add key = “protocolports” value = “https:8081;https:8080” />
Source: VMware KB 1021199
See all the ports used in vCenter, ESX, and other components here: TCP and UDP Ports for vCenter Server, ESX hosts, and other network components management access (1012382).
More from ESX Virtualization:
Stay tuned through RSS, and social media channels (Twitter, FB, YouTube)
david says
thanks this post.
I’ve tried it but the service keeps running under the default port.
even after a reboot.
i modified /etc/vmware/hostd/proxy.xml
First 4 lines
8080
8081
Then i did restart the services with
etc/init.d/hostd restart
etc/init.d/vpxa restart
After that trying to connect on the 8080 port but no succes. When i trying to connect with the default port the client connects.
Can you help me?
thanks
Greets
sunny says
Hi tried the above steps on ESXi 6, the proxy.xml file does not exist, nor does /host
any idea on how to change it