Skip to content

new-vmx not writing GuestOS Type to config file #27

@sailingbikeruk

Description

@sailingbikeruk

PS_Error
VMware_Workstation_Error
This could just be me as a newbie but the PS below doesnt write the GuestOS to the config file causing the VM to fail to start with the error "The configuration file does not specify a guest OS"

Windows 10 Home 64-Bit Build 19043.1348
PS 5.1
VMware workstation Pro 15.5.7

new-vmx -VMXName MyWin10 -GuestOS windows9-64 -Firmware BIOS -Path <PathToFile> | 
    New-VMXScsiDisk -NewDiskSize 60GB -NewDiskName SCSI_0 | 
    Add-VMXScsiDisk -LUN 0 -controller 0 | 
    Connect-VMXcdromImage -ISOFile <PathToFile> |
    Set-VMXNetworkAdapter -Adapter 0 -ConnectionType nat -AdapterType vmxnet3 | 
    start-vmx -nowait

I get the following PS error

Set-Content : The process cannot access the file 'H:\Test_VM\MyWin10\MyWin10.vmx' because it is being used by another process.
At C:\Program Files\WindowsPowerShell\Modules\vmxtoolkit\4.5.3.1\vmxtoolkit.psm1:2202 char:13
+             Set-Content -Path $config -Value $content -Force
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-Content], IOException
    + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.SetContentCommand

I've attached the output from the PS Console and the error from Workstation as screenshots.

It appears that it starts the VM BEFORE writing the Guest OS and then cannot do so:

 ==>Creating new VM MyWin10[success]
 ==>creating new 60GB SCSI Disk SCSI_0 at H:\Test_VM\MyWin10VixDiskLib: Failed to initialize PhoneHome library.
[success]
 ==>adding Disk SCSI_0.vmdk at Controller 0 LUN 0 to MyWin10[success]
 ==> Configuring IDE sata0:1 on MyWin10[success]
WARNING: Adapter not present, will be added
 ==>configuring Ethernet0 as vmxnet3 with nat for MyWin10[success]
 ==>starting Virtual Machine MyWin10[success]

 ==>setting GuestOS windows9-64 for MyWin10[success]
VMXname Status  Starttime
------- ------  ---------
MyWin10 Started 11.21.2021 11:46:15
Set-Content : The process cannot access the file 'H:\Test_VM\MyWin10\MyWin10.vmx' because it is being used by another process.
At C:\Program Files\WindowsPowerShell\Modules\vmxtoolkit\4.5.3.1\vmxtoolkit.psm1:2202 char:13
+             Set-Content -Path $config -Value $content -Force
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-Content], IOException
    + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.SetContentCommand

PS F:\OneDrive\Documents\GitHub\vmxtoolkit> Error: Unknown error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions