Educational ICT Virtualisation Specialist

Twitter LinkedIn E-mail
Precedence Technologies Ltd
Technology House, 36a Union Lane
Cambridge, CB4 1QB, United Kingdom
T: +44 (0)8456 446 800 / +44 (0)1223 359900
E: enquiries@precedence.co.uk
PVS-ConvertUEFI

Jump To: Support > KB > Citrix > PVS > ConvertUEFI

Convert a BIOS vDisk to UEFI

  1. Copy VHD/VHDX vDisk file (merging beforehand if necessary)
  2. Mount vDisk using Disk Management or PVS console
  3. Use Disk Management determine the disk number and drive letter of your mounted vDisk. Alternatively, use diskpart and use list disk and list volume:
    C:\>echo list disk|diskpart
    
    Microsoft DiskPart version 6.3.9600
    
    Copyright (C) 1999-2013 Microsoft Corporation.
    On computer: PVS01
    
    DISKPART>
      Disk ###  Status         Size     Free     Dyn  Gpt
      --------  -------------  -------  -------  ---  ---
      Disk 0    Online          119 GB    99 MB        *
      Disk 1    Online         1674 GB  1024 KB        *
      Disk 2    Online          110 GB     9 MB        
    
    DISKPART>
    C:\Users\administrator>echo list volume | diskpart
    
    Microsoft DiskPart version 10.0.17763.1911
    
    Copyright (C) Microsoft Corporation.
    On computer: PVS01
    
    DISKPART>
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  --------
      Volume 0     C   Windows      NTFS   Partition    118 GB  Healthy    Boot
      Volume 1         Recovery     NTFS   Partition    300 MB  Healthy    Hidden
      Volume 2         SYSTEM       FAT32  Partition    100 MB  Healthy    System
      Volume 3     E   vDisks       NTFS   Partition   1674 GB  Healthy
      Volume 4     D   ULayeredIma  NTFS   Partition    109 GB  Healthy
      Volume 5                      FAT32  Partition    100 MB  Healthy    Hidden
    DISKPART>
    
  4. Use bcdedit /store D:\Boot\BCD /enum all to get boot settings (replace D: by the drive letter your vDisk is mounted on). The important bits are the Windows Boot Loader sections for the main OS (shown as {default}) and the Windows Recovery Environment:
    C:\Users\administrator>bcdedit /store d:\Boot\BCD /enum all
    
    Windows Boot Manager
    --------------------
    identifier              {bootmgr}
    device                  unknown
    description             Windows Boot Manager
    locale                  en-GB
    inherit                 {globalsettings}
    default                 {default}
    resumeobject            {ec9ff585-ae46-11e9-a7aa-a701b0d3a2b6}
    displayorder            {default}
    toolsdisplayorder       {memdiag}
    timeout                 30
    
    Windows Boot Loader
    -------------------
    identifier              {default}
    device                  partition=D:
    path                    \Windows\system32\winload.exe
    description             Windows 10
    locale                  en-GB
    inherit                 {bootloadersettings}
    recoverysequence        {ec9ff587-ae46-11e9-a7aa-a701b0d3a2b6}
    displaymessageoverride  Recovery
    recoveryenabled         No
    allowedinmemorysettings 0x15000075
    osdevice                partition=D:
    systemroot              \Windows
    resumeobject            {ec9ff585-ae46-11e9-a7aa-a701b0d3a2b6}
    nx                      OptIn
    bootmenupolicy          Standard
    bootstatuspolicy        IgnoreAllFailures
    
    Windows Boot Loader
    -------------------
    identifier              {ec9ff587-ae46-11e9-a7aa-a701b0d3a2b6}
    device                  ramdisk=[unknown]\Recovery\WindowsRE\Winre.wim,{ec9ff588-ae46-11e9-a7aa-a701b0d3a2b6}
    path                    \windows\system32\winload.exe
    description             Windows Recovery Environment
    locale                  en-us
    inherit                 {bootloadersettings}
    displaymessage          Recovery
    osdevice                ramdisk=[unknown]\Recovery\WindowsRE\Winre.wim,{ec9ff588-ae46-11e9-a7aa-a701b0d3a2b6}
    systemroot              \windows
    nx                      OptIn
    bootmenupolicy          Standard
    winpe                   Yes
    
  5. Look for unknown against device and osdevice in the two Windows Boot Loader sections
  6. If the {default} section contains unknown, fix with bcdedit /store D:\boot\BCD /set {default} device partition=D: and bcdedit /store D:\boot\BCD /set {default} osdevice partition=D: (replacing D: by the mounted drive letter):
    C:\Users\administrator>bcdedit /store D:\boot\BCD /set {default} device partition=D:
    The operation completed successfully.
    
    C:\Users\administrator>bcdedit /store D:\boot\BCD /set {default} osdevice partition=D:
    The operation completed successfully.
    
  7. If the Windows Recovery Environment section contains unknown, note its identifier and fix with bcdedit /store D:\boot\BCD /set {IDENTIFIER} device ramdisk=[D:]\Recovery\WindowsRE\Winre.wim,{IDENTIFIER} and bcdedit /store D:\boot\BCD /set {IDENTIFIER} osdevice ramdisk=[D:]\Recovery\WindowsRE\Winre.wim,{IDENTIFIER}( replacing D: by the mounted drive letter and IDENTIFIER by the identifier you noted):
    C:\Users\administrator>bcdedit /store D:\Boot\BCD /set {ec9ff587-ae46-11e9-a7aa-a701b0d3a2b6} device ramdisk=[D:]\Recovery\WindowsRE\Winre.wim,{ec9ff588-ae46-11e9-a7aa-a701b0d3a2b6}
    The operation completed successfully.
    
    C:\Users\administrator>bcdedit /store D:\Boot\BCD /set {ec9ff587-ae46-11e9-a7aa-a701b0d3a2b6} osdevice ramdisk=[D:]\Recovery\WindowsRE\Winre.wim,{ec9ff588-ae46-11e9-a7aa-a701b0d3a2b6}
    The operation completed successfully.
    
  8. You can now run mbr2gpt /disk:DISKNUM /allowfullos /validate where DISKNUM is the disk number you determined from Disk Management or diskpart. In this example, it is 2:
    C:\Users\administrator>mbr2gpt /disk:2 /allowfullos /convert
    
    MBR2GPT will now attempt to convert disk 2.
    If conversion is successful the disk can only be booted in GPT mode.
    These changes cannot be undone!
    
    MBR2GPT: Attempting to convert disk 2
    MBR2GPT: Retrieving layout of disk
    MBR2GPT: Validating layout, disk sector size is: 512 bytes
    MBR2GPT: Trying to shrink the system partition
    MBR2GPT: Creating the EFI system partition
    MBR2GPT: Installing the new boot files
    MBR2GPT: Performing the layout conversion
    MBR2GPT: Migrating default boot entry
    MBR2GPT: Adding recovery boot entry
    MBR2GPT: Fixing drive letter mapping
    MBR2GPT: Conversion completed successfully
    MBR2GPT: Before the new system can boot properly you need to switch the firmware to boot to UEFI mode!
    
  9. If the conversion fails, the reason why will be shown at the end of C:\Windows\setupact.log
  10. You can now unmount the vDisk
  11. Remember to set up your target devices (PCs or VMs) to boot from UEFI
  12. You will also need to configure DHCP (as below if using NetManager) to allow for UEFI booting

Configuring NetManager DHCP to allow UEFI booting with PVS

The PVS UEFI bootstrap (pvsnbpx64.efi) does not allow the target PVS servers to be configured within it (as it is digitally signed for secure boot, it cannot be altered). Therefore you must use DHCP options to provide the provisioning servers to use (Citrix documentation is here).

For NetManager, you should use the resource-location-servers option (shown as Resource location servers in the webadmin GUI) and alter the bootstrap filename to pvsnbpx64.efi instead of ARDBP32.bin. Unless you want to switch all machines to UEFI boot, you should define a DHCP group rather than defining the bootstrap filename globally. For example, here is an example fragment from the /etc/netmanager/dhcpd.local settings file. The PVS servers are 10.0.0.11 and 10.0.0.12. The TFTP server that provides the bootstrap is 10.0.0.10:
Group UEFIPVS {
[resource-location-servers=10.0.0.11 10.0.0.12]
[filename=pvsnbpx64.efi]
[next-server=10.0.0.10]
8a:5b:65:3b:dd:29 10.0.20.30 win10uefi
}

Alternatively, you can use DHCP Vendor Options to automatically determine UEFI machines. To do this, set resource-location-servers option (shown as Resource location servers in the webadmin GUI) as a global option and define pvsnbpx64.efi as the filename for a Vendor Class prefix of PXEClient:Arch:00007. The next-server setting will be the same for both BIOS and UEFI booting, so does not need to be overridden.

In the NetManager configuration this will look like:
dhcp_wm0_options="next-server=10.0.0.10 filename=ARDBP32.bin resource-location-servers=10.0.0.11,10.0.0.12"
In /etc/netmanager/dhcpvendoropts this will look like:
vendor=PXEClient:Arch:00007 {
::All::
filename=pvsnbpx64.efi
}
© Copyright Precedence Technologies 1999-2024
Page last modified on July 31, 2024, at 01:28 PM by sborrill