VM Back

VMware Command Line Tools

On this page, you'll find command line programs which can replace and/or supplement VMware's official VMwareTools. Although they come in most handy on guest operating systems to which no VMwareTools is provided (such as DOS and Solaris), there are also places for them even on officially supported guest systems.

These programs use VMware's undocumented and therefore not officially supported feature to communicate with VMware (see VMware Backdoor I/O Port). Information on these functions have come entirely from my personal research and quite a few contributions by fellow VMware users.

These programs are intended partly as illustrative examples of how to use VMware backdoor function and I have cut many corners writing them. All programs come with source code so you are quite welcome to enhance, port and debug <g> them.

Although the official VMwareTools source (or part of it) is now available as the Open Virtual Machine Tools, it's source tree is too large for a single person to study easily. I think programs on this page are just the right size for start learning about the backdoor function.

  • vmw: generic backdoor access program
    for DOS, Win, Linux, FreeBSD, NetBSD, OpenBSD, Solaris and Minix

  • vmshrink: virtual disk shrink program
    for DOS, Win, Linux, FreeBSD, NetBSD, OpenBSD, Solaris and Minix

  • vmftp: host-guest file transfer program
    for DOS, Win, Linux, FreeBSD, NetBSD, OpenBSD, Solaris and Minix

  • vmtsr: time sync and screen copy TSR for DOS

  • vmcmd-tools: original version of VMware Command Line Tools
    for DOS and Windows -- this site started from this, by the way :-)

  • Contributions: contributed programs/ports

vmw

This is a generic backdoor access program with following functions:

  • Call VMware backdoor APM functions
  • Copy & paste text between host and guest
  • Get / set mouse cursor location
  • Get connectable virtual device information
  • Connect / disconnect connectable virtual devices
  • Get virtual hardware version
  • Get virtual machine memory size (MB)
  • Get processor speed (MHz)
  • Get / set VMware GUI option settings
  • Call VMware guest-host RPC functions
  • Get host screen size
  • Get host system time / sync guest system time
  • Get BIOS UUID
  • Get VMware product / version

This program incorporates contributed code by Markus Gyger (Solaris and Linux port) and Ken'ichi Takahagi (Minix port) and John Morris (SCO port). The program name "vmw" and the general program structure are also modeled on Markus' contribution.

Not all of functions listed above are particularly useful by themselves but are included in this program for illustrative purpose.

UPDATE (Nov.8,2006): Win32 version of vmshrink.exe in the above package has a bug that it cannot start on original (non-OSR2) version of Windows 95. vmshrink-w32-061108.zip contains the program (and source) with the fix.

Both packages includes the identical set of files:

  • Pre-built binaries of vmw, vmshrink and vmftp programs for Win, DOS, Linux, FreBSD, NetBSD, OpenBSD, Solaris and Minix

  • Source code (C and assembly, shared by all target operating systems) and makefiles for each operating system. An assembly source and a make file for SCO OpenServer are also included (written based on contribution by John Morris) but I don't have access to an SCO OpenServer and I cannot confirm if I have written them correctly.

  • Documents

Note for Windows users: all source and documents use unix style new line characters (0x0a), except for files used only by Windows/DOS systems. Be sure to use editors/viewers capable of handling them (Windows' notepad cannot).

Comments and suggestions are greatly appreciated, espcially on coding for unix like systems. I'm not really familiar with them.


vmshrink

This is a program to shrink virtual disks from command line in a VMware guest.

The program, source and documents are included in the vmw download package.


vmftp

This is an FTP client-like user interface program to exchange files between host and guest through VMware Shared Folders. Naturally it requires a VMware product which supports the Shared Folders feature (Workstation 4.0 and later).

The program, source and documents are included in the vmw download package.


vmtsr

This is a VMware DOS guest TSR with the following functions:

  • Background clock synchronization.
  • Taking screen text copy with a hot key combination.
  • (As an added bonus) On screen clock display.

This program is confirmed to work on MS-DOS 6.2, MS-DOS 7.x (Win 9x DOS), DRDOS 7.03 and FreeDOS 0.9. Actually it uses only most common DOS/BIOS functions and should work on most DOS compatible systems.

It consumes a little more than 1,400 bytes of memory, or a little less than 800 bytes in minimum function (i.e. sync only) mode. You can also load it into upper memory area with the DOS LOADHIGH utility. The small memory footprint lets this program stay comfortably in a space between other programs.

Refer to the included document for details.

vmcmd-tools

This is the original version of VMware Command Line Tools for DOS and Windows. It consists of several simple and small single-purpose programs. Although most functions of them are now covered by vmw program, I believe there are still places for these, such as on DOS guests where program size can be an issue.

The package contains the following items:

  • Documents in html form
  • DOS16 version executables
  • WIN32 version executables
  • Full source code (assembly and C)

Note for those who have downloaded the previous package (vmcmd-tools.zip):
Program files in the new package are completely identical. The only difference is inclusion of the documents (which has been provided online on this site before) in the package.

I do not claim any credit for this. You may freely use, modify, redistribute or trash them in whatever way you like. Success or bug reports, suggestions, encouragement and compliments are greatly appreciated though. Complaints, accusation and abuse are not.


Contributions

John Morris has sent me a patch and pre-built binaries of vmw-060510 programs for SCO OpenServer 5.0.x:

Stefan Kuhr has written a VMware/Virtual PC detecting program for x64 platform Windows:

Andrew Hintz has kindly sent me the source of Linux version vmchk.

Markus Gyger has written a Linux / Solaris port of the tool (compiles with gcc or Sun's compiler).

(You need to get both files. See comment at the top of vmw.c file for compile instruction)

Ken'ichi Takahagi has written a Minix port of the tools.
Read the "vmw-01.txt" file included in the archive for details.

John Morris has adapted 'vmw_door.s' for SCO Openserver 5.
Get vmw.c above and vmw_door_sco.s below, then compile them with:

    cc -o vmw -DHAVE_STIME vmw.c vmw_door_sco.s

PS. I would really appreciate it if you would let me know if you have found anything wrong with the English in this page. I kind of know it is not so bad grammatically, but I want it to sound as "natural" as possible.