Friday, June 13, 2008

Creating a Second OS Entry in Window Vista With Boot Manager Identifiers

Let's start putting bcdedit through its paces butsafety first! When installed, Vista creates one OS entry called "Microsoft Windows Vista." If you think that you'd like to play around with changing boot options then I highly recommend it, if for no other reason than to take advantage of my suggestion about speeding up test machines with that DEP configuration notion that I've already mentioned. But instead of mucking with the one boot entry that you've got, I even more highly recommend that you first make a second OS entry and do your experiments on that entry. After all, it is possible to make your system unable to boot with a bad OS entry, and that is guaranteed to ruin your whole day. (Unless you like watching Vista install. I mean, it does have that lovely "undersea view of the bottom of a kelp forest" background while installing.)

How to create a second OS entry? That's one of bcdedit's abilities. The easiest way to create a second OS entry is to just copy the existing one with the bcdedit /copy {ID-of-entry-to-copy-from} /d description command. I will explain {ID-of-entry-to-copy-from} in just a couple of paragraphs but for now we can use {default}, which is the identifier for the default operating system entry. Using that information, I originally created my "Vista without DEP" OS entry like this:

bcdedit /copy {default} /d "Vista without DEP"

When I did that, I got a response of

The entry was successfully copied to {}

I'm going to explain that thing in the curly braces-it's called a globally unique identifier or GUID-next, but before I do, let me just summarize where we are at this point. If you try that command on a Vista system and reboot, you will get to see the Windows Boot Manager and your new "Vista without DEP" entry that, at the moment, doesn't do anything different than the "Microsoft Windows Vista" entry. But now you've got a safe OS boot entry to play with.

Understanding Vista Boot Manager Identifiers

What's with those {default} and {} things? Windows Boot Manager needs some way to be able to identify the multiple operating system entries. Now, it could give them names like "default Vista OS entry," but that would be, umokay, I don't know why they don't let you just give them arbitrary identifiers; it just seems to be something that's been in Windows since Windows 2000. The idea is, I suppose, that you might go crazy and accidentally create two OS entries with identifiers of "default Vista OS entry," and then your computer would implode. Anyway, when Vista creates a new OS entry, it also generates a random 128-bit number and uses that as the OS entry's "true name." Now, inside that OS entry is something called a "description" and you and I can fill it with text like "Vista without DEP" or the like, and you and I will use that to identify a particular OS entry, but Vista just sees that "Vista without DEP" name not as a real name, but instead as window dressing-{} is the true name for our new "Vista without DEP" OS entry as far as software's concerned.

That means that when you want bcdedit to do something to a particular OS entry, then you'll usually have to identify the entry that you want to configure. Usually that'll be the GUID of the OS entry. But you will sometimes be able to save a little work, as GUIDs aren't the only kind of OS entry identifier that bcdedit will take. It also recognizes the {default} and {current} identifiers. Note that they're surrounded by curly braces, as are the GUIDs. {default} is an identifier that tells bcdedit, "I want you to configure that OS entry that starts up by default, but I don't want to look up its GUID." {current} does the same thing, but it identifies the OS entry that the system is currently booted into. Thus, if you're working on a Vista system that booted into the default operating system entry, then both {default} and {current} point to that OS entry.

So, back a page or two, when I offered the command bcdedit /copy {default} , I was telling bcdedit to copy whichever operating system entry was the one I'd get by default. When bcdedit spat back the big number in the curly braces, it was telling me that GUID of the OS entry that it had just created for me.

If you ever need to see the GUIDs of your computer's default OS entry, just type bcdedit /v and you'll get the same long listing as you saw a few pages back when I typed just "bcdedit," except that instead of seeing {current} on the Identifier line, you'll get the GUID of that entry. Both a GUID surrounded by curly braces or the predefined {current} or {default} items are called "identifiers" by bcdedit.

*.* Source of Information : Administering Windows Vista Security: The Big Surprises

No comments: