3-in1: 3 great ways to test Windows 10

alb3530

New member
Feb 26, 2014
55
0
0
Visit site
This 3-in-1 tutorial is meant to make people familiar with Windows 10, as well as allow testing your environment before upgrading your production machine.

All things explained here are not new, and are not "Windows 10 exclusive", but they're not very known.

For example, did you know you can boot Windows 7 in a physical machine from a virtual disk?

That's why I've decided to post this, both to make that information more public (once Windows Central is a good place for that), and also to make people able to test Windows 10 in a more realistic way, in order to determine whether those legacy applications (or even devices) will actually work on it.

With the Windows 10 release, I think it's the perfect time for such a guide.

Before starting, keep in mind you do it at your own risk.

I'll cover three things here, as follows:
1 - Convert a physical machine to a virtual hard disk
2 - Boot a physical machine from a virtual hard disk using VHD Native Boot
3 - Install Windows 10 to a USB drive and run it from there

While I will try to make it as short as I can (to avoid a boring reading), at the same time I won't omit important details.

Let's start:

1 - Convert a physical machine to a virtual hard disk

The idea behind this is you can clone your current physical machine to a Virtual Hard Disk file (VHD), thus being able to update the cloned machine to Windows 10, in order to test your apps and devices.By doing so, your real machine remains intact, and you can upgrade it later if your tests were successful.

Requirements:

Disk2vhd:
https://technet.microsoft.com/en-us/sysinternals/ee656415

Quick process:

Run Disk2vhd (it might ask for administrative privileges, and you should confirm it) from the machine where the hard disk you want to convert is in.

Disk2Vhd.PNG

The process is very straightforward:
You mark the volumes you want to make a VHD from, choose a path in "VHD File name" for the destination disk, and press "Create".After the process completes, you'll have your disk(s) in a VHD form.
You can then start a machine from that disk, upgrade it to Windows 10, and test your apps, to see if all goes well.

Long details:

In order to make the resulting VHD bootable, when marking the volumes you want to convert to a VHD, you need to be aware the Windows partition (that one with Windows files and folders) and the boot partition (that one with the boot files) might be two separated partitions.
In that case, identify them in Disk2vhd, and make sure to mark both.

Disk2vhd has two options, marked by default.

"Use Volume Shadow Copy": It allows Windows' Volume Shadow Copy service to be used, what means you can convert the system disk (that's in use) to a VHD file.

"Use Vhdx": you can choose whether to use the newer Vhdx format, or the older vhd format.Basically, you only need to uncheck that option if both

you'll be booting a physical machine from the resulting VHD

and

Windows 7 is the main OS in the resulting VHD.

To short, only Windows 8 (and above) can be booted from a Vhdx in a physical machine. If you'll be upgrading to Windows 10 in a virtual machine, you can securely go for Vhdx, as it offers better performance and reliability than the Vhd format.


2 - Boot a physical machine from a virtual hard disk using VHD Native Boot

"VHD Native Boot" first appeared in Windows 7, and allows you to boot a physical machine from a virtual disk without having to touch in physical disk's partition layout.
You can use this technique to test your devices with Windows 10, once virtual machines can't access hardware devices directly.

Requirements:

A bootable VHD with Windows 7 or above;
A physical machine running Windows 7 or above;

Complete process:

Open the command prompt as administrator.

Type bcdedit and press enter.It should list the boot entries, like below:

Bcdedit default.PNG

In my case, there's just one operating system, plus the Windows Boot Manager (that's loaded before any operating system)

Next, type:

bcdedit /copy {current} /d "Windows 10 Pro x64 Insider Preview"

This should duplicate the current operating system's boot entry.
In this example, I've used "Windows 10 Pro x64 Insider Preview" as the description, but you can write your own here.

The command should return something like:

"The entry was successfully copied to {38f90393-81f6-11e4-a08d-a7a3bd2bfe1b}."

Bcdedit entry copied.PNG

At that point, there should be one more operating system to choose from when starting the computer, called "Windows 10 Pro x64 Insider Preview".

Did you see that alpha-numeric sequence between curly braces?
Take note of that sequence, cause it's the identifier of new operating system you're adding to the boot entries.
You'll need it for the next 3 commands.

Note that "{38f90393-81f6-11e4-a08d-a7a3bd2bfe1b}" was generated randomly (better saying, according to my system), so you won't see that exact sequence in your machine.


In my case, it's {38f90393-81f6-11e4-a08d-a7a3bd2bfe1b}

Now, using File Explorer, locate the full path of the VHD file you want to boot from.
Let's suppose it's

K:\ALB3530\VHDs\WIN 10 TP x64.vhdx

Now, type the commands below, replacing {38f90393-81f6-11e4-a08d-a7a3bd2bfe1b} with the identifier you got.
Also, replace [K:]"\ALB3530\VHDs\WIN 10 TP x64.vhdx" with your VHD path.

bcdedit /set {38f90393-81f6-11e4-a08d-a7a3bd2bfe1b} device vhd=[K:]"\ALB3530\VHDs\WIN 10 TP x64.vhdx"
bcdedit /set {38f90393-81f6-11e4-a08d-a7a3bd2bfe1b} osdevice vhd=[K:]"\ALB3530\VHDs\WIN 10 TP x64.vhdx"
bcdedit /set {38f90393-81f6-11e4-a08d-a7a3bd2bfe1b} detecthal on

Pay attention in the path format:

Drive letter is between square brackets, and the remaining path is between double quotes

Bcdedit dev and osdev.PNG

It should say "The operation completed successfully." after every command.Otherwise, you made some mistake, like wrong VHD file path, wrong syntax, etc.

If you type bcdedit again, it should display the new entry at the bottom, as below:

Bcdedit list.PNG

Now just restart the machine, and choose the operating system you've just added.

Scenarios where VHD Native Boot doesn't work:

-Not enough space in the host volume to accommodate VHD full size;

-The VHD is stored in a physical dynamic disk;

-The operating system installed to the VHD isn't Windows 7 Ultimate (or Enterprise), Windows 8/8.1 Pro (or Enterprise) and Windows 10 Pro (or Enterprise);

-The VHD is compressed or encrypted;

-The physical drive where the VHD is stored is protected by BitLocker;

Limitations of VHD Native Boot:

You can't upgrade the operating system that's running from a VHD in a physical machine (i.e.: upgrade Windows 7 to Windows 10);
That limitation can be easily overcome by upgrading the operating system in a virtual machine.
After that, just start the physical machine from that VHD.
If case of boot error, review the bcd entries.


Additional details:

A common cause that results in a blue screen when trying to boot from a VHD is when you don't have enough space in the host volume where the VHD file is stored to accommodate it's full size.
Eventhough the VHD was created as "Dynamically Expanding" (VHD file size is increased as disk is being filled), Windows expands it to its max file size when booting.

If it fails, you'll get a blue screen:

VHD boot STOP error.jpg

Also keep in mind Windows creates the page file in the host volume, so make sure you have enough space for that too.

If you attach the VHD disk (by double-clicking it) to the system, you can use its letter to set device and osdevice in bcdedit, like this:

bcdedit /set {38f90393-81f6-11e4-a08d-a7a3bd2bfe1b} device partition=K:
bcdedit /set {38f90393-81f6-11e4-a08d-a7a3bd2bfe1b} osdevice partition=K:

That way, you don't need to specify VHD full path.

3 - Install Windows 10 to a USB drive and run it from there

You don't need Windows To Go feature from Windows Enterprise to be able to boot Windows 8.1 (and above) from a USB drive.

Running Windows Insider Preview from a USB is a great feature, as you can take Windows with you.
All your files and applications, whenever you need them.

Here's how to do it:

Requirements:

Windows 8 Pro (or above) with Hyper-V enabled;
A USB hard disk drive;
Windows 8 (or above) ISO;

Short process:

Plug the USB drive in your PC.
After that, press Windows + X, and select "Disk Management".
Identify the USB disk there. (in my case, it was Disk 4).
Right click it the Disk (and not in its partitions), and select "Offline":

If you did it right, the disk should be displayed as Offline in Disk Management, as below:

diskmgmt_msc.PNG

Now, go to Control Panel > Administrative Tools > Hyper-V Manager (requires administrative privileges)

Create a new virtual machine, and go to its settings.

In the Hard Drive, instead of using a "Virtual hard disk", choose "Physical hard disk".

Select the disk in the drop down menu, as below:

HyperV.PNG

Now, use the Windows 10 installation ISO (for example) as the DVD disk in the virtual machine, and set the virtual machine to boot from CD.

Start the machine, and install Windows to the USB drive.

After the installation, shut down Windows in the virtual machine.

At this point, the USB disk is already bootable by any physical machine that supports USB boot.

Additional details:
-The reason it works is inside the virtual machine, the USB drive is not seen as a USB disk, since it's attached to an IDE controller;

-I'm not sure whether Windows 8 supports starting from a USB disk.Windows 8.1 Pro supports for sure.I don't know about the standard (non pro) editions;

-It might be possible to install Windows 10 directly to an USB Drive without all this, but at least Windows 8.1 Pro (and below) can't be installed to a USB drive.I just didn't test the direct installation yet for Windows 10.

-You don't need to bear with virtual machines if you don't want, as there's a alternate way to do it, that involves basically using ImageX utility to apply the install.wim (from installation media) image file to the disk, and make it bootable with bcdboot u:\Windows (where u: is the USB drive letter).Also, you may use other virtualization solutions (as VMware), but all this is beyond the scope of this tutorial.

If you have any questions, just ask them!

Best regards
 
Last edited:

alb3530

New member
Feb 26, 2014
55
0
0
Visit site
Why would I do this? What's the point.
If you just want to test out an OS in a safe way, why not just use a regular virtual machine?

Because in a virtual machine:

1 - You cannot test hardware devices.

You'll never know if you won't have problems with your NVidia GPU when running in a multi-display scenario, if your Realtek audio device will work as expected, or if your USB 3.0 ports will work as they should after you upgrade your machine to Windows 10.
Also, you cannot test applications that rely on these devices.
For example, you can't use a CUDA device in a application that supports it (i.e. Adobe After Effects)

2 - You cannot test a virtualization software, like VMware, VirtualBox and Hyper-V, for example;

If you have a configured virtual machine that you use to do some task, you won't be able to test it from an outer Windows 10 virtual machine.

For example, I have a development virtual machine with Windows 7 I use to compile Blender (free 3D creation suite) for the open source community.
That virtual machine runs in Hyper-V inside a Windows 8.1 host.
The environment is a bit complex, so I need to test that virtual machine in order to see if my environment won't be broken when upgrading the host to Windows 10.


3 - The software can see it's running from a virtual machine, and refuse to run.
An example: Free version of Ammyy Admin (Team Viewer-like app, used for remote access)


There may be more reasons, but basically you will have a more faithful test if you're testing the operating system in the same physical machine you plan to upgrade in a latter time.


No doubt the virtual machine approach is good to preview some operating system functionality and behaviors.
Even I have a virtual machine with Windows 10 on it.

But you have to be aware you'll be limited in some points, as stated previously.

Best regards
 

Exotic Hadron

New member
May 19, 2013
167
0
0
Visit site
The VHD_BOOT_HOST_VOLUME_NOT_ENOUGH_SPACE error code could also indicate that you are trying to natively boot from a NTFS-compressed VHD(X) disk. If initial size of the virtual disk is configured to be greater than 100 Gbytes, even though there could be enough space to fit a dozen of VHD disks of the physical partition, you would get this error if the VHD(X) disk was NTFS-compressed.
If you get this error when booting from Windows Boot Manager, and you are sure there's enough space on your disk, make sure to check that the folder where the VHD(X) disk sits, or the VHD(X) are NOT compressed.

The issue is the limitation of NTFS compression that does not allow compressing very large files, read here for details. Since bootmgr expands the VHD(X), file system detects the compressed file is large only at the time you boot while not returning any errors when you create the disk.
 

Members online

Forum statistics

Threads
323,289
Messages
2,243,576
Members
428,058
Latest member
ailanamargarett