Windows 7

Virtual Environment

The uptake and usage of virtualization varies depending on the industry and application, but there can be no doubt that even as portable computers and smartphones become more powerful-now equipped with quad-core processors as standard- virtualizing operating systems and software is something of which we'll see much more.

In Windows 7 Professional, Enterprise, and Ultimate, there was a free bolt-on that you could download called XP Mode, which contained a virtualized image of a fully licensed edition of Windows XP Pro on which you could install your older software to maintain compatibility. Windows 8 does not support XP Mode, primarily because of all support for XP is scheduled to end in April 2014.

Instead, the 64-bit versions of Windows 8 Pro and Enterprise, Microsoft includes Microsoft's powerful Hyper-V virtualization software. This is a full-featured virtualization package that is capable of running any operating system; it is very powerful and flexible.

Hyper-V in Windows 8 does not support pinning of your XP or other virtualized software icons to the Windows 8 desktop taskbar, this was a happy side-effect of the way Microsoft's older Virtual PC technology worked, but it isn't supported in Hyper-V.

To access virtualized programs on the Windows 8 desktop, XP Mode, you will need a copy of Microsoft Enterprise Desktop Virtualization (MED-V), which is part of the Microsoft Desktop Optimization Pack (MDOP) suite. This is available to enterprise users through volume licensing and to other businesses through Windows Intune.

So what is virtualization? Virtualization is an operating system (OS) that runs on softwaresimulated hardware. This creates what is known as a virtual machine (VM). A virtualized OS typically shares the same hardware with another OS or even several of them. To do this, the host operating system shares the computer's resources between the different VMs. This includes isolating areas of memory for each VM or, in the case of a multi-core processor, sometimes even assigning a specific processor core to each VM. Each VM then has its own hardware resources and can operate at near the full speed of the computer.

Where does each VM reside? Each VM exists within a file on your hard disk-a bit like a compressed zip folder. The operating system sees this file as a hard disk and operates perfectly from within it.

Using VMs at home or at work affords you many advantages. For example, if your copy of Windows 8 fails, the downtime can be long and frustrating getting everything back up and functioning again. Even if you have a backup image of that copy of Windows, you'll be completely offline for a while until you restore it. If you are running Windows on a VM, however, you simply log on to the master operating system and replace the VM file with a clean backup copy. Essentially, all you do is copy or rename a single file, and you're still able to get things done on your computer while the VM is being restored.

OS licensing and VMs
You will need a separate and valid license for each operating system that you install into a VM. This means you will need a separate and valid product key for each copy of Windows you install into Hyper-V.

Another advantage of using VMs is that you only need a single computer or server to run different operating systems and tasks simultaneously. This can reduce an entire bank of servers to just a single computer. The effect this has on your electricity consumption and your carbon footprint can be enormous, not to mention the impact it has on your IT costs.

All of this is made possible because modern processors and computers are almost never used to their full potential by everyday computing and server tasks. Why have five computers using only 20 percent of their computing power (but consuming 80 percent of their maximum electricity consumption) when you can have one running full out?

Virtualization vs. Dual Booting

To dual-boot a computer, you need separate operating systems installed on different hard disks or partitions. This is how Boot Camp manages Windows and OS X on an Apple Mac. The disadvantages of dual booting are twofold: first, if the boot sector or boot menu of the computer changes, you might lose access to one of the operating systems, because Startup Repair might not rebuild entries correctly for non-Windows operating systems, and those operating systems might not be able to write to the Windows boot loader. The second disadvantage to dual-booting is that if you want to switch from one operating system to another, you have to close all of your programs, shut down the machine, and then restart it.

Virtualization allows you to run different operating systems side by side on your Windows desktop or full screen and makes it easy to switch between them. Furthermore, you still have only one operating system in your Windows boot loader (unless you choose to boot from a virtual hard disk; more on this later in the tutorial).

Also, VMs are very easy to back up. They are just files (think of a really large zip file) that can be copied from one place to another when the VM isn't running. This makes them considerably simpler to back up and restore than operating systems installed on a separate hard disk or partition.

Although you can dual-boot between Windows and other operating systems such as Linux, there are limitations on the order in which you can install these operating systems. This is because Microsoft changed the boot loader with Windows Vista to make it much more secure. Many other operating systems use a different, older style of boot loader. This means Windows 8 should always be the last operating system you install because, although it can incorporate the other operating boot loaders into itself, not all operating systems can incorporate the Windows 8 boot loader into themselves. Windows 8 wouldn't be able to start if a non-Windows 8 boot loader has overwritten the Windows 7 boot loader.

Virtualization circumvents this problem by running all of the operating systems from within Windows 8. You can install any other version of Windows or Linux by using Windows Virtual PC. Apple Mac OS X isn't supported, but you can get third-party virtualization packages such as VirtualBox and VMWare, which might support a wider range of operating systems.

Any Benefits to Virtualization?

Virtualization offers significant benefits, one of which is booting into a virtual copy of Windows 8 to keep your main copy clean, protected, and running smoothly.

Two other benefits of virtualization are software and hardware compatibility. For instance, perhaps you like to use an older printer or scanner that isn't supported with Windows 7 drivers. If there's nothing wrong with the hardware, you could use virtualization to install an earlier operating system with drivers that support the hardware, and install the hardware into that virtualized operating system, instead.

Similarly, you might require the use of software that won't run in Windows 8, maybe an older application that won't run even in Windows XP Mode. You can use virtualization to create safe test computers into which you can install and test new software, software updates, security updates, and hardware. This is becoming common practice for environments in which system administrators want to know what impact an update or new software package will have on the organization's computers.

Virtual Hard Disks and Windows 8

By showing you how to work with virtual hard disks (VHDs) in Windows 8. With Windows 8, support for VHD is built in to the operating system for the first time. A VHD is different than a VM but can be used like a VM. Let me explain. In its basic form, a VHD is simply a file you can "attach" to a copy of Windows 8 so that it appears in File Explorer as another hard disk. You can store any type of file or data on a VHD just as you can a regular hard disk.

Creating a VHD in Windows 8

To create a VHD in Windows 8, perform the following steps:

  1. Open the Administration menu (press Windows logo key+X), click Computer Management, and then click Disk Management.
  2. In the Disk Management console, open the Action menu, and then select Create VHD.
    You must select where on your hard disk(s) the VHD file is to reside, what it will be called, and how big it will be. You can choose whether the file is dynamically expanding or of a fixed size. The first option doesn't create the full size file but expands it as files are added to it until it reaches its maximum size. This can be useful if hard disk space is in short supply. The recommended option is to create the full-size file to begin with.
    The new VHD appears in the list of available disks in the Disk Management console. You need to initialize this disk.
  3. Right-click the disk's information panel (to the left of the black, disk size block) and then select Initialize Disk.
  4. Select a partition style for the disk (I recommend MBR) and click OK.
    You need to place a partition on the VHD so that you can write files to it.
  5. Right-click the VHD in the Disk Management console. In the options panel that opens, select New Simple Volume.
    You are asked to select a size for the volume. For a VHD, you should use the default (maximum) size available.
  6. You can either assign a drive letter for the VHD or have it mounted automatically as a subfolder onto another drive. You can also choose not to associate a drive letter with a disk or partition, although this will prevent it from appearing in File Explorer views.
  7. Assign the VHD a name (Volume Label) and format it by using either a quick or standard format. I recommend the NTFS file structure.
Note:
New Technology File System (NTFS) is a disk file system that Microsoft first introduced with Windows NT and has since refined. It is more stable and reliable than other formats, including File Allocation Table (FAT), and it supports larger drives than FAT or FAT32, as well. NTFS also supports-and, in fact, is required for-the folder and disk encryption technologies in Windows 8.

Reattaching the VHD

You will probably need to reattach the VHD you created in the previous section the next time you start Windows. This is normal behavior for Windows 8. If you want to automatically reattach a VHD whenever Windows 8 starts, you can set this up as a task in the Task Scheduler.

To attach a VHD, perform the following steps:

  1. Press Windows logo key+X and click Computer Management to access the Computer Management console.
  2. In the left pane of the Computer Management console, select Disk Management.
  3. On the Action menu, select Attach VHD.
  4. Select the VHD file from the location where it is stored on your computer. It appears as a drive in File Explorer.

Booting from a Virtual Copy of Windows 8

With the Enterprise and Ultimate editions of Windows 8, it's possible to install another copy of Windows 7 or Windows 8 inside a VHD and boot from it. You can find an official guide to creating a bootable VHD by going to www.microsoft.com and searching for Demonstration: Windows 8 VHD Boot, but this method is very complex. There is actually a much simpler way to do it.

Creating a bootable VHD is an excellent way to keep your main copy of Windows 8 clean and problem free. Quite simply, in this scenario, you'll never use it except for making backups of the VHD and restoring it if you need to. You can also take advantage of this to have a multi-boot environment on your computer that's easier to manage than a traditional dual-boot system.

Licensing and booting Windows from a VHD
If you want to install a copy of Windows 7 or Windows 8 on a VHD, you will need an additional valid product key for that extra copy of Windows.

Also, you can use only the Pro and Enterprise editions of Windows 8 to boot from a VHD. You cannot use this feature to install another, earlier version of Windows (such as Windows XP or Windows Vista) or another edition of Windows 8 (such as Starter, Home Premium, and so on) on the VHD.
Breaking the 32-bit barrier with bootable VHDs
Windows Virtual PC and Windows XP Mode supported only the 32-bit (x86) editions of Windows and other operating systems. When you create a bootable VHD, you can install a 64-bit (x64) version of Windows 7 or Windows 8. This is something you would want to consider if your computer has more than 4 GB of RAM so that Windows will be able to see all of your installed memory.

To install Windows on a VHD, perform the following steps:

  1. Boot your computer from your Windows 8 installation DVD. If your computer didn't come with a Windows 8 installation DVD, you will need to obtain one.

    Note:
    You cannot install Windows this way from within a currently loaded copy of Windows 8. You must start your PC from the installation disc.

  2. Select your installation language.
  3. At the install screen, press Shift+F10 to open the DOS command window.
  4. Type diskpart and press Enter.

Using an Existing VHD

To use an existing VHD, perform the following steps:

  1. Type Select vdisk file=C:\path1\path2\disk.vhd, substituting the drive letter and paths where the VHD is stored on your computer, as necessary.
  2. Type attach vdisk.

Creating a New VHD

To create a new VHD, perform the following steps:

  1. Type Create vdisk file=C:\path1\path2\disk.vhd maximum=20000 type=fixed and press Enter, where C: and the paths indicate where you want the VHD stored on your hard disk.
    The 20480 in the example here would create a VHD of 20 GB, so for a 15-GB VHD, type 15360.
  2. Type select vdisk file=C:\path1\path2\disk.vhd and press Enter.
  3. Type attach vdisk and press Enter.

    Fixed vs. expandable VHD files
    When you create a VHD file, you can make it a fixed size or expandable. The latter option creates a small file that the copy of Windows 8 on the VHD can expand as needed up to its maximum size.
    The downside is that if you run short of available disk space on the drive where the VHD file is located, the copy of Windows 8 in the VHD might report errors when it cannot access disk space that it sees as being available to it.

  4. Type exit and press Enter.
  5. Type exit again and press Enter.
  6. Click Install and then select Custom: Install Windows 8 Only (Advanced).
    In the panel where you indicate on which hard disk to install Windows 8, the hard disks in your computer are normally referred to as Disk 0 or Disk 1. The VHD will have a different disk number and will stand out. You will probably find it at the bottom of the list of available drives.
  7. Click the VHD and select Drive Options (Advanced).
  8. Create a new partition in the space available for the partition by clicking New and selecting its size.
  9. Format this new drive.
  10. Ensure that the VHD drive is highlighted and then click Next to install Windows on it.

Windows will install and automatically configure the boot loader; however, you will now have two copies of Windows to choose from when you start your computer. Follow these steps to change the names of the programs after either copy of Windows starts.

  1. Press Windows logo key+X to bring up the Administration menu and then click Command Prompt (Admin).
  2. In the Command Prompt window that appears, type bcdedit /v and then click Enter.
  3. Locate the VHD copy of Windows in the list. It will be associated with a Globally Unique Identifier (GUID), which is a long string of numbers and letters.
  4. Type bcdedit /set {GUID} description "OS Name" and press Enter.
    Cutting and pasting in a Command Prompt window
    You can select text in a Command Prompt window by right-clicking anywhere in the window and selecting Mark. Move the insertion point to the beginning of the text you want to select and then press and hold the Shift key while you select the text. Then, press Ctrl+C to copy the text.
    To paste this text, right-click in the window and select Paste. This can be very helpful when writing long GUIDs.

  5. Optionally, you might want your VHD copy of Windows to be the operating system that loads by default when you start your computer. To do this with any of the entries listed, type bcdedit /default {GUID} and press Enter.
Why boot your computer from a VHD?
The primary reason to boot your computer from a VHD is to protect your main copy of Windows 8. When you boot from a VHD, you can use the full features of your computer and still be able to restore it if something goes wrong simply by booting into your original copy of Windows 8 and restoring the VHD file from a backup. Restoring your operating system takes no longer than the time required to reboot Windows 8 a couple of times and rename a file.

Your VHD copy of Windows 8 will be able to see all of your hard disks and all of your hardware. There will be no way of knowing that you are actually running a VM. This can be very useful for organizations in which getting up and running quickly after a crash and preventing people from damaging a copy of Windows 8 is paramount.
[Next....Using Hyper-V in Windows 8]