Professional Documents
Culture Documents
Booting Windows 10 Natively From A .VHDX Drive File: Cesar de La Torre
Booting Windows 10 Natively From A .VHDX Drive File: Cesar de La Torre
Booting Windows 10 Natively From A .VHDX Drive File: Cesar de La Torre
DevBlogs
Login
Cesar de la Torre
Product Blogs
DevOps
.NET
file
Platform Development
Data Development
Cesar
January 21st, 2017
https://devblogs.microsoft.com/cesardelatorre/booting-windows-8-1-update-natively-
from-a-vhdx-image/
I’m also publishing this for my own records and folks asking me about it, as it is not a
super straight forward procedure..
This procedure is very useful when you need to boot Windows natively, but you need to
have multiple different environments like when using BETA/RC versions of Visual Studio,
dev tools or simply dual/multiple boots with different configuration and software
installed but you don’t want to have any compromise in UI performance like when you
use Hyper-V or any other virtual machine environment.
Doing this you don’t have to give up on performance, this is the real thing! you boot
natively. This is NOT a VM (Virtual Machine) booting from Hyper-V.
This is native boot but instead of booting from files in a partition, you boot from files
that are placed within a .VHDX file. But you boot natively!
Why would you want to boot natively? Here are a few reasons:
– Need to use Android emulators on top of any hypervisor like Hyper-V (Nested
virtualization doesn’t have great performance..).
– If you want to deploy mobile apps from Visual Studio (Xamarin apps to Android or
Windows devices, for instance), you’d need to connect those mobile devices to any USB
port. But, Hyper-V VMs don’t support USB connections to devices.
– Want to get good UI/Graphics experience, as much as you PC can offer with your
graphics card not being limited by any hypervisor, like Hyper-V
– In any case where you want to get good performance from your machine because
what you get from a Hyper-V VM is not enough and at the same time you want to
handle multiple environments within the same machine (although you’d be able to boot
just one of them, of course).
Here’s some additional info if you want to know more about “Virtual Hard Disks
(.VHD/.VHDX) with Native Boot”: http://technet.microsoft.com/en-
us/library/hh824872.aspx
In the past, I used to follow more complex steps in order to create a Windows 8 or
Windows 7 .VHD master image, then booting natively my machine by configuring the
boot options with bcdedit. Here’s my old post:
http://blogs.msdn.com/b/cesardelatorre/archive/2012/05/31/creating-a-windows-8-
release-preview-master-vhd.aspx?wa=wsignin1.0
This is the way I currently do it. I’m using .VHDX format but you could also specify a
.VHD (older) if you’d like.
[Another way to create the .VHDX, that I haven’t tested, instead of using that PowerShell
script is by using the DISM tool (Deployment Image Servicing and Management) from
the Windows ADK) ]
4. Before executing the PowerShell script, you’ll need to allow scripts executions in the
policies of your machine or user. If you want to allow that at a local machine scope, run
the following command in the PowerShell console. IMPORTANT, run PowerShell with
Admin rights (“Run as Administrator” mode):
If you don’t run that command or you don’t have that policy in place, you’ll get an error
like the following when trying to execute any PowerShell script:
5. Edit the Convert-WindowsImage.ps1 file with Windows Powershel ISE (or with any
editor, even NOTEPAD can work for this).
If using Windows Powershel ISE, you’d better run it with admin rights (“Run as
Administrator” mode) so you can directly run the script with F5 afterwards.
Then, add the following line at the end of the script (or update it with your .ISO image
name and settings if you got my updated file:
6. Now, run the script either from Windows PowerShell ISE (with F5) or running it from a
plain PowerShell command-line (In both cases with Admin privileges)
It’ll be executed like the following screenshot. Be patient, it’ll take a while as it has to
copy all the files from the Windows .ISO image to the logical drive based on the .VHDX
file that has been created.
Since my .VHDX is Dynamic and it is still not mounted, its size was just something less
than 8GB!
Right-click the VHDX and mount it. In my case I got the F: as my mounted drive.
The following steps are needed to make your computer boot from the VHDX file:
a.Open an administrative command prompt via WIN+X Command Prompt (Admin)
b.Type bcdboot F:\Windows in order to create the boot files in your .VHDX drive.
10. Change the Boot Loader Description to the boot option’s name you’d like
Type again bcdedit /v, search for the boot loader pointing to the .VHDX and copy its
GUID.
Taking that GUID identifier you can change the description in your bootlist by typing
something like:
Check again with bcdedit /v that the descrption for your new boot loader has changed:
11. Re-enable Hyper-V if you had Hyper-V enabled in your original and normal boot
partition
If you had configured Hyper-V on your Windows 8.1 computer, don’t forget to enable
the hypervisor launchtype:
When messing with the startup, it rebuilds your boot configuration data store. But it
doesn’t know if Hyper-V needs to have some specific settings enabled in the boot
configuration data store in order to start the hypervisor. In any case, this is not related
and you just need to do it if you also have HyperV installed.
12. YOU CAN NOW RE-START YOUR COMPUTER AND FINISH THE WINDOWS
INSTALLATION.
If you reboot your machine, you’ll be able to select the new NATIVE WINDOWS BOOT
but from a .VHDX like in the following screenshot!
It’ll be just the final Windows installation detecting devices, applying drivers and final
configuration/personalization, and YOU ARE GOOD TO GO!
Additionally, bcdedit has many useful options, like copying an entry for pointing to
another .VHDX that you just copied in your hard drive, etc. Just type bcdedit /? to check
it out or see other options that I explain at the end of my old post:
http://blogs.msdn.com/b/cesardelatorre/archive/2012/05/31/creating-a-windows-8-
release-preview-master-vhd.aspx?wa=wsignin1.0
END OF PROCEDURE
///////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
If you copy the “MASTER .VHDX”, you could re-use it for multiple boots, even for other
machines.
Here’s the procedure once you have an existing MASTER .VHDX already created.
First, copy and rename the .VHDX to a different name depending on what you will
install, like “Windows_10_for_Testing_Betas.VHDX” or whatever. In my screenshots I’m
still using a similar name than before, though.
You can configure the boot options of windows by using the command-line tool
bcdedit.exe.
bcdedit /v
Let’s say you start in another computer with a single boot from a single regular
partition, you’ll see a similar description to the following:
You can see that I currently just have a single boot loader, booting from the C: partition.
That line means you are copying the current Boot loader (the one I marked) but naming
it with a different DESCRIPTION. And also, very important, when you copy any BOOT
LOADER, the new copy will have a new GUID identifier, which is what you are going to
use.
Then, type again bcdedit /v to see the new BOOT LOADER created:
You can see how now you have a second BOOT LOADER (#2 BOOT) with a different
GUID than the original (#1 BOOT).
It also has the new description applied like “Windows 10 .VHDX Boot”. You’ll see that
description when selecting the Boot option when starting your machine.
However ,you are still not done, as that second BOOT LOADER is still pointing to the C:\
partition, and you want it to be pointing to the .VHDX file!
3 Copy the new GUID (from BOOT #2) with the mouse, so you can use it in the next
step. In this case I copy: {bd67a0a4-a586-11e6-bf4e-bc8385086e7d}
4 In order to point BOOT LOADER #2 to your .VHDX file, type the following 2
commands:
Check that you have this new boot from Computer properties –> Advanced System
Settings –> Advaced –>Startup and Recvovery –>Settings button:
You can just reboot the machine and select the BOOT option for your new .VHDX, and
it’ll boot natively from that .VHDX!
You can update your boot loaders with commands like the following using the GUID of
the BOOT LOADER you want to change:
COPY
Cesar De la Torre
Principal Program Manager, .NET
Follow
Tagged Windows 10
Read next
Comparing ASP.NET Core IoC container Domain Events vs. Integration Events in
service lifetimes with Autofac IoC container Domain-Driven Design and microservices
instance scopes architectures
In ASP.NET Core you can use the simple built-in IoC This blog post is about comparing several approaches of
container or you can also plug any other more advanced Domain Events vs. Integration Events patterns already
IoC container like Autofac. When plugin an external published by the community. I might evolve this post ...
container ...
Cesar De la Torre February 7, 2017
Cesar De la Torre January 26, 2017
0 comment
0 comment
0 comments
Comments are closed. Login to edit/delete your existing comments
Archive
November 2019
September 2019
June 2019
May 2019
March 2019
May 2018
February 2018
November 2017
July 2017
May 2017
March 2017
Relevant Links
Topics
.NET .NET 3.5 .NET 4.0 .NET 4.5 .NET 4.5.1 .NET Core .NET Framework ADO.NET AI AIF Alexandria Android API Gateway
AppFabric Architecture ASP.NET Core Autofac AzMan Azure Azure App Service Azure Cognitive Services Custom Vision
Azure Container Registry Azure Container Service Azure Functions Azure Mobile App Azure Service Fabric azuredevops Biztalk Server C#
CardSpace Chocolatey CodePlex Containers CQRS DDD devops DI Docker Docker Swarm Domain Events Domain-Driven Design
Entity-Framework Event-Sourcing Expression Blend IE8 IHostedService Integration Events IoC iOS ISB Jupyter Kubernetes
M Language Machine Learning machinelearning MDD Mesos DC/OS Metro Microservices Microsoft Microsoft Events Speaker ML
ML.NET mlnet Model-Driven-SOA Modern Apps MUrl N-Layer N-Tier Notebooks Ocelot Oslo Patterns PDC PowerApps
RIA RIA Services Roslyn S+S Security Service Fabric Silverlight SOA SQL Azure SQL Server 2008 Surface Book Swagger
Swashbuckle TensorFlow Titan Unity Universal Windows apps Visual Studio 2008 Visual Studio 2010 Visual Studio 2012 Visual Studio 2013
VS Android Emulator VS.Lightswitch VSTS 2010 WCF WCF LOB Adapters WebAPI Window Azure Windows 10 Windows 7 Windows 8
Wi d 81 Wi d S 2008 Wi d S 2008 R2 X X i Z h F k
Stay informed
Surface Laptop Go Download Center Office for students AppSource Windows Dev Center About Microsoft
Surface Pro X Microsoft Store support Office 365 for schools Automotive Developer Center Company news
Surface Go 2 Returns Deals for students & parents Government Microsoft developer program Privacy at Microsoft
Surface Book 3 Order tracking Microsoft Azure in education Healthcare Channel 9 Investors
Microsoft 365 Virtual workshops and training Manufacturing Microsoft 365 Dev Center Diversity and inclusion
Windows 10 apps Microsoft Store Promise Financial services Microsoft 365 Developer Accessibility
Program
HoloLens 2 Financing Retail Security
Microsoft Garage
English (United States) Sitemap Contact Microsoft Privacy Terms of use Trademarks Safety & eco About our ads © Microsoft 2020