You are on page 1of 11

Χρησιμοποιούμε cookies για να βελτιώσουμε την εμπειρία σας στις ιστοσελίδες μας και για τη διαφήμιση.

Δήλωση προστασίας προσωπικών δεδομένων


Αποδοχή όλων Διαχείριση cookies

DevBlogs
Σύνδεση
Σέζαρ ντε λα Τόρε
Ιστολόγια προϊόντων

DevOps

Εκκίνηση των Windows 10 εγγενώς από ένα


Γλώσσες

.NET 
αρχείο . Αρχείο μονάδας δίσκου VHDX

Ανάπτυξη Πλατφόρμας

Ανάπτυξη δεδομένων
Cesar
21 Ιανουαρίου, 2017

  

Αυτή η θέση είναι μια ενημερωμένη έκδοση (χρησιμοποιώντας τα Windows 10 και μια
νεότερη έκδοση του Convert-WindowsImage.ps1) μιας παρόμοιας θέσης που είχα στο
blog μου σχετικά με την εκκίνηση εγγενώς από ένα . Αρχείο VHDX:

https://devblogs.microsoft.com/cesardelatorre/booting-windows-8-1-update-natively-
from-a-vhdx-image/

Είμαι, επίσης, τη δημοσίευση αυτή για τα δικά μου αρχεία και τους λαούς με ρωτάνε
γι 'αυτό, καθώς δεν είναι μια σούπερ ευθεία προς τα εμπρός διαδικασία ..

Αυτή η διαδικασία είναι πολύ χρήσιμη όταν πρέπει να εκκινήσετε τα Windows


εγγενώς, αλλά θα πρέπει να έχετε πολλά διαφορετικά περιβάλλοντα, όπως όταν
χρησιμοποιείτε BETA / RC εκδόσεις του Visual Studio, εργαλεία dev ή απλά dual /
πολλαπλές μπότες με διαφορετική διαμόρφωση και το λογισμικό εγκατεστημένο,
αλλά δεν θέλετε να έχετε οποιοδήποτε συμβιβασμό στην απόδοση UI, όπως όταν
χρησιμοποιείτε Hyper-V ή οποιοδήποτε άλλο περιβάλλον εικονικής μηχανής.

Κάνοντας αυτό δεν χρειάζεται να εγκαταλείψουν την απόδοση, αυτό είναι το


πραγματικό πράγμα! μπορείτε να εκκινήσετε εγγενώς. Αυτό δεν είναι μια vm (εικονική
μηχανή) εκκίνηση από Hyper-V.

Αυτή είναι η εγγενής εκκίνηση, αλλά αντί να κάνετε εκκίνηση από αρχεία σε ένα
διαμέρισμα, κάνετε εκκίνηση από αρχεία που τοποθετούνται σε ένα αρχείο . VHDX.
Αλλά μπορείτε εκκίνησης εγγενώς!

Γιατί να θέλετε να κάνετε εκκίνηση εγγενώς; Εδώ είναι μερικοί λόγοι:

- Πρέπει να χρησιμοποιήσετε το Android εξομοιωτές πάνω από κάθε hypervisor όπως


Hyper-V (Ένθετα virtualization δεν έχει μεγάλη απόδοση ..).

– Αν θέλετε να αναπτύξετε εφαρμογές για κινητές συσκευές από το Visual Studio


(εφαρμογές Xamarin σε συσκευές Android ή Windows, για παράδειγμα), θα πρέπει να
συνδέσετε αυτές τις κινητές συσκευές σε οποιαδήποτε θύρα USB. Ωστόσο, τα VM
Hyper-V δεν υποστηρίζουν συνδέσεις USB σε συσκευές.

- Θέλετε να πάρετε καλή ui / Graphics εμπειρία, όσο ο υπολογιστής σας μπορεί να


προσφέρει με την κάρτα γραφικών σας δεν περιορίζεται από οποιοδήποτε
hypervisor, όπως Hyper-V

- Σε κάθε περίπτωση, όπου θέλετε να πάρετε καλή απόδοση από το μηχάνημά σας,
διότι αυτό που παίρνετε από ένα Hyper-V VM δεν είναι αρκετό και την ίδια στιγμή
που θέλετε να χειριστείτε πολλαπλά περιβάλλοντα μέσα στο ίδιο μηχάνημα (αν και
θα ήθελα να είναι σε θέση να εκκινήσετε μόνο ένα από αυτά, φυσικά).

Εδώ είναι μερικές πρόσθετες πληροφορίες εάν θέλετε να μάθετε περισσότερα για
«τους εικονικούς σκληρούς δίσκους (. VHD/. VHDX) με εγγενή εκκίνηση":
http://technet.microsoft.com/en-us/library/hh824872.aspx

Στο παρελθόν, θα χρησιμοποιηθεί για να ακολουθήσει πιο σύνθετα βήματα για να


δημιουργήσετε ένα Windows 8 ή Windows 7 . VHD κύρια εικόνα, στη συνέχεια, την
εκκίνηση εγγενώς το μηχάνημά μου με τη ρύθμιση των επιλογών εκκίνησης με
bcdedit. Εδώ είναι παλιά θέση μου:
h bl d b d l hi 2012 0 31 i i d 8
http://blogs.msdn.com/b/cesardelatorre/archive/2012/05/31/creating-a-windows-8-
release-preview-master-vhd.aspx?wa=wsignin1.0

Αυτός είναι ο τρόπος που το κάνω αυτή τη στιγμή. Χρησιμοποιώ. VHDX μορφή, αλλά
θα μπορούσατε επίσης να καθορίσετε ένα . VHD (παλαιότερα) αν θέλετε.

Εδώ είναι τα βήματα. Αρκετά απλό, στην πραγματικότητα!

1. Θα πρέπει να έχετε οποιαδήποτε Παράθυρα . Εικόνα ISO, όπως ένα "Windows 10


x64 – DVD (Αγγλικά)" από συνδρομή MSDN ή οποιαδήποτε άλλη έκδοση
(οποιαδήποτε έκδοση των Windows 10 και x64 ή x86).

2. Κατεβάστε το Convert-WindowsImage.ps1 από τη Συλλογή TechNet της Microsoft (


https://gallery.technet.microsoft.com/scriptcenter/Convert-WindowsImageps1-0fe23a8f
) και αντιγράψτε το σε έναν προσωρινό κατάλογο. Μπορείτε επίσης να το
κατεβάσετε από αυτό το . ZIP κατεβάσετε στο Blog μου, όπου έχω ήδη γράψει τη
γραμμή εκτέλεσης λειτουργία

[Ένας άλλος τρόπος για να δημιουργήσετε το . VHDX, που δεν έχω δοκιμαστεί, αντί
να χρησιμοποιούν ότι η δέσμη ενεργειών PowerShell είναι χρησιμοποιώντας το
εργαλείο DISM (Ανάπτυξη Υποστήριξη και διαχείριση ειδώλων) από το Windows ADK)
]

3. Ξεκινήστε την κονσόλα PowerShell σε λειτουργία διαχειριστή

4. Πριν εκτελέσετε τη δέσμη ενεργειών PowerShell, θα πρέπει να επιτρέψετε εκτελέσεις


δεσμών ενεργειών στις πολιτικές του υπολογιστή ή του χρήστη σας. Εάν θέλετε να
επιτρέψετε αυτό σε ένα εύρος τοπικού υπολογιστή, εκτελέστε την ακόλουθη εντολή
στην κονσόλα PowerShell. ΣΗΜΑΝΤΙΚΟ, εκτελέστε το PowerShell με δικαιώματα
διαχειριστή (λειτουργία "Εκτέλεση ως διαχειριστής"):

Πολιτική set-exec εκτελεστής χωρίς περιορισμούς -Τοπική προστασία εμβέλειας

Εάν δεν εκτελέσετε αυτήν την εντολή ή δεν έχετε αυτήν την πολιτική στη θέση της,
θα λάβετε ένα σφάλμα όπως το ακόλουθο όταν προσπαθείτε να εκτελέσετε
οποιαδήποτε δέσμη ενεργειών του PowerShell:

Για περισσότερες πληροφορίες σχετικά με αυτές τις πολιτικές, διαβάστε τα εξής:


http://technet.microsoft.com/library/hh847748.aspx

5. Επεξεργαστείτε το αρχείο Convert-WindowsImage.ps1 με windows Powershel IE (ή


με οποιοδήποτε πρόγραμμα επεξεργασίας, ακόμη και το NOTEPAD μπορεί να
λειτουργήσει για αυτό).

Εάν χρησιμοποιείτε το Windows Powershel IE, καλύτερα να το εκτελέσετε με


δικαιώματα διαχειριστή (λειτουργία "Εκτέλεση ως διαχειριστής"), ώστε να μπορείτε
να εκτελέσετε απευθείας τη δέσμη ενεργειών με το F5 στη συνέχεια.

Στη συνέχεια, προσθέστε την ακόλουθη γραμμή στο τέλος της δέσμης ενεργειών (ή
ενημερώστε την με το . ISO όνομα εικόνας και τις ρυθμίσεις, αν έχεις ενημερωμένο
αρχείο μου:

Μετατροπή-WindowsImage -SourcePath .\en_windows_10_enterprise_x64_dvd.iso -


VHDFormat VHDX -SizeBytes 150GB -VHDPath
.\Windows10_Enterprise_x64_Bootable.vhdx
6. Τώρα, εκτελέστε τη δέσμη ενεργειών είτε από το Windows PowerShell ISE (με F5)
είτε εκτελώντας την από μια απλή γραμμή εντολών powershell (και στις δύο
περιπτώσεις με δικαιώματα διαχειριστή)

Θα εκτελεστεί όπως το παρακάτω στιγμιότυπο οθόνης. Να είστε υπομονετικοί, θα


πάρει λίγο χρόνο, δεδομένου ότι πρέπει να αντιγράψετε όλα τα αρχεία από τα
Windows . Εικόνα ISO στη λογική μονάδα δίσκου με βάση το . VHDX που έχει
δημιουργηθεί.

Από τότε που. VHDX είναι δυναμική και εξακολουθεί να μην είναι τοποθετημένα, το
μέγεθός του ήταν απλά κάτι λιγότερο από 8GB!

7. ΜΟΝΤΑΣΕ το . VHDX ως μονάδα δίσκου στον υπολογιστή σας

Κάντε δεξί κλικ στο VHDX και μοντάρετε το. Στην περίπτωσή μου πήρα το F: ως
τοποθετημένο δίσκο μου.

8. Ορίστε τα αρχεία BOOT μέσα στο . Vhdx

Τα ακόλουθα βήματα απαιτούνται για την εκκίνηση του υπολογιστή σας από το
αρχείο VHDX: a.Ανοίξτε μια γραμμή εντολών διαχείρισης μέσω της γραμμής εντολών
WIN+X (Admin) b.Type bcdboot F:\Windows, προκειμένου να δημιουργήσετε τα
αρχεία εκκίνησης στο Μονάδα δίσκου VHDX
αρχεία εκκίνησης στο . Μονάδα δίσκου VHDX.

9. ΑΠΟΘΗΚΕΎΣΤΕ / ΑΝΤΙΓΡΆΨΕΤΕ "MASTER ΣΑς . ΑΡΧΕΊΟ ΕΙΚΌΝΑς VHDX"!!!

Σε αυτό το σημείο έχετε ένα "MASTER ΕΙΚΟΝΑ . VHDX" που θα μπορούσατε να


χρησιμοποιήσετε σε διαφορετικές μηχανές / υλικό, δεδομένου ότι ακόμα δεν το
γύρισμα επάνω, ως εκ τούτου, εξακολουθεί να μην έχει κανένα συγκεκριμένο
πρόγραμμα οδήγησης που σχετίζονται με οποιοδήποτε υλικό. Αντιγράψτε το
Windows10_Enterprise_x64_Bootable.vhdx κάπου αλλού έτσι θα είστε σε θέση να το
επαναχρησιμοποιήσετε σε πολλές μηχανές ή στο ίδιο μηχάνημα, αλλά για mutiple
περιβάλλοντα

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:

bcdedit /set {bd67a0a8-a586-11e6-bf4e-bc8385086e7d} description “Windows 10


Enterprise – VHDX boot”

(Of course, you should have and use a different GUID..)

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:

bcdedit /set hypervisorlaunchtype auto

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

///////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////

CONFIGURING OTHER MACHINES OR MULTIPLE BOOT LOADERS FROM .VHDXs

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.

1. Check initial boot loaders

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.

2 What we want to do is to create a second BOOT LOADER by copying the current


Windows Boot Loader. Type:

bcdedit /copy {current} /d “Windows 10 .VHDX Boot”

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:

bcdedit /set {My_new_GUID_Number} device vhd=


[C:]\VHDs\Windows10_Enterprise_x64_Bootable.vhdx

bcdedit /set {My_new_GUID_Number} osdevice vhd=


[C:]\VHDs\Windows10_Enterprise_x64_Bootable.vhdx 

Note the difference in “device” and “osdevice”..


Now, you are done with the “hard” configuration.

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!
 

Other BCDEDIT configurations:

You can update your boot loaders with commands like the following using the GUID of
the BOOT LOADER you want to change:

TO CHANGE THE DESCRIPTION

bcdedit /set {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} description “Windows 7 .VHD


Image”

COPY

bcdedit /copy {Original_GUID_Number} /d “my new description” or bcdedit /copy


{current} /d “my new description” or bcdedit /copy {default} /d “my new description”

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

.NET Architecture Guides


ML.NET Samples

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

What's new Microsoft Store Education Enterprise Developer Company


Surface Duo Account profile Microsoft in education Azure Microsoft Visual Studio Careers

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

You might also like