After playing around with SVBus over the past few days I would like to share my preferred method for installing Windows 8.1 to a virtual disk image - this method should apply to all Windows NT 10.* (Windows 10) and Windows NT 6.* systems (including Windows 7 / 8 / 8.1 - with the possible exception of Vista).
All of the examples in the SVBus ReadMe.txt state that you will need a "Computer with a blank HDD or SSD". I would argue that most users are likely to be testing this as a dual/multiboot setup, with Windows already installed. Assuming this is the case then these instructions can be used if Windows NT 6.*/10.* is already installed (excluding Windows Vista as it does not include VHD support). The following instructions use native tools. Alternatively you can use WinPE 3.* or newer to carry out the tasks documented below.
64-bit source files were used. 32-bit sources should work with the same instructions - Driver signing is not required for 32-bit Windows.
NOTE - the disk image created below must be contiguous. If the file is fragmented then Grub4dos will not be able to map it as a file backed diskInstall Grub4dosInstall Grub4dos by adding an entry (for
grldr.mbr) to the existing system BCD store. As you may not have access to the partition containing boot files, the example below hardcodes the path to grldr.mbr using
device partition=. In this example batch file, the path is C:\grldr.mbr. Ensure that
grldr.mbr is in this path or amend the batch file accordingly (the full path is a combination of device + path in the script) -
@echo off
setlocal
for /f "tokens=2 delims={}" %%g in ('bcdedit.exe /create /application bootsector') do set guid={%%g}
bcdedit.exe /set %guid% device partition=C:
bcdedit.exe /set %guid% path \grldr.mbr
bcdedit.exe /set %guid% description "Grub4dos"
bcdedit.exe /displayorder %guid% /addlast
endlocal
pause
.
Second example using the /store command to specify a BCD store (useful if using WinPE for these tasks and targeting an offline system)
@echo off
setlocal
set BCDSTORE=C:\Boot\BCD
for /f "tokens=2 delims={}" %%g in ('bcdedit.exe /store %BCDSTORE% /create /application bootsector') do set guid={%%g}
bcdedit.exe /store %BCDSTORE% /set %guid% device partition=C:
bcdedit.exe /store %BCDSTORE% /set %guid% path \grldr.mbr
bcdedit.exe /store %BCDSTORE% /set %guid% description "Grub4dos"
bcdedit.exe /store %BCDSTORE% /displayorder %guid% /addlast
endlocal
pause
.
Copy the Grub4dos file
grldr to the root of a partition (filesystem must be FAT12/16/32/NTFS). Also create a configuration file
menu.lst at the root of a supported partition - use the same partition as
grldr.
Create vhd fileRun the following commands in Diskpart (adjust size, path and mount point to your needs - in the example below the vhd will be 15 GiB in size (maximum=15360)) -
create vdisk file=D:\windows.vhd type=fixed maximum=15360
attach vdisk
create partition primary
active
format fs=ntfs quick
assign letter=W
.
Apply Windows filesUse DISM to apply the contents of install.wim (E:\sources\install.wim) to the mounted VHD file (mount point W assigned in the preceding step). Adjust image/index number as required -
Dism /Apply-Image /ImageFile:E:\sources\install.wim /ApplyDir:W:\ /Index:1 /WIMBoot
.
Alternatively use wimlib -
wimlib-imagex apply E:\sources\install.wim W:
.
Install SVBusUse DISM (adjust path to svbus.inf). Note the use of /ForceUnsigned on 64-bit Windows (the /ForceUnsigned parameter is not required if the source is 32-bit) -
dism.exe /image:W: /Add-driver /Driver:D:\SVBus\svbus.inf /ForceUnsigned
.
NOTE - If installing SVBus post Windows installation (e.g. in an existing Native Boot VHD setup) then you will need to use the Advanced Options (F8) menu during boot and "Disable Driver Signature Enforcement" (applies to 64-bit only - and to signed and unsigned version of the SVBus driver).
Create boot filesUse bcdboot -
bcdboot W:\Windows /s W: /f BIOS
.
Modify BCD StoreThis step is not required if booting a 32-bit Windows or using
yamingw's signed SVBus drivers from
tinybit's post (
here).
As DISM was used to install the unsigned SVBus driver, the only modification required is enabling testsigning -
bcdedit /store W:\boot\BCD /set {default} testsigning on
.
Detach vhd fileRun the following commands in Diskpart -
select vdisk file=D:\windows.vhd
detach vdisk
.
menu.lst entryThis is my entry for a system with one disk. You may need to adjust this if you have more than one disk on the system.
title windows.vhd - SVBus RAMDISK
find --set-root --ignore-floppies /windows.vhd
map --top --mem /windows.vhd (hd0)
map (hd0) (hd1)
map --hook
root (hd0,0)
chainloader /bootmgr
title windows.vhd - SVBus FILEDISK
find --set-root --ignore-floppies /windows.vhd
map /windows.vhd (hd0)
map (hd0) (hd1)
map --hook
root (hd0,0)
chainloader /bootmgr
.
Boot the disk imageSimply reboot the system, select menu entry
Grub4dos (in the Windows boot menu) and then select the
windows.vhd - SVBus FILEDISK entry in the Grub4dos menu. Repeat following the multiple reboots that take place during the installation, until the Windows installation has completed.
After fully completing the Windows installation using the
windows.vhd - SVBus FILEDISK menu option, you can test the
windows.vhd - SVBus RAMDISK option providing that you have enough RAM to load the image.
Misc.If you do not want to mess around installing grub4dos to you internal drive then you may be able to install and boot it from a USB thumb drive or CD.
Using DISM to install the svbus driver may fail if the DISM version being used is older than the Windows target. I was not able to use Windows 8.1 DISM to install svbus to a Windows 10 target, however I was able to use Windows 10 DISM to install svbus to a Windows 8.1 target.
JFX's GetWaikTools can be used to download different DISM versions. No installation is required for GetWaikTools or DISM - Simply use the downloaded DISM in your path (e.g. run "D:\GetWaikTools\DISM.exe /image:W: /Add-driver /Driver:D:\SVBus\svbus.inf /ForceUnsigned").
____________________
Misty