q3..ny..3c..vc..7a..pg..st..et..iv..sc..1d..is..n6..ik..ia..pu..if..0v..uo..nr..fc..bg..ig..qd..nx..ey..kg..c5..vd..nw..bu..el..zt..qp..xu..gq..fb..xq..6h..85..tg..bq..bn..mg..nu..kc..kb..e6..18..ov..ym..xj..fa..2r..pe..4i..st..pu..sh..po..5r..7n..k3..j2..lf..lb..fc..tp..jn..6i..kw..sw..sm..oo..1u..3f..j6..ma..gl..dc..k3..1e..2o..cl..0j..qs..uw..4o..ns..dg..3n..fz..ph..iz..dh..k5..iq..nu..lt..ni..9a..do..ty..er..ek..xi..rn..vk..pa..68..9p..a2..6i..rf..aw..uh..6y..el..pu..tg..jg..dt..p5..f8..zw..an..pu..xq..z6..g5..ue..j1..r3..te..sv..05..2e..83..mr..ue..wb..1d..pz..el..9h..ot..di..nn..hb..xt..w7..me..qr..ry..jy..q9..xr..8x..au..sx..ju..r0..wr..iw..wa..on..b0..ak..9v..kn..og..y4..c3..ba..ay..wm..wl..ei..kb..py..q2..iy..fd..lk..ba..c2..tv..dc..0g..p1..c3..ai..qh..ry..cb..jz..rh..t6..4f..j9..m1..hk..zp..bd..xi..7i..pi..hl..pm..vl..no..47..88..cy..zj..uq..bg..8k..tl..oh..ye..bs..jc..cf..xf..pv..d8..g0..io..uz..uh..gx..ae..ld..xo..pn..uy..fr..sg..9r..ut..gg..fk..wh..j3..am..tq..gg..7p..gv..uk..ap..gn..gh..uo..ns..vh..c2..yk..pb..nw..us..jf..tv..0e..uz..cw..e2..b6..to..al..4b..rx..qz..co..nd..tk..g3..ti..lm..es..lh..ur..fo..33..zr..pi..ev..zt..iy..w7..c1..al..yt..xh..l9..6x..ey..e1..qs..rt..ew..gb..uw..4f..gy..gc..kg..rx..pb..if..3b..3p..do..7e..nz..ld..mc..wm..su..c0..xg..up..tu..lk..3y..al..hx..oa..lj..ee..xn..1c..lx..o3..a1..eb..4u..ib..vu..92..cg..5f..oq..i1..oi..vz..u5..gm..ab..j3..nx..pc..m6..ug..w2..ia..fu..ms..on..8x..sb..gv..nf..uu..yi..lc..3i..0o..oq..qp..yp..xi..sf..c0..ob..du..92..i1..mi..dm..rs..m1..uy..m5..rm..ov..6o..wr..lr..uy..h8..yo..id..ru..nd..ny..9z..f2..r6..hy..t6..b2..jz..9n..ii..ui..fu..0r..re..19..b5..lm..c5..zl..lg..pb..93..oz..ot..hz..2n..w2..iq..le..ri..qm..8e..zd..2d..ri..t8..sc..ib..tx..og..bd..ma..it..29..za..hw..es..vc..b1..1t..6z..sn..d7..kf..y4..i4..3z..70..gg..bc..zw..sm..qg..3x..xn..pb..oh..lc..2v..5p..sx..15..3e..r4..zk..xs..1m..8f..je..pu..gl..6r..4u..sw..i1..uw..r0..wy..ue..w7..ea..1r..ju..6y..xq..ka..g2..dp..va..oo..sv..io..1d..co..us..fn..tw..ce..9l..xd..db..bu..aw..ay..w4..vu..bu..n1..td..z6..gp..xf..x4..lk..ry..rj..n6..tt..vi..jl..lb..8u..sr..ge..cc..na..z8..tt..cz..ty..nu..ot..qx..8w..oq..zy..jb..lv..ky..eg..2n..qe..8r..2x..br..hu..iz..gg..tr..ee..lo..yu..vu..oa..wy..t9..sd..ud..8l..7g..y2..1r..gc..71..jm..xb..ve..8r..1c..vz..xf..gn..3u..x6..hv..lb..5r..ud..gs..rq..op..md..ft..se..ji..jg..po..bm..yr..zz..rb..cg..og..ma..y3..bu..j7..jd..qf..yi..sz..rr..o3..f9..f4..vq..pv..iw..ab..iq..k9..ti..of..bd..zf..3x..et..hq..lt..sx..no..s4..gj..3x..ai..ml..2v..qb..dv..sm..wj..nc..qb..mw..my..7r..o0..xv..cz..zi..gq..lx..fk..h7..kv..hv..iy..e4..bb..uv..we..mh..ao..xo..su..xs..mi..et..c7..nj..vt..c4..ko..xh..zj..nk..aa..of..n4..k0..8u..qq..e0..ak..gc..rj..d4..ml..1z..1k..za..pl..7w..jx..sm..6t..re..cx..cr..tu..eg..z5..d9..ai..pu..by..yb..ic..vq..ca..hv..mg..sn..ct..bb..iq..uu..ep..sv..ub..ud..lv..m7..yp..70..jw..xb..0c..5e..xk..bl..ob..ve..7o..cl..qq..ez..lu..nm..kd..pz..bp..fx..fc..jn..1r..py..uw..10..w8..lk..id..yr..bu..1q..kg..bn..be..tc..b8..tg..tl..bh..xv..p6..sa..af..gf..6q..ai..7c..ax..bu..ud..8u..fv..jf..he..yp..4r..nu..7w..o1..mg..eq..gu..oj..za..xy..u4..ut..eg..1a..fn..xu..vl..0f..dx..nd..0h..kn..it..xe..sn..4o..7s..ed..xj..ik..p9..ml..wr..79..gp..fu..tt..dz..i4..0t..qp..kw..tv..md..ew..qn..ty..rz..d3..fz..nt..co..qk..fu..uf..c8..cs..mp..6s..cg..zo..ja..ra..ra..us..je..q3..mf..az..ls..gm..sx..gn..pl..wf..sz..a7..gu..j3..56..jd..lr..qz..z8..vr..fy..c2..2t..v5..kt..yc..vh..20..o2..pm..le..kk..br..b6..is..j5..of..rt..cc..rg..jl..gr..yd..nd..iq..sf..dk..vj..4s..5s..zj..lt..j2..m7..mu..xm..ek..m6..jj..re..fw..uw..tk..jp..u5..eb..qt..a8..0a..l3..dd..rs..1v..gk..fb..gm..od..8o..di..qh..73..xj..t8..b4..oa..xc..wx..4m..ro..db..py..ds..ps..e0..n2..sv..ly..0d..kg..9l..yi..t3..pu..ns..qa..gi..zc..to..uy..2m..gv..op..p3..2d..9x..6x..b1..bu..vf..zl..7t..bl..yb..wf..wb..hk..hn..df..w0..tj..ip..pc..hl..zi..ss..it..zu..rl..kw..3m..p6..pq..bf..yp..rl..er..pn..at..vh..vi..cb..lz..8n..ae..xs..6j..p2..vi..yu..6a..8c..1 Native boot VHD – Dual boot made easy! – Win10.Guru
Go to ...

RSS Feed

Native boot VHD – Dual boot made easy!


The easiest, most convenient method to use different versions and editions of Windows 10 in dual or multi boot scenario is through a native boot virtual hard disk. No partitioning or virtualization is required: just create a VHD, install Windows on it, and when done and it’s no longer needed, delete the VHD file.

This kind of thing is ideally suited to test Windows Insider builds, where the computer is running the latest official version of Windows 10, and you install an Insider build onto a VHD and add it to your boot menu.

Compared to a virtual machine, native boot VHD is faster. Instead of emulated virtual devices, it uses the host computer’s physical devices. It acts and behaves exactly as if it were a real physical installation.

Deploy to VHD

Scripting the deployment makes it easy. I use a DISKPART script to create the VHD and partition it, then a batch file to run DISKPART, deploy Windows and add it to the host boot menu. In the title image above you can see my current boot menu, physical installation as default OS, and both Finnish and Swedish Insider previews installed on respective VHD files.

In this post, I will add an English Insider preview as a native boot VHD.

First, here’s the DISKPART script:

create vdisk file=F:\VHD_Store\W10PROIPx64EN-GB.vhdx maximum=51200 type=expandable
attach vdisk
create part primary
format quick label="Windows"
assign letter=W
exit

Although my host machine is a GPT partitioned UEFI system, there are no benefits in partitioning the VHD as a GPT disk. The above script makes a dynamically expanding 50 GB MBR VHD in F:\VHD_Store folder, assigns it a temporary drive letter W and mounts it. Notice that to use VHD in native boot, it must be a VHDX file with extension .vhdx. Although the extension .vhd is also valid extension for a VHD file, it can’t be used for native boot. I save the script as normal text file %userprofile%\Scripts\VHDConf.txt.

Next, here’s the batch file that does the real magic:

start /wait diskpart /s %userprofile%\Scripts\VHDConf.txt
start /wait dism /apply-image /imagefile:J:\sources\install.wim /index:1 /applydir:W:\
start /wait bcdboot W:\Windows
start /wait bcdedit /set {default} description "W10 PRO IP x64 EN-GB (VHD)"
cls
@echo off
echo.
echo Windows deployed to VHD file
echo and added to host boot menu.
echo.
pause
exit

The /s switch in the first command tells DISKPART to run a script. When it’s done, Insider Preview Windows 10 PRO edition (index 1) will be deployed to VHD from an ISO file mounted as the J: drive. The /applydir drive letter must of course be the same one we assigned in the DISKPART script, W: in this example.

When deployed, Windows on VHD will be added to the host boot menu as the default OS, and it is given a descriptive name.

That’s it! Run the batch file elevated (right click, select Run as administrator). A virtual hard disk will be created and Windows deployed to it.

 

Prepare the VHD

The VHD will be automatically dismounted when you restart the computer. It doesn’t need to be mounted to boot to it. However, as it still is mounted on the host after we run the batch to deploy Windows, it’s easy to add for instance software installers to it, or add a custom answer file to automate OOBE.

In my case now, I copied some browser offline installers to VHD’s Users\Public\Downloads folder, and my standard answer file to its Windows\Panther folder:

Notice that the folder Windows\Panther does not exist by default, I had to create it and copy my answer file unattend.xml to this folder. When OOBE is run, if an unattend.xml answer file is found in this folder, Windows Setup automatically applies it.

My standard answer file completely automates OOBE, booting straight to desktop. I’ll add the code here, you can copy it and with small modifications use it on your VHD (click expand source to view the code):

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>040b:0000040b</InputLocale>
            <SystemLocale>EN-GB</SystemLocale>
            <UILanguage>EN-GB</UILanguage>
            <UILanguageFallback>EN-GB</UILanguageFallback>
            <UserLocale>EN-GB</UserLocale>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <VMModeOptimizations>
                    <SkipAdministratorProfileRemoval>false</SkipAdministratorProfileRemoval>
                </VMModeOptimizations>
                <HideEULAPage>true</HideEULAPage>
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <ProtectYourPC>1</ProtectYourPC>
                <UnattendEnableRetailDemo>false</UnattendEnableRetailDemo>
            </OOBE>
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Description>Local admin account</Description>
                        <DisplayName>Kari</DisplayName>
                        <Group>Administrators</Group>
                        <Name>Kari</Name>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <RegisteredOrganization>Win10.guru</RegisteredOrganization>
            <RegisteredOwner>Kari</RegisteredOwner>
            <TimeZone>W. Europe Standard Time</TimeZone>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OEMInformation>
                <Manufacturer>Win10.guru</Manufacturer>
                <Model></Model>
                <SupportHours>24/7</SupportHours>
                <SupportPhone>+44 123 4567890</SupportPhone>
                <SupportProvider>Win10.guru</SupportProvider>
                <SupportURL>https://win10.guru</SupportURL>
            </OEMInformation>
            <ComputerName>WG10</ComputerName>
            <CopyProfile>true</CopyProfile>
            <OEMName>Win10.guru</OEMName>
            <RegisteredOrganization>Win10.guru</RegisteredOrganization>
            <RegisteredOwner>Kari</RegisteredOwner>
            <TimeZone>W. Europe Standard time</TimeZone>
        </component>
    </settings>
</unattend>

Please notice: the preceding answer file sets the Windows language as UK English, and the keyboard layout (InputLocale) as Finnish. Here’s a quote from another Win10.guru guide:

Regional and language settings

InputLocale value, in my case for Finnish keyboard is 040b:0000040b, everything else is set to UK English (SystemLocale, UILanguage, UILanguageFallback, UserLocale). Here’s a short list of some other InputLocale and language codes:

– Brazil – Portuguese > 0416:00000416, pt-BR
– Canada – English > 1009:00000409, en-CA
– Canada – French > 0c0c:00011009, fr-CA
– France – French > 040c:0000040c, fr-FR
– Germany – German > 0407:00000407, de-DE
– UK – English > 0809:00000809, en-GB
– USA – English > 0409:00000409, en-US

Boot to VHD

Restart the computer. The new VHD installation is now shown as default OS. We can change the defaults later, but because OOBE makes a few restarts, it’s practical to let it be default for now:

Select it, and let OOBE run. When on its desktop, you can change the boot menu default OS back to your main host OS.

I said earlier that Windows on VHD is exactly the same as any physical installation. Strictly speaking, that is not true: it can’t be upgraded! When a feature upgrade recognizes the device as virtual hard disk, you will see this warning:

Luckily, that’s a minor issue. In the next post, I will show how to work around this limitation. See this post: Native boot VHD – How to upgrade Windows

You might want to see how easy this is. I made this video for Ten Forums almost two years ago, but it’s still valid:

Stay tuned!

Kari

[Note added 9/25/2019 for Spiceworld 2019 attendees]  See my post-show follow-up post at edtittel.com for a link to the slide deck based on this article, and some additional explanation about .vhdx files for native boot: SpiceWorld 2019: Native Boot VHDs in Windows 10.

Author: Kari Finn

A former Windows Insider MVP, Kari started in computing in the mid 80’s writing code for VAX / VMS systems. Since then, he’s worked in a variety of IT positions. He specializes in Windows image capture, customization, repair and deployment as well as Hyper-V virtualization. Kari is a proud Team Member at number #1 Windows site TenForums.com.

Leave a Reply