bottkars / vmxtoolkit

vmxtoolkit is the Powershell extension to VMware Workstation
Apache License 2.0
116 stars 32 forks source link

MacOS and VMware Fusion - #22

Open jrydval opened 4 years ago

jrydval commented 4 years ago

Thank you for the module. Seems promising!

Some of the commands do not work on my MacOS + VMware Fusion machine.

Version:

PS /Users/jan/Devel/Powershell> Get-Module vmxtoolkit

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     4.5.3.1               vmxtoolkit                          {Add-VMXScsiDisk, Connect-VMXcdromImage, Connect-VMXNetworkAdapter, Convert-VMXdos2unix…

PS /Users/jan/Devel/Powershell> 

Sample issue:

PS /Users/jan/Devel/Powershell> Get-VMX -Path '/Users/jan/Virtual Machines.localized/'
InvalidOperation: /Users/jan/.local/share/powershell/Modules/vmxtoolkit/4.5.3.1/vmxtoolkit.psm1:2629
Line |
2629 |          (($cmdresult = &$vmrun List) 2>&1 | Out-Null)
     |                          ~~~~~~
     | The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a
     | CommandInfo object.

VMXName         UUID                              State     Template Path
-------         ----                              -----     -------- ----
Kali            564dac602d2e9755-67a0cb262eac0f13 stopped            /Users/jan/Virtual Machines.localized/Kali.vmwarevm
Mikrotik        564dd13bcffa4eee-a1f453ab8c24a440 stopped            /Users/jan/Virtual Machines.localized/Mikrotik.vmwarevm
VMware ESXi 6.7 564daa906bdbd986-83483cc8a6f5638d stopped            /Users/jan/Virtual Machines.localized/VMware ESXi 6.7.vmwarevm
Windows 10      564d3b3caa16fbf7-78d37fa7a8cb7506 suspended          /Users/jan/Virtual Machines.localized/Windows 10.vmwarevm

PS /Users/jan/Devel/Powershell>

Where should be the $vmrun varibale set? I cannot find the place.

bottkars commented 4 years ago

what version of fusion are you on ? need to validate the latest version (s)

the vmrun path is $GLOBAL:vmrun and will be evaluated with other variables during module initialization from vmxtoolkitinit.ps1:

            $VMware_Path = mdfind -onlyin /Applications "VMware Fusion"                
            $Global:vmwarepath = $VMware_Path
            [version]$Fusion_Version = defaults read $VMware_Path/Contents/Info.plist CFBundleShortVersionString
            $VMware_BIN_Path = Join-Path $VMware_Path  '/Contents/Library'
            $preferences_file = "$HOME/Library/Preferences/VMware Fusion/preferences"
            $Global:VMware_vdiskmanager = Join-Path $VMware_BIN_Path 'vmware-vdiskmanager'
            $Global:vmrun = Join-Path $VMware_BIN_Path "vmrun"

can you run the commands with -verbose option ?