Showing posts with label VHD. Show all posts
Showing posts with label VHD. Show all posts

Tuesday, February 7, 2012

Native Boot VHD on USB

With my primary drive encrypted (thanks BitLocker) and my desire to be able to native boot a VHD, I went in search of a solution.

After much searching, I found a blog post: Native VHD Boot from an External USB.  I’ve decided to follow the directions and see if it works.

Below documents my deviations and distinctions to the process.

1)  Creating the VHD – I already had a baseline Windows 7 VHD.  So I made a copy to screw up.
2)  I did not change the locale information.  My VHD was already properly configured for all that stuff.
3)  Instead of using the INIFILE tool, I used my administrator command console to navigate to the folder, then executed “notepad <filename.ext>” in order to open it with administrative privileges.  This allows for the ability to save back.
      a)  For usbstor.inf and brfmcsto.inf, I went ahead and added the “; SERVICE_BOOT_START” to the end of the StartType value, and created a completed new entry at the end of the immediate list for LoadOrderGroup.
4)  So I did need PsExec (from PsTools), and executed from my administrator command console: “PsExec -i -d -s C:\Windows\System32\cmd.exe”
      a)  In the new command console, I ran the command “whoami” in order to see “nt authority/system
5)  Under the folder “R:\Windows\System32\DriverStore\FileRepository\” I had at least two of each folder with their own GUIDs.  So I deleted the PNF file in each.
6)  Under the folder “R:\Windows\winsxs\”, I had no PNF files to delete.
7)  I skipped creation of the differencing VHD cause I have base lines already, and really want the separation between them.

Now the process above continues to fail, because BitLocker has to go to the hard drive to get its security information, then unlock the bios, and then run the bootloader.  This is what consistently fails, and causes me the headaches of fixing my mistakes.

So I wondered, what if I partitioned my USB hard drive, and BitLocker’d the bootable partition?

Could I get a VHD on the encrypted partition to Native Boot?

Could the encrypted partition be used for boot loading, and Native Boot a VHD on the non-encrypted partition?

Apparently not.  Will update this posting if I can every get past this scenario.

Wednesday, February 1, 2012

Windows 7 Ultimate - Virtual Hard Disk

Recently, I decided I needed to be smarter about building a more versatile virtual machine.  So I decided to go the route of creating a virtual hard disk (VHD).

With my main OS being Windows 7, I knew I had the ability to boot directly into a VHD.  Why?  Because this will allow the virtual to utilize my full system resources.

But what if I want to boot into my main OS?  Good news!  VHDs can be loaded by Virtual Box.  Meaning I can boot into my primary OS, and then use Virtual Box to launch a virtual machine (VM) into the VHD.

And there is even a third benefit.  Microsoft’s Hyper-V technology can take bootable VHDs and spawn VMs off.  Not only can I leverage the VHD locally (for those on-the-go and limited/weak network connectivity times), but teams could use it out of the cloud!

The first VHD I will create is an expandable Windows 7 (x64) Ultimate, 100GB baseline.  I will spell out my steps to creating it, making it accessible through Virtual Box, and finally direct booting into it.


The first part is to create a VHD.  I started by leveraging someone else’s blog: http://blog.tallan.com/2011/09/06/creating-a-bootable-vhd-that-can-also-be-run-from-a-virtual-machine/

The one deviation I made was creating an expandable VHD over a fixed one.  (Note: This is a baseline, I’m more worried about saving space over stealing a large chunk permanently away).  It was just a matter of adding the additional command line parameter type=expandable.


If you prefer other alternatives, Microsoft does have good resources for creating initial VHD files:  http://technet.microsoft.com/en-us/library/gg318052.aspx.

The blog goes on to talk about creating Server 2008, I’ll replicate many of the screen shots here for Windows 7 Ultimate.

* VM Name and OS Type

* Memory – The default is 512MB.  But with 8GB available, I decided to start with a “healthy” amount.

* Virtual Hard Disk

*** Virtual Machine Successfully Created ***

Now time to install the OS.

* Go into the settings of the new drive

* Choose Storage, and then select the CD drive.

* Find where you can setup the drive.  (Mine happens to be the disk image on the far right)

* Since I typically download ISOs, I have the ability to attach a virtual.  You can use your physical (Host) drive and insert a real disk.

*** Success!  We are now ready to install our OS ***

Since a billion people on the web have already documented how to install Windows 7, I’m just going to give you one link that you can follow: http://www.pcmag.com/article2/0,2817,2354687,00.asp

NOTE: I did run across the following error.
Failed to open a session for the virtual machine Windows 7 (x64) Ultimate.
VT-x features locked or unavailable in MSR. (VERR_VMX_MSR_LOCKED_OR_DISABLED).
Result Code:
E_FAIL (0x80004005)
Component:
Console
Interface:
IConsole {1968b7d3-e3bf-4ceb-99e0-cb7c913317bb}

And to solve, I went out and found the following help:


Now that I have this baseline VHD.  I think I’ll check out the SharePoint 2010 Easy Setup Script.  (See Chris Johnson’s blog entry for more details.)

I also liked reading the rest of the blog about using BCDEDIT to launch my machine directly into the VHD.