Sunday, September 8, 2019

How to setup and install Windows 7, 8, 10 VHD Dual Boot

References: 


######## Step 1: Create a VHD from diskpart ######## 
CMD Run as Administrator:
C:\Windows\system32>diskpart
DISKPART> create vdisk file="C:\win10.vhd" maximum=95000 type=expandable 
DISKPART> attach vdisk
DISKPART> clean
DISKPART> create partition primary
DISKPART> active
DISKPART> format fs=ntfs label=win10vhd quick
DISKPART> assign letter=v
DISKPART> exit


######## Step 2: Apply a Windows image to the VHD,  Detach the VHD ######## 
Mount windows 10 iso in Drive (D) to copy and extract (D:\sources\install.wim) to “win10vhd” partition, list image info with index number:
C:\Windows\system32>Dism /Get-ImageInfo /ImageFile:D:\sources\install.wim


(Windows 10 VHD Support: Set-Edition:Professional  index:6)
C:\Windows\system32>Dism /Apply-Image /ImageFile:D:\sources\install.wim /index:6 /ApplyDir:V:\ /Set-Edition:Professional /AcceptEula /Set-AllIntl:en-US /NoRestart


(Windows 8 VHD Support: Set-Edition:Professional  index:1)
C:\Windows\system32>Dism /Apply-Image /ImageFile:D:\sources\install.wim /index:1 /ApplyDir:V:\ /Set-Edition:Professional /AcceptEula /Set-AllIntl:en-US /NoRestart


(Windows 7 VHD Support: Set-Edition:Ultimate index:4)
C:\Windows\system32>Dism /Apply-Image /ImageFile:D:\sources\install.wim /index:4 /ApplyDir:V:\ /Set-Edition:Ultimate /AcceptEula /Set-AllIntl:en-US /NoRestart


C:\Windows\system32>diskpart
DISKPART> select vdisk file="C:\win10.vhd"
DISKPART> detach vdisk
DISKPART> exit


######## Step 3: Copy it to the destination PC device, and attach it (optional) ######## 
C:\Windows\system32>diskpart
DISKPART> select vdisk file="C:\win10.vhd"
DISKPART> attach vdisk
DISKPART> list volume
DISKPART> select volume 3 (Volume with Label win10vhd)
DISKPART> assign letter v
DISKPART> exit


######## Step 4: Add a boot entry ######## 
C:\Windows\system32>diskpart
DISKPART> list volume
DISKPART> exit


- Add VHD windows to bootloader startup menu:
C:\Windows\system32> V:
V:\ cd v:\windows\system32
V:\Windows\system32> bcdboot v:\windows /v
V:\Windows\system32> bcdedit /v


- Restart the destination PC.


######## Step 5: Delete VHD Dual boot ######## 
Boot destination PC with another windows 
RUN (windows + R) > msconfig > boot (Tab) > Select Windows 10 (V:\windows) : Default OS > Delete (Button)


or using CMD Run as Administrator:
C:\Windows\system32> bcdedit /v
device                  partition=V:
osdevice              partition=V:
systemroot          \windows
resumeobject     {752e9dcc-a0fa-11e9-8b5b-b7e48a5b481d}
C:\Windows\system32> bcdedit /delete {752e9dcc-a0fa-11e9-8b5b-b7e48a5b481d} 

- Restart the destination PC.

No comments:

Post a Comment