How-To

Quick Tip: Starting the VMware Horizon Client from the Command Line

VMware makes it possible to launch the Horizon client from the command line and specify the desired screen resolution.

The other day a coworker of mine wanted their Horizon client to take up half their monitor. When they brought up the Horizon Client and went to Display > Custom they saw a list of predefined console setting but not one that would display the screen resolution that they needed.

[Click on image for larger view.]

Fortunately, VMware makes it possible to launch the Horizon client from the command line and specify the desired screen resolution. The command to do this on a Windows system is vmware-view.exe, which is located in C:\Program Files (x86)\VMware\VMware Horizon View Client\.

If you just enter vmware-view.exe from the command line it will bring up the Horizon client.

[Click on image for larger view.]

If you enter vmware-view.exe /? all the switches and the usage of the command will be shown.

[Click on image for larger view.]

I first ran the command with the -listMonitors switch to see what monitors the client was aware of. This showed two monitors with their positions and resolution.

[Click on image for larger view.]

To test the command, using switches I entered the following:

"C:\Program Files (x86)\VMware\VMware Horizon View Client\vmware-view.exe" -desktopName Hrz8ICPA -userName vuser01@fentronics -password NOPE -desktopLayout windowSmall -serverURL 10.0.0.61

This brought up the Horizon client with a small (640 x 480) screen, logged the user vuser01 in to a desktop in the desktop pool Hrz8ICPA, from a connection server with an IP address of 10.0.0.61.

[Click on image for larger view.]

As I wanted the session to fill the top half of the monitor, I Entered the following command:

C:\Program Files (x86)\VMware\VMware Horizon View Client>"C:\Program Files (x86)\VMware\VMware Horizon View Client\vmware-view.exe" -desktopName Hrz8ICPA -userName vuser01@fentronics -password NOPE -desktopLayout "960 x 1600" -serverURL 10.0.0.61

[Click on image for larger view.]

The actual display was 960 x 1006, which allowed the top border of the Horizon client to fit within the bounds of the monitor.

I was able to use the switch multimonitor -monitors "1" to select the monitor to display the horizon client on monitor 1 but I was unable to specify a size for the monitor -- it always came up full screen:

"C:\Program Files (x86)\VMware\VMware Horizon View Client\vmware-view.exe" -desktopName Hrz8ICPA -userName vuser01@fentronics -password NOPE -desktopLayout multimonitor -monitors "1" -serverURL 10.0.0.61

I was able to create bat files using the vmware-view.exe command to connect to my desktops in as different users with a single click.

[Click on image for larger view.]

Using vmware-view.exe is a clever way to set non-standard Horizon desktop sizes and, by using batch files, connect to desktops. VMware does have documentation regarding Running Horizon Client From the Command Line, but it just lists the options and does not have any usage examples.

About the Author

Tom Fenton has a wealth of hands-on IT experience gained over the past 30 years in a variety of technologies, with the past 20 years focusing on virtualization and storage. He previously worked as a Technical Marketing Manager for ControlUp. He also previously worked at VMware in Staff and Senior level positions. He has also worked as a Senior Validation Engineer with The Taneja Group, where he headed the Validation Service Lab and was instrumental in starting up its vSphere Virtual Volumes practice. He's on X @vDoppler.

Featured

Subscribe on YouTube