jamesstringerparsec / Easy-GPU-PV

A Project dedicated to making GPU Partitioning on Windows easier!
4.24k stars 426 forks source link

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

Open Skubers opened 9 months ago

Skubers commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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

INFO : Starting and connecting to VM

Skubers commented 9 months ago

Unfortunately after the tool finished, this happens: image

mitchellurgero commented 9 months ago

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

Skubers commented 9 months ago

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