bottkars / vmxtoolkit

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

Error on Start-VMX when using non-default path #19

Closed talaniz closed 6 years ago

talaniz commented 6 years ago

I have a VM path at D:\Virtual Machines. Now, Get-VMX runs just fine when I specify the Path parameter, but when I run Start-VMX, it's still looking in the default.

Ex. Here you can see my VM listing--



VMXName       UUID                              State   Template Path
-------       ----                              -----   -------- ----
CentOS 64-bit 564d2a9d3cfa3cff-3bd2d8d821157e08 running          D:\Virtual Machines\CentOS 64-bit
Ubuntu 16     564d78f4f5fef1e9-96b35b561e7aac13 stopped          D:\Virtual Machines\Ubuntu 16
Ubuntu 64-bit 564d0d26e23a8d6a-faa0e316ddb741d2 susp...          D:\Virtual Machines\Ubuntu 64-bit```

# When I make these calls, it throws errors looking only in the default folder--

C:\WINDOWS\system32> Start-VMX -VMXName "Ubuntu 64-bit" -Path "D:\Virtual Machines"
WARNING: VM Path C:\Users\talaniz\Documents\Virtual Machines\ does currently not exist
WARNING: Get-VMX : VM Ubuntu 64-bit does currently not exist

C:\WINDOWS\system32> Start-VMX -VMXName "Ubuntu 64-bit" -Path "D:\Virtual Machines\Ubuntu 64-bit"
WARNING: VM Path C:\Users\talaniz\Documents\Virtual Machines\ does currently not exist
WARNING: Get-VMX : VM Ubuntu 64-bit does currently not exist
talaniz commented 6 years ago

Adding to this, I isolated just one object and attempted to trigger using the object instead after looking at the parameters--

C:\WINDOWS\system32> $vms = Get-VMX -Path "D:\Virtual Machines"
C:\WINDOWS\system32> $vms[2]

The function indicates that it cannot find the vmsd file, though I can clearly find it in "D:\Virtual Machines\Ubuntu 64-bit\"--

WARNING: VM Path C:\Users\talaniz\Documents\Virtual Machines\ does currently not exist
WARNING: Get-VMX : VM @{VMXName=Ubuntu 64-bit; State=suspended; Template=; ActivationPreference=; Scenario=;
UUID=564d0d26e23a8d6a-faa0e316ddb741d2; Config=D:\Virtual Machines\Ubuntu 64-bit\Ubuntu 64-bit.vmx; Path=D:\Virtual
Machines\Ubuntu 64-bit; VMXSnapConfig=D:\Virtual Machines\Ubuntu 64-bit\Ubuntu 64-bit.vmsd} does currently not exist
C:\WINDOWS\system32> ls 'D:\Virtual Machines\Ubuntu 64-bit\'

    Directory: D:\Virtual Machines\Ubuntu 64-bit

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        4/10/2018   4:56 PM                Ubuntu 64-bit.vmx.lck
-a----        3/27/2018   1:49 PM     1073741824 Ubuntu 64-bit-88b40143.vmem
-a----        3/28/2018   8:46 PM       39319958 Ubuntu 64-bit-88b40143.vmss
-a----        3/28/2018   8:46 PM     2006777856 Ubuntu 64-bit-s001.vmdk
-a----        3/28/2018   8:46 PM      110493696 Ubuntu 64-bit-s002.vmdk
-a----        3/28/2018   8:46 PM      302448640 Ubuntu 64-bit-s003.vmdk
-a----        3/28/2018   8:46 PM      256835584 Ubuntu 64-bit-s004.vmdk
-a----        3/28/2018   8:46 PM       84410368 Ubuntu 64-bit-s005.vmdk
-a----        3/27/2018   1:49 PM          65536 Ubuntu 64-bit-s006.vmdk
-a----        3/28/2018   8:46 PM           8684 Ubuntu 64-bit.nvram
-a----        3/28/2018   5:36 PM            772 Ubuntu 64-bit.vmdk
-a----        3/27/2018   1:49 PM              0 Ubuntu 64-bit.vmsd      # <--Allegedly missing file
-a----        3/28/2018   8:46 PM           3271 Ubuntu 64-bit.vmx
-a----        3/27/2018   1:49 PM            268 Ubuntu 64-bit.vmxf
-a----        3/28/2018   1:27 PM         433583 vmware-0.log
-a----        3/28/2018   8:46 PM         271681 vmware.log
bottkars commented 6 years ago

the Object path is not mandatory at this time for start-vmx . It is only use for cosmetical things.

as i wanted to reduce the times searches are done, you have two choices: Specify the VMX by using get-vmx .path and then pipe into start-vmx, or use start-vmx -config [path-to-.vmnx-file] start-vmx -config C:\labbuildr2017\OpenWRT_15_5_1\OpenWRT_15_5_1.vmx get-vmx -Path C:\labbuildr2017\ -VMXName openwrt* | start-vmx