Easy-GPU-PV icon indicating copy to clipboard operation
Easy-GPU-PV copied to clipboard

Any way of adding a parameter that will determine if the VM Hard Drive's partition style is MBR or GPT?

Open Skubers opened this issue 1 year ago • 5 comments
trafficstars

I'm trying to install Win10 32-Bit with your script, and it finishes correctly, but I can't install the OS onto the created Hard Drive, because it's partition style is set to GPT

Skubers avatar Dec 15 '23 13:12 Skubers

I was able to fix the script myself so it works.

Line 2119:

"UEFI" { Write-W2VInfo "Initializing disk..." Initialize-Disk -Number $disk.Number -PartitionStyle MBR

                if ((Get-WindowsBuildNumber) -ge 10240)
                {
                    #
                    # Create the system partition.  Create a data partition so we can format it, then change to ESP
                    #
                    Write-W2VInfo "Creating EFI system partition..."
                    $systemPartition = New-Partition -DiskNumber $disk.Number -Size 200MB -MbrType FAT32 -IsActive

                    Write-W2VInfo "Formatting system volume..."
                    $systemVolume = Format-Volume -Partition $systemPartition -FileSystem FAT32 -Force -Confirm:$false

                    Write-W2VInfo "Setting system partition as ESP..."
                    $systemPartition | Add-PartitionAccessPath -AssignDriveLetter
                }
                else
                {
                    #
                    # Create the system partition
                    #
                    Write-W2VInfo "Creating EFI system partition (ESP)..."
                    $systemPartition = New-Partition -DiskNumber $disk.Number -Size 200MB -GptType '{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}' -AssignDriveLetter

                    Write-W2VInfo "Formatting ESP..."
                    $formatArgs = @(
                        "$($systemPartition.DriveLetter):", # Partition drive letter
                        "/FS:FAT32",                        # File system
                        "/Q",                               # Quick format
                        "/Y"                                # Suppress prompt
                        )

                    Run-Executable -Executable format -Arguments $formatArgs
                }

                #
                # Create the reserved partition
                #
                Write-W2VInfo "Creating MSR partition..."
                $reservedPartition = New-Partition -DiskNumber $disk.Number -Size 128MB -MbrType FAT32

                #
                # Create the Windows partition
                #
                Write-W2VInfo "Creating windows partition..."
                $windowsPartition = New-Partition -DiskNumber $disk.Number -UseMaximumSize -MbrType FAT32

                Write-W2VInfo "Formatting windows volume..."
                $windowsVolume = Format-Volume -Partition $windowsPartition -FileSystem NTFS -Force -Confirm:$false

Skubers avatar Dec 15 '23 14:12 Skubers

Additionally the Enable-VMTPM function throws an error if using 32-bit Windows

INFO : Closing Windows image... INFO : Done. Enable-VMTPM : The operation failed. At C:\Users\Skubi\Downloads\Easy-GPU-PV-main\Easy-GPU-PV-main\CopyFilesToVM.ps1:4384 char:9

  •     Enable-VMTPM -VMName $VMName
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Enable-VMTPM], VirtualizationException
    • FullyQualifiedErrorId : NotSupported,Microsoft.HyperV.PowerShell.Commands.EnableVMTPM

INFO : Starting and connecting to VM

Skubers avatar Dec 15 '23 14:12 Skubers

Unfortunately after the tool finished, this happens: image

Skubers avatar Dec 15 '23 15:12 Skubers

why use 32-bit? Just curious as 64bit windows can still run 32bit apps

mitchellurgero avatar Dec 24 '23 17:12 mitchellurgero

I'm a software tester, so testing on 32-bit Windows OS is a part of the process, as it is required by the client since the software can be used on 32-bit OS. I can install the 32-bit OS no problem, but i tried figuring out a 32-bit VM with GPU passthrough, so i wanted to use this

Skubers avatar Dec 24 '23 17:12 Skubers