VirtualBox

Ignore:
Timestamp:
Sep 30, 2021 8:32:24 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147191
Message:

Main/Unattended: Add UEFI support (needed for Windows 11 which this also adds), and make it work for the Windows case. This requires moving the aux files to a DVD image, because Windows booted in UEFI mode is unable to access a legacy floppy drive (hardcoded by Microsoft). The partitioning needs to be very different with UEFI and follows Microsoft's recommendations. Needs also a bit more flexibility with knowing on which drive letter the script will end up. Additionally contains registry tweaking to skip the TPM and secure boot checks in the Windows 11 installer (just in Windows PE, for later upgrading the same needs to be applied in the final install).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/UnattendedTemplates/win_nt6_unattended.xml

    r68257 r91502  
    2727                    <DiskID>0</DiskID>
    2828                    <WillWipeDisk>true</WillWipeDisk>
     29@@VBOX_COND_IS_NOT_FIRMWARE_UEFI@@
    2930                    <CreatePartitions>
     31                        <!-- TODO: Use the standard partitioning scheme at starting with Windows 8 maybe, using 2 partitions as described by Microsoft? -->
    3032                        <CreatePartition>
    3133                            <Order>1</Order>
     
    3436                        </CreatePartition>
    3537                    </CreatePartitions>
     38@@VBOX_COND_END@@
     39@@VBOX_COND_IS_FIRMWARE_UEFI@@
     40                    <CreatePartitions>
     41                        <CreatePartition wcm:action="add">
     42                            <Order>1</Order>
     43                            <Type>Primary</Type>
     44                            <Size>300</Size>
     45                        </CreatePartition>
     46                        <CreatePartition wcm:action="add">
     47                            <Order>2</Order>
     48                            <Type>EFI</Type>
     49                            <Size>100</Size>
     50                        </CreatePartition>
     51                        <CreatePartition wcm:action="add">
     52                            <Order>3</Order>
     53                            <Type>MSR</Type>
     54                            <Size>128</Size>
     55                        </CreatePartition>
     56                        <CreatePartition wcm:action="add">
     57                            <Order>4</Order>
     58                            <Type>Primary</Type>
     59                            <Extend>true</Extend>
     60                        </CreatePartition>
     61                    </CreatePartitions>
     62                    <ModifyPartitions>
     63                        <ModifyPartition wcm:action="add">
     64                            <Order>1</Order>
     65                            <PartitionID>1</PartitionID>
     66                            <Label>WINRE</Label>
     67                            <Format>NTFS</Format>
     68                            <TypeID>de94bba4-06d1-4d40-a16a-bfd50179d6ac</TypeID>
     69                        </ModifyPartition>
     70                        <ModifyPartition wcm:action="add">
     71                            <Order>2</Order>
     72                            <PartitionID>2</PartitionID>
     73                            <Label>EFI</Label>
     74                            <Format>FAT32</Format>
     75                        </ModifyPartition>
     76                        <ModifyPartition wcm:action="add">
     77                            <Order>3</Order>
     78                            <PartitionID>3</PartitionID>
     79                        </ModifyPartition>
     80                        <ModifyPartition wcm:action="add">
     81                            <Order>4</Order>
     82                            <PartitionID>4</PartitionID>
     83                            <Label>Windows</Label>
     84                            <Letter>C</Letter>
     85                            <Format>NTFS</Format>
     86                        </ModifyPartition>
     87                    </ModifyPartitions>
     88@@VBOX_COND_END@@
    3689                </Disk>
    3790            </DiskConfiguration>
     
    57110                    <InstallTo>
    58111                        <DiskID>0</DiskID>
     112@@VBOX_COND_IS_NOT_FIRMWARE_UEFI@@
    59113                        <PartitionID>1</PartitionID>
     114@@VBOX_COND_END@@
     115@@VBOX_COND_IS_FIRMWARE_UEFI@@
     116                        <PartitionID>4</PartitionID>
     117@@VBOX_COND_END@@
    60118                    </InstallTo>
    61119                    <WillShowUI>OnError</WillShowUI>
     
    67125                <DisplayReport>OnError</DisplayReport>
    68126            </ComplianceCheck>
     127
     128            <!-- Apply registry tweaks to Windows PE, skipping the checks in the Windows 11 setup program. This will not make it to the final install, and should do no harm with older Windows versions. -->
     129            <RunAsynchronous>
     130                <RunAsynchronousCommand>
     131                    <Order>1</Order>
     132                    <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassCPUCheck /t REG_DWORD /d 1</Path>
     133                    <Description>Windows 11 disable CPU check</Description>
     134                </RunAsynchronousCommand>
     135                <RunAsynchronousCommand>
     136                    <Order>2</Order>
     137                    <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassRAMCheck /t REG_DWORD /d 1</Path>
     138                    <Description>Windows 11 disable RAM check</Description>
     139                </RunAsynchronousCommand>
     140                <RunAsynchronousCommand>
     141                    <Order>3</Order>
     142                    <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1</Path>
     143                    <Description>Windows 11 disable Secure Boot check</Description>
     144                </RunAsynchronousCommand>
     145                <RunAsynchronousCommand>
     146                    <Order>4</Order>
     147                    <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassStorageCheck /t REG_DWORD /d 1</Path>
     148                    <Description>Windows 11 disable Storage check</Description>
     149                </RunAsynchronousCommand>
     150                <RunAsynchronousCommand>
     151                    <Order>5</Order>
     152                    <Path>reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1</Path>
     153                    <Description>Windows 11 disable TPM check</Description>
     154                </RunAsynchronousCommand>
     155            </RunAsynchronous>
    69156
    70157        </component>
     
    144231                    <Order>2</Order>
    145232                    <Description>VirtualBox post guest install steps </Description>
    146                     <CommandLine>cmd.exe /c A:\VBOXPOST.CMD --vista-or-newer</CommandLine>
     233                    <CommandLine>cmd.exe /c @@VBOX_INSERT_AUXILIARY_INSTALL_DIR@@VBOXPOST.CMD --vista-or-newer</CommandLine>
    147234                </SynchronousCommand>
    148235            </FirstLogonCommands>
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette