Professional Documents
Culture Documents
παρουσία των Windows (ενδεχομένως μια διαφορετική έκδοση) και στη Windows 10
συνέχεια να πείτε το πρόγραμμα φόρτωσης εκκίνησης για εκκίνηση από το
αρχείο VHD(X) αντί για την κανονική μονάδα δίσκου C: .
Για αυτό το έργο, ήθελα να πάω ένα βήμα παραπέρα από την εκκίνηση από
έναν εικονικό δίσκο. Ήθελα να εκκινήσετε από μια αλυσίδα VHD(X) - το ίδιο με
ένα στιγμιότυπο εικονικής μηχανής στην πλατφόρμα εικονικής διαμόρφωσης
της επιλογής σας. Με αυτό, μπορώ να έχω ένα μόνο για ανάγνωση γονέα
VHD(X) που μπορώ να χρησιμοποιήσω για πολλές παρουσίες και ανάγνωση-
εγγραφή differencing δίσκους ή θυγατρικό VHD(X)es που θα περιέχουν τις
διαφορές από το γονικό δίσκο. Έτσι, στο τέλος, θα έχω ένα γονέα VHD(X) που
περιέχει τα Windows 10, και ένα differencing δίσκο που περιέχει τα εργαλεία
ειδικά για αυτό το έργο, και ο συνδυασμός των δύο VHD(X) αρχεία θα
αποτελούν το C: μονάδα δίσκου για την εκτέλεση των Windows παράδειγμα.
Αυτό είναι το τμήμα που τεκμηριώνεται πιο αραιά στο web και η τεκμηρίωση
που είναι διαθέσιμη είναι συνήθως εκτός αυτού του περιβάλλοντος.
Βήμα 1
Το πρώτο πράγμα που πρέπει να κάνουμε είναι το ισοδύναμο μιας
εγκατάστασης των Windows σε ένα αρχείο VHDX. Για αυτό, ρίξτε μια ματιά στο
Convert-WindowsImage.ps1 από Pronichkin, που βρίσκεται στη συλλογή
Microsoft TechNet. Αυτή η δέσμη ενεργειών λαμβάνει τα Windows για να
εγκαταστήσετε τα μέσα αποθήκευσης ως είσοδο και εξάγει ένα αρχείο VHDX
που περιέχει το ισοδύναμο του τι το πρόγραμμα εγκατάστασης θα είχε κάνει.
Μόλις ολοκληρωθεί θα έχετε ένα αρχείο VHDX που είναι έτοιμο για την πρώτη
εκκίνηση.
γραμμή 4207:
γραμμή 4216:
γραμμή 4220:
γραμμή 4229:
Step 2
The VHDX le now contains Windows in a state that’s similar to when the Windows
installer is about to reboot into the newly installed OS. So we’re at the pre- rst-
boot stage. In this state, the newly installed Windows has not yet discovered
hardware or installed speci c drivers. If your plan is to be able to use this VHDX on
multiple, heterogeneous platforms, now’s the time to copy it to an archive location
where you can pull it from later.
Step 3
Let’s now move the VHDX le that you’ll use to boot your machine to a more
dedicated place. In my case, I created a folder at C:\VHDs and use that as the home
for the master VHDX as well as any children I create.
Step 4
Almost time for rst boot. At this point, I’m believing that you’ve created a backup
copy of the VHDX le somewhere else so that you can use the same master for
multiple physical machines. Now it’s time to boot the local VHDX and make it
machine speci c. To do this we need to modify the boot con guration of the
physical machine; speci cally, we need to modify the BCD which stands for Boot
Con guration Data. For this process, I use EasyBCD and the following process will
document it. If you’d prefer to drop to the CLI and modify the BCD manually, you
can nd some good info on a similar process here.
After installing EasyBCD, launch it. If you’re on a newer machine, the rst thing
you’re greeted with is the following:
There are two modes that a machine can use to boot, Legacy BIOS and UEFI. New
machines use UEFI and when in use that message will pop up. It doesn’t affect
what we’re doing here, so we can click OK. If you’re curious, the Help button will
give you all the details on the differences between the two modes with respect to
con guring the BCD. After clicking OK you’re presented with the main window:
You’ll note that there’s a single entry in the BCD. Anytime I’m dealing with the
booting process for a machine I want to be careful and create backups along the
way. So the rst thing we’ll do is to backup the current BCD. Click the BCD
Backup/Repair button which presents this:
Enter a le path into the rst File eld under Backup and Restore Bootloader
Settings and click Backup Settings. In the future, if you want to restore back to
defaults, use the second File eld and the Restore Backup button. One thing to
note, AFTER CLICKING A BUTTON IN EasyBCD, WAIT FOR THE RESULT MESSAGE IN
THE STATUS BAR OF THE WINDOW BEFORE MOVING ON!
Now we need to create the new entry for our parent VHDX le. Click the Add New
Entry button:
EasyBCD can be used to con gure boot for a lot of possibilities. We’re just going to
use the bottom pane, speci cally the Disk Image tab. Enter whatever name you
want to be in the BCD, nd the VHDX le you created and moved to its permanent
home (C:\VHDs maybe?) and click Add Entry. After seeing the success message in
the status bar, click on View Settings:
We now have two entries in our BCD. But wait! Our second entry is named correctly
but it looks like it’s going to boot the same Windows instance as entry one.
EasyBCD doesn’t show enough info here to be clear when it comes to booting from
virtual disks. If you click on the Detailed (Debug Mode) radio button under Display
Mode we’ll get a better view:
This view gives us the full path to our VHDX le, so it really IS different than entry
one.
Step 5
Now’s the moment of truth! Time to boot into our new OS. During the reboot
process you’ll see a new screen similar to the following before anything actually
boots:
Click the entry for your VHDX. This will start the rst boot process with the new
Windows instance in the VHDX. Please note that THE FIRST BOOT PROCESS
REQUIRES A REBOOT, AT WHICH POINT YOU NEED TO CLICK THE SAME ENTRY
AGAIN so you don’t boot into your main Windows install. If you missed it, just
reboot again and select your VHDX entry. Windows will take you through the
normal post-install steps.
Once you’re up and running and at the desktop you’ll want to do a few things. At
this point, you want to make any changes to the install that you want to persist
with the parent OS. This could/should include some or all of the following:
Basically, you want to make all permanent changes at this point. Changing things
in this VHDX le later is problematic, so try to be thorough. Once complete, reboot
back into your main, native Windows install.
Step 6
Now we’re going to create our VHDX chain. To do this we need to be at AN
ADMINISTRATIVE COMMAND PROMPT. I’m going to use PowerShell. Once open,
run disk part. Now here’s the trick. Using the following command we’ll be creating
a child VHDX le that’s linked to the VHDX parent we just created:
As a safeguard, let’s make our parent VHDX read-only. In Windows Explorer get the
properties of your parent VHDX and check the Read-Only box and click OK.
Step 7
Now that we’ve got our chain created, we need to go tweak the BCD again. Go back
into EasyBCD and this time we’re going to remove the parent VHDX entry and add
an entry for our child VHDX.
This time when we look, the Overview mode properly shows the path to our Parent
VHDX – odd! Moving along… Click the Edit Boot Menu button, highlight your
Windows 10 Parent entry and click the Delete button:
Now click the Add New Entry button, enter whatever name you want to be in the
BCD, nd the child VHDX le you created (C:\VHDs maybe?) and click Add Entry.
Now we’ll go back to the Detailed view mode of View Settings and validate that
our child is in the BCD:
Step 8
And we’re golden! Now you can restart into your new child VHDX le.
Anything you install from this point will be stored in your child VHDX. If you want
to roll back to default, delete the child VHDX and create a new one. To avoid
repeatedly going into diskpart, I’ve created an empty child that I just copy
whenever I want a new environment.
Something to note that bit me. By default, when Windows boots a VHD(X) le
natively, it tries to “expand” or allocate the entire size of the virtual disk on the
physical disk. You’ll clearly notice it if you try to boot the VHDX and it blue screens
saying there’s not enough disk space. In the Convert-WindowsImage script, there’s
an ExpandOnNativeBoot parameter that I’ve used in the commands above so that
you can run, essentially in thin provisioned mode. If that wasn’t set, or Microsoft
changes code and things stop working after an update, that’s a good rst place to
start looking.
One more thing to note is the use of the BCDinVHD parameter that removes the
BCD element from the VHDX. This will cause problems if you were to try to use this
image with Hyper-V.
TOP COMMENTS
texas.ex
Hello:
I attempted to complete this process, changed the Function Convert-WindowsImage as
directed, but there was still an error. I think perhaps Windows 10 Version 1909 must have
“broken” the function again. Has anyone been successful in performing this process with this
version of Windows 10? If so, were additional changes made?
Thanks in advance for any help you can provide.
Louis M. Ayers
Texas.Ex@btinternet.com
Participants:
HEADQUARTERS LOCATIONS
CONTACT
CBTinfo@cbtechinc.com
888-241-7585
CBT Events
INNOVATIONS
Industry Trends
Asset Integrity Management
Careers with CBT
Condition Monitoring & Predictive Maintenance
Quality Requirements & Certi cations
Connected Worker
Connected Worker Glossary
Video as a Sensor
PARTNERS
Key Partners
CONTRACTS
Contracts