Changing the TCP ports for VMWare Server 2

VMWare Server 2 has significant changes user interface-wise compared to the first version of the free VMWare Server product. The previous version (which itself is the successor of GSX server) provided access to the server and virtual machines through the VMWare Server Console. The Server Console could be replaced by Virtual Center 1.4, provided you had a license.
Web-based software needs a web server to run on. VI Web Access is written in Java and runs on top of Apache Tomcat. VI Web Access increases the product complexity by a magnitude compared to Server Console. This wasn't really an issue when VI Web Access was part of VMWare Infrastructure. This product is usually deployed by dedicated administrators.

VMWare Server 2, on the other hand, targets the average small business user and even non-business usage. The number of postings on the web shows that web based software can be very difficult to manage when you can't even connect to the web application.

During the installation VMWare Server 2 prompts for two TCP ports. Port 8222 is used for http traffic, port 8333 for https traffic. In many Windows applications you can change the port after the installation as a matter of typing a new value into the options dialog. If you hoped the same would be true for VMWare Server 2, you'll be disappointed.

A number of web sites suggest that the only way to change the port is to uninstall VMWare server, scrub the hard disk and clean the registry from any trace of the product. Then reinstall with the correct ports. There is an easier solution, though.

While you still can't change the port in a single place, you only need to change the ports in a few files. For the reminder I assume you are running Windows Server 2008. For other operating systems you need to change the paths accordingly. I assume that you want to change the ports to 5000 (from 8333) for https and 5001 (from 8222) for http transmissions.

The tools you need are a file explorer (Windows Explorer will work) and a text editor (Notepad would be sufficient). First open


C:\Users\All Users\VMware\VMware Server\hostd\proxy.xml

Change the ports in the bolded values. These are right at the beginning of the file:


<ConfigRoot>
<httpPort>5001</httpPort>
<httpsPort>5000</httpsPort>
<EndpointList>

Next open


C:\Program Files (x86)\VMware\VMware Server\tomcat\
webapps\ui\jslib-1.0.122589\modules\
com.vmware.webaccess.app_1.0.0\WebAccess.properties

At the end of the file you find the following part. Change the port in the bolded line:


new Object({
login_url: "http://localhost:5001/sdk",
login_show_webservice_url: "false",
login_name: "",
login_password: ""
});

If you miss this file, you get to the login prompt, but entering a user name and password results in an error message. To update the link to the server page open


C:\Program Files (x86)\VMware\VMware Server\serverui.url

Change the file like this (there are just two lines in there):


[InternetShortcut]
URL=https://MyServer:5000/ui/

Finally, you need to update the location of the client plugin. Open


C:\Program Files (x86)\VMware\VMware Server\hostd\
docroot\client\clients.xml

Then change the port number in the following line


<downloadUrl>https://*:5000/client/VMware-viclient.exe</downloadUrl>

Those are all changes you need to make. They won't take effect until you restart VMWare server, or more precisely, the services that make up VMWare Server.

In the Start menu right click Computer and pick the "Manage" option. Navigate to the Services node (Configuration > Services on Windows 2008). Sort the list by name and restart all services whose name start with "VMWare" to be on the safe side. Now you should be able to connect to the web interface by typing the following URL into your browser:

https://MyServer:5000

replace "MyServer" with the computer name or IP address of your VMWare Server host machine. If you access your virtual machines through Terminal Services, VNC, or other clients, you're done now. Use the web interface to configure, start, stop, and suspend virtual machines.

Should you rely on the VMWare Remote Console, though, you need to know that while 8333 and 8222 are the only ports that you can configure during the setup, they aren't the only ones that VMWare uses. The Remote Console uses by default port 902 to communicate with the server.

Initially the Remote Console connects to the server using the https port. After authenticating the web server provides the client with details on how to connect to the console. To change these connection information, open the following file on the server:


C:\Users\All Users\VMware\VMware Server\config.ini

The first line is a new one that you won't find in your file. In the INI files you can specify the port the server is listening on and the port that the client uses. Both can be different if there's a firewall that translates the port:


authd.port = "5002"
authd.client.port = "5002"

I personally prefer the remote console to use a port adjacent to the Tomcat ports. I can then open up the firewall with a single port range rule instead of using multiple rules. The fewer rules the better usually.

Before the new settings take effect, you have to restart the "VMWare Authorization Service", or VMAuthdService for short.