Booting with a VHD Image
Booting with a VHD Image
. Configure a VHD
Cram Saver
1. When using a virtual system such as Hyper-V, the disk for a virtual system is stored in what file?
❍ A. VMC ❍ B. VHD ❍ C. VSV ❍ D. AVHD
2. What utility would you use to create a VHD file?
❍ A. bcdboot ❍ B. bcdedit ❍ C. imagex.exe ❍ D. Disk Management console.
Answers
1. B is correct. The virtual hard disk (.vhd) files store guest operating sys- tems, applications and data for the virtual machine. Answer A is incorrect because the virtual machine configuration (.vmc) file contains the virtual machine configuration information including all settings for the virtual machine. Answer C is incorrect because the saved-state (.vsv) file is used if a virtual server has been placed in a saved state. Answer D is incorrect because the .avhd file is a differencing disk used with Hyper-V.
2. D is correct. To create a VHD, you would use the Disk Management con- sole. Answer A is incorrect because bcdboot is a command-line tool for initializing the BCD store and copying boot environment files to the system partition. Answer B is incorrect because bcdedit is a command-line tool for managing Boot Configuration Data (BCD) stores. Answer C is incorrect because imageX.exe is a tool used to create and manage WIM files.
Over the last few years, virtualization has become popular. Virtual machine technology enables multiple operating systems to run concurrently on a single machine. This allows for a separation of services while keeping cost to a mini- mum. In addition, you can easily and quickly create Windows test environ- ments in a safe, self-contained environment. Of course, for a virtual machine to handle such a load, it must have sufficient processing and memory resources.
Booting with a VHD Image
Previously, Microsoft virtual server included Microsoft Virtual Server and Virtual PC. Starting with Windows Server 2008, Microsoft introduced Hyper-
V. Hyper-V is based on hypervisor, a virtual machine monitor that provides a virtualization platform that allows multiple operating systems to run on a host computer at the same time. To keep each virtual server secure and reliable, each virtual server is placed in its own partition. A partition is a logical unit of isolation, in which operating systems execute.
Each virtual machine uses the following files: .
A virtual machine configuration (.vmc) file in XML format that contains the virtual machine configuration information, including all settings for the virtual machine.
. One or more virtual hard disk (.vhd) files to store the guest operating sys- tem, applications, and data for the virtual machine. So, if you create a 12 GB partition for the virtual machine’s hard drive, the virtual hard disk file is 12 GB.
In Windows 7, a VHD can be used to store an operating system to run on a computer without a parent operating system, virtual machine, or hypervisor. This feature, called VHD boot, is a new feature in Windows 7 that eases the transition between virtual and physical environments. It is best used in the fol- lowing scenarios:
. In an organization that has hundreds of users working remotely through Virtual Desktop Infrastructure (VDI) via virtual computers but also needs the same desktop images as the users working onsite using physi- cal computers.
. In an organization with users in a highly managed environment that use technologies such as Folder Redirection and Roaming User Profiles so that the user state is not stored in the image.
. As dual boot, when you only have a single disk volume as an alternative to running virtual machines.
Windows 7 also enables IT professionals to use the same processes and tools to manage WIM and VHD image files.
The following steps outline Windows 7 deployment on VHD:
1. Create the VHD: You can create a VHD by using the DiskPart tool or the Disk Management MMC. The Disk Management MMC also
enables you to attach the VHD, so that it appears on the host computer
CHAPTER 2: Installing, Upgrading, and Migrating to Windows 7
as a drive and not as a static file. VHD files can then be partitioned and formatted before you install an operating system.
2. Prepare the VHD: Install Windows 7 on the VHD by using the imagex command with the /capture and /apply options.
3. Deploy the VHD: You can then copy the VHD file to one or more sys- tems, to be run in a virtual machine or for native boot. To configure
native-boot, add the native-boot VHD to the boot menu by using bcdedit or bcdboot tool. bcdedit is a command-line tool for man- aging Boot Configuration Data (BCD) stores and bcdboot is a com- mand-line tool for initializing the BCD store and copying boot environ- ment files to the system partition. You can also automate the network deployment of VHD by using WDS. You can use WDS to copy the VHD image to a local partition and to configure the local Boot Configuration Data (BCD) for native-boot from the VHD.
To create a VHD using the Disk Management console, perform the following instructions:
1. In the left pane, right-click Disk Management and then click on Create VHD. See Figure 2.5.
FIGURE 2.5 Using Disk Manager to create or attach a virtual hard disk.
Booting with a VHD Image
2. After choosing to create a VHD, select a location to save your VHD file.
3. Next, enter the maximum size you want the Virtual Hard Disk to be, and select the size type to be used. Choose MB, GB, or TB (see Figure 2.6).
FIGURE 2.6 Specifying the location and size of the virtual hard disk.
4. Select whether to let Windows decide the size by choosing Dynamic or use a set size by choosing Fixed and clicking OK.
5. The new disk displays in the right pane as unallocated space. Right-click the new unallocated VHD Disk # and click Initialize Disk.
6. Select the Disk # from Step 5 for the new VHD. You have to choose if you want the new VHD to have Master Boot Record (MBR) or GUID
Partition Table (GPT) partition and click OK.
7. Right-click the new unallocated VHD and click New Simple Volume.
8. Type the maximum disk space you want to use for this VHD partition and then click Next.
9. Select a FAT or a NTFS file system and enter a name for your VHD. Click the Perform a quick format checkbox and click Next.
10. When the summary appears, click the Finish button and the Disk Management console creates a new simple volume on your VHD, which
is already attached.
CHAPTER 2: Installing, Upgrading, and Migrating to Windows 7
You can also create a VHD using an open-source tool available on the MSDN Code Gallery called WIM2VHD, which converts the WIM image into a VHD you can use to boot off. You can find it at http://code.msdn.microsoft.com/ wim2vhd/.
To install a VHD boot machine:
1. Boot the system with a Windows 7 DVD or USB flash drive.
2. At the setup screen, instead of choosing Install Now, press Shift+F10 to get into command-line mode.
3. Enter diskpart to start the partitioning utility.
4. Create a new VHD file by entering the following command:
create vdisk file=”d:\path_to-vhd.vhd” type=expandable maximum=maxsizeInMegabyte
5. To select the new VHD and attach it as a physical disk, enter the follow- ing command:
select vdisk file=”D:\pathToVhd.vhd”
6. Use Alt+Tab to switch back to the setup screen and start the setup to the attached VDisk.
7. Now proceed with the normal setup.
8. After the installation, Windows 7 displays in the boot menu. If you want to add a VHD manually to the boot menu, use this command sequence:
bcdedit /copy {originalguid} /d “New Windows 7 Installation” bcdedit /set {newguid} device vhd=[D:]\Image.vhd bcdedit /set {newguid} osdevice vhd=[D:]\Image.vhd bcdedit /set {newguid} detecthal on
9. Open the Computer Management console and open Disk Management.
10. Right-click Disk Management and then click Attach VHD.
Booting with a VHD Image
Cram Quiz
1. You have a Virtual Hard Disk with Windows 7. How do you add the VHD to the Windows 7 boot menu?
❍ A. Use diskpart.exe to select vdisk ❍ B. Attach to your machine using Disk Management ❍ C. Use the bcdedit.exe command and modify the Windows Boot
Manager settings ❍ D. Use the bootcfg.exe command to modify the Windows Boot
Manager settings 2. What utilities do you use to create a VHD file? (Choose all that apply.)
❍ A. diskpart ❍ B. Disk Management ❍ C. bcdedit ❍ D. bcdboot
Cram Quiz Answers
1. C is correct. For Windows Vista and 7, the boot menu is configured using the bcdedit command, which edits a hidden file called c:\boot\bcd. To add a VHD manually to the boot menu, you also use bcdedit.exe . Answer A is incorrect because diskpart is a PE tool that is used to configure the hard drive on a PC. Answer B is incorrect because adding a machine using Disk Management does not add Windows 7 running on a VHD to the boot menu. Answer D is incorrect because bootcfg.exe is used to modify the boot.ini on Windows Server 2003 machines.
2. A and B are correct. diskpart and Disk Management are used to create a VHD file (virtual hard drive). Answer C is incorrect because BCDedit is used to configured using the bcdedit command, which edits a hidden file called c:\boot\bcd that displays the boot menu. To add a VHD manually to the boot menu, you would also use the bcdedit.exe utility. Answer D is incorrect because bcdboot is a command-line tool for initializing the BCD store and copying boot environment files to the system partition.
CHAPTER 2: Installing, Upgrading, and Migrating to Windows 7
Review Questions
1. You work as a desktop support technician at Acme.com. Because you need to connect to the domain, you need to install Windows 7 Enterprise Edition on a new computer for the graphics department. The new computer has the following specifications:
. 1.4 GHz Intel processor . 512 MB of RAM .
50 GB hard drive . Super VGA video card with 256 MB of video memory . Integrated sound card . Intel 10/100 network adapter
Which hardware does not meet the minimum requirements to install Windows 7?
❍ A. The processor ❍ B. The amount of RAM ❍ C. The hard drive ❍ D. The video card ❍ E. The network adapter
2. You work as the desktop support technician at Acme.com. You have a computer that has a 120 GB hard drive divided into two partitions. Each partition is 60 GB. Windows XP Professional has been installed on the first partition. The second partition has not been defined. You want to set up the computer to dual boot between Windows XP Professional and Windows 7 Professional. What do you need to do to set this up?
❍ A. Format the second partition with the NTFS file system. Boot from the Windows 7 DVD and install Windows 7 on the second partition. ❍ B. Format the first partition with the NTFS file system. Boot from the Windows 7 DVD and install Windows 7 on the first partition. ❍ C. Boot from the Windows 7 DVD and upgrade the Windows XP partition to Windows 7. ❍ D. Install Windows XP on the first partition. Boot from the Windows 7 DVD and install Windows 7 on the second partition.
3. You work as the desktop support technician at Acme.com. Within your corpora- tion, you have new computer with Windows 7 Professional. You need to install the same build and configuration of Windows 7 on 10 other computers. To accomplish this, you burn a bootable Windows PE CD that includes all the required deployment tools. What should you do next with the least amount of administrative effort?
Review Questions
❍ A. Boot the master with the Windows PE CD. Use ImageX on the master to create the image file. Boot each target with the Windows PE CD.
Use Diskpart to format the drive. Use ImageX to apply the image to the target.
❍ B. Use Sysprep to seal the master. Boot the master with the Windows PE CD. Use ImageX on the master to create the image file. Boot each
target with the Windows PE CD. Use ImageX to apply the image to the target.
❍ C. Boot the master with the Windows PE CD. Use ImageX on the master to create the image file. Boot each target with the Windows PE CD.
Use Diskpart to format the drive. Use ImageX to apply the image to the target. Use Sysprep to seal the master.
❍ D. Use Sysprep to seal the master. Boot the master with the Windows PE CD. Use ImageX on the master to create the image file. Boot each
target with the Windows PE CD. Use Diskpart to format the drive. Use ImageX to apply the image to the target.
4. You work as the desktop support technician at Acme.com. You have a new com- puter that has Windows XP on which you want to install Windows 7. You place the DVD into the drive and start the workstation. Unfortunately, it boots to Windows XP without starting the install program. You enter the BIOS program and determine that you are not allowed to boot from the DVD. What do you do next?
❍ A. Install new drivers for the DVD drive ❍ B. Retrieve updates from Microsoft ❍ C. Update the PC’s BIOS ❍ D. Boot from a Windows PE disk
5. Which versions of Windows can be upgraded to Windows 7 Home Premium Edition?
❍ A. Microsoft Windows Vista Business ❍ B. Microsoft Windows Vista Home Basic ❍ C. Microsoft Windows Vista Starter ❍ D. Microsoft Windows Vista Ultimate
6. You have several workstations. You want to produce a new Security ID (SID) for each workstation. What should you do?
❍ A. Using the Welcome screen, deactivate the license activation on all the Windows 7 workstations ❍ B. Use the System Properties and remove the computers from the domain
CHAPTER 2: Installing, Upgrading, and Migrating to Windows 7
❍ C. Use the sysinfo.exe /resetID command on all the Windows 7 workstations ❍ D. Use the sysprep.exe /oobe /generalize command on all the Windows workstations
7. You are going to migrate the server between two Windows 7 computers. You want to determine the amount of space needed to accomplish the migration. What should you do?
❍ A. Run the scanstate command with the /nocompress /p option on the source computer ❍ B. Run the scanstate command with the /nocompress /p option on the target computer ❍ C. Run the loadstate command with the /nocompress /p option on the source computer ❍ D. Run the loadstate command with the /nocompress /p option on the target command
8. You manually create an answer file for a Windows 7 unattended installation. What can you use to validate the answer file?
❍ A. Use the Setup Manager ❍ B. Use the Sysprep.exe utility ❍ C. Use the Windows System Image Manager tool ❍ D. Use image.exe
9. You want to create an image of a Windows 7 computer on multiple CDs. Therefore, you need to use the createspannedshares.cmd script. Where is the createspannedshared.cmd script found?
❍ A. The Package Manager ❍ B. DISM ❍ C. Windows AIK ❍ D. Windows SIM
10. You have a system with both Windows Vista and Windows 7. Which command would you use to configure the system to start Windows Vista by default?
❍ A. Use the bcdedit.exe command with the /default option ❍ B. Use the bcdedit.exe command with the /Vista option ❍ C. Modify the boot.ini file to boot Vista using a text editor ❍ D. Create the boot.ini in the C:\ folder and specify the /Vista
option
Review Question Answers
Review Question Answers
1. Answer B is correct. The system requirements specify a minimum of 1 GB of RAM. The other requirements are 15 GB hard drive space for the 32-bit edition,
20 GB hard drive space for the 64-bit edition, 1 GHz processor, and a video card with 128 MB of video memory. Therefore, Answers A, C, and D are incorrect. The system requirements do not specify a network card, so Answer E is not correct. Of course, you need a network card to communicate with a network.
2. Answer A is correct. To have a system dual boot between Windows XP and Windows 7, you have to install each operating system onto two different parti- tions. Because Windows XP is already on the first partition, you need to install Windows 7 on the other partition. You do not want to format the first partition because it erases everything on that partition. So, Answer B is incorrect. You don’t want to upgrade Windows because Windows XP will not be available.
Therefore, Answer C is incorrect. Answer D is incorrect because you don’t need to install Windows XP; it already exists.
3. Answer D is correct. To install the same configuration on 10 different computers, you have to use images. You already have the source system. Answer D then specifies the rest of the steps to install Windows 7 with images. After you have the source computer, the next step would be to sysprep the system. Therefore, Answers A and C are incorrect. Because you need to create a new partition before installing the image, Answer B is incorrect.
4. Answer C is correct. Because the system did not find the DVD disc, you need to fix that problem. The BIOS not allowing you to specify a DVD to boot from indi- cates that the BIOS is too old to support bootable DVD drives. Therefore, you need to update the system BIOS. Answers A and B are incorrect because drivers and updates do not help boot from the DVD because these load when Windows
7 loads, and to boot from a DVD does not require Windows 7 to load. Answer D is incorrect because you don’t need the Windows PE disk to load DVD drivers.
5. Answer B is correct. You can only upgrade from Windows Vista Home Basic and Windows Vista Home Premium to Windows 7 Home Premium. If you have Windows Vista Business, Windows Vista Starter, and Windows Vista Ultimate, you have to perform a custom install instead of an in-place upgrade. Therefore,
A, C, and D are incorrect. 6. Answer D is correct. The System Preparation Tool (Sysprep) removes the securi-
ty identifiers and all other user-specific or computer-specific information from the computer. Answers A and B are incorrect because the Welcome screen and the System Properties do not produce a new Security ID. Answer C is incorrect because sysinfo.exe does not have a /resetID option and cannot be used to reset the SID.
7. Answer A is correct. The scanstate command is used to scan the source computer, collect files and settings, and create a store. The /p option without any parameters gives you a storage space estimation if used with the /nocom- press option. Answer C is incorrect because the loadstate command migrates the files and settings from the store to the destination computer.
CHAPTER 2: Installing, Upgrading, and Migrating to Windows 7
Answers B and D are incorrect because you need to run the command on the source computer and not the target computer.
8. Answer C is correct. The Windows System Image Manager (Windows SIM) pro- vides a GUI interface to create and validate unattended Windows setup answer files. Answer A is incorrect because the Setup Manager is a Windows XP deployment tool. Answer B is incorrect because the System Preparation Tool removes the security identifiers and all other user-specific or computer-specific information from the computer. Answer D is incorrect because imagex.exe is used to create and manage a WIM file.
9. Answer C is correct. If you have older systems that do not have DVD drives but do have CD-ROM drives, you can use the createspannedshares.cdm script to create spanned media, which then breaks the DVD to multiple CDs. The creates- pannedshares.cdm is part of the Windows AIK. Answer A is incorrect because pkgmgr.exe (short for Package Manager) installs, uninstalls, configures, and updates features and packages for Windows. Answer B is incorrect because the Deployment Image Servicing and Management (DISM) is a command-line tool that is used to service and manage Windows images including install, uninstall, configure, and update Windows features, packages, drivers, and international settings. Answer D is incorrect because the Windows System Image Manager (Windows SIM) provides a GUI to create or check unattended Windows setup answer files.
10. Answer A is correct. bcdedit is a command-line tool for managing Boot Configuration Data (BCD) stores. The /default option defines which operating system is the default boot operating system. Answer B is incorrect because you would not use a /Vista option. Answers C and D are incorrect because the boot.ini files are used in Windows XP boot menus, not for Windows Vista or 7 boot menus.
CHAPTER 3