项目作者: mklement0

项目描述 :
macOS CLI for managing VMware Fusion VMs.
高级语言: Shell
项目地址: git://github.com/mklement0/fvm-cli.git
创建时间: 2016-12-18T19:20:43Z
项目社区:https://github.com/mklement0/fvm-cli

开源协议:

下载


npm version license

fvm — VM management CLI for VMware Fusion (macOS only)

fvm (Fusion VM Manager) is a convenience wrapper around the
vmrun CLI
that comes with VMware Fusion,
with added functionality for managing VM window states.

The major areas of functionality are:

  • VMs can be targeted by display name substrings (regular expressions)
    instead of having to specify their VMX file path.

  • VMs in open windows can be activated or closed, their VMX files can be
    revealed in Finder or opened for editing, and Fusion can be quit as a whole.

  • A list of all registered VMs can be obtained with subcommand ls.

As such, fvm can make up for some of the functionality that was lost when
AppleScript support was quietly removed from VMware Fusion v7.

Examples

  1. # Show VMware Fusion's Library window.
  2. fvm # short for: fvm library
  3. # Activate (open existing window or start) the VM whose display name
  4. # contains the (unambiguous) substring "w10":
  5. fvm w10 # short for: fvm activate w10
  6. # Toggle activation of the VM whose display name contains the (unambiguous)
  7. # substring "w10" (only useful when run via hotkey).
  8. fvm -t w10 # short for: fvm activate w10
  9. # Activate the VM whose display name contains the words "ubuntu" and "14".
  10. fvm 'ubuntu.*14'
  11. # Close the window of the VM whose display name is exactly "W7 (32-bit)".
  12. fvm -x close "W7 (32-bit)"
  13. # List all registered VMs by display name, guest OS, state, and VMX file path,
  14. # with open VMs listed first.
  15. fvm -s ls
  16. # List VMs whose display names contain the word "ubuntu".
  17. fvm ls 'ubuntu'
  18. # Quit VMware Fusion as a whole.
  19. fvm quit
  20. ## vmrun PASS-THROUGH EXAMPLES
  21. ## All examples below use "w10" as the display-name regex for identifying
  22. ## the target VM.
  23. # Suspend a VM.
  24. fvm suspend w10
  25. # Check if a VM has the VMware Tools are installed.
  26. fvm checkToolsState w10
  27. # List a VM's snapshots.
  28. fvm listsnapshots w10
  29. # Gets a VM's (guest OS's) IP address.
  30. fvm getGuestIpAddress w10
  31. # Run a program asynchronously and interactively in the guest OS.
  32. fvm -gu jdoe -gp test runProgramInGuest w10 -nowait -interactive 'C:\WINDOWS\system32\calc.exe'

Installation

Prerequisites

  • VMware Fusion v8.5 (fully tested), likely down to v7 (sporadically tested).
  • Any macOS (OS X) version that can run a supported VMware Fusion version.

Installation from the npm registry

Note: Even if you don’t use Node.js, its package manager, npm, works across platforms and is easy to install; try curl -L https://bit.ly/n-install | bash

With Node.js installed, install the package as follows:

  1. [sudo] npm install fvm-cli -g

Note:

  • Whether you need sudo depends on how you installed Node.js / io.js and whether you’ve changed permissions later; if you get an EACCES error, try again with sudo.
  • The -g ensures global installation and is needed to put fvm in your system’s $PATH.

Manual installation

  • Download the CLI as fvm.
  • Make it executable with chmod +x fvm.
  • Move it or symlink it to a folder in your $PATH, such as /usr/local/bin (OSX) or /usr/bin (Linux).

Usage

Find concise usage information below; for complete documentation, read the manual online or,
once installed, run man fvm (fvm --man if installed manually).

  1. $ fvm --help
  2. fvm [-t] [library]
  3. fvm [-x] [-t] [activate] <displayNameRegexOrVmxFile>
  4. fvm [-x] close <displayNameRegexOrVmxFile>
  5. fvm [-x] reveal <displayNameRegexOrVmxFile>
  6. fvm [-x] edit <displayNameRegexOrVmxFile>
  7. fvm [-x] [-b] [-s] ls [<displayNameRegexFilter>]
  8. fvm quit
  9. fvm [-x] start|pause|unpause|suspend|reset <displayNameRegexOrVmxFile>
  10. fvm [-x] stop <displayNameRegexOrVmxFile> [soft|hard]
  11. CAVEAT: Append 'soft' to prevent potential VM corruption.
  12. fvm [-x] [<auth-opts>] <vmrun-cmd> [...]
  13. fvm --help-vmrun
  14. -t ... toggle activation (hotkey-based invocations)
  15. -x ... display name is specified literally, in full
  16. -b ... bare, tab-separated output for machine parsing
  17. -s ... include VM state and show open VMs first
  18. --help-vmrun ... shows vmrun's command-line help
  19. Standard options: --help, --man, --version, --home

License

Copyright (c) 2016 Michael Klement, released under the MIT license.

Acknowledgements

This project gratefully depends on the following open-source components, according to the terms of their respective licenses.

npm dependencies below have optional suffixes denoting the type of dependency; the absence of a suffix denotes a required run-time dependency: (D) denotes a development-time-only dependency, (O) an optional dependency, and (P) a peer dependency.

npm dependencies

Changelog

  • v0.1.0 (2016-12-18):
    • Initial release.