← All Scanning Guides
Prerequisites
1

Set the VMX path

Point to the .vmx file for the guest VM you want to scan.
Terminal
# Adjust the path to match your VM location
VMXPATH="/Users/you/Virtual Machines.localized/CentOS 7 64-bit.vmwarevm/CentOS 7 64-bit.vmx"

# Start the VM headless (skip if already running)
vmrun start "$VMXPATH" nogui
2

Copy the collector into the guest

Use copyFileFromHostToGuest to transfer the collector binary. No SCP or shared folders needed.
Terminal
vmrun -gu <username> -gp <password> \
  copyFileFromHostToGuest "$VMXPATH" \
  ./version_gopher-linux-x64 \
  "/home/user/version_gopher"

vmrun -gu <username> -gp <password> \
  runProgramInGuest "$VMXPATH" -activeWindow /bin/bash -c \
  "chmod +x /home/user/version_gopher"
3

Run the scan

Execute the collector inside the guest. It scans the target directory and writes JSONL output.
Terminal
vmrun -gu <username> -gp <password> \
  runProgramInGuest "$VMXPATH" -activeWindow /bin/bash -c \
  "cd /home/user && ./version_gopher /usr/bin -o scan"
Tip: Replace /usr/bin with any directory path. Use -r for recursive directory scanning, or / to scan the entire filesystem.
4

Pull results back to the host

Copy the scan output from the guest back to your host machine for import into the dashboard.
Terminal
vmrun -gu <username> -gp <password> \
  copyFileFromGuestToHost "$VMXPATH" \
  "/home/user/scan.json" \
  /tmp/centos-scan.json
5

Import into VersionGopher™

Upload the results via the web dashboard or the API.
Terminal
# Via the API
curl -F "file=@/tmp/centos-scan.json" http://localhost:5000/api/import

# Or drag-and-drop into the web dashboard
⚠️ vmrun stdout is unreliable. If you need to capture command output, redirect to a file inside the guest and use copyFileFromGuestToHost to retrieve it. Always use runProgramInGuest -activeWindow, never runScriptInGuest (it hangs on some platforms).