VHD stands for Virtual Hard Drive.

A VHD is created with/by programs such as Virtual PC, Virtual Server, Hyper-V, etc. and there's a standard format associated with them. If you’re interested in reading more about VHDs, check out: http://en.wikipedia.org/wiki/VHD_(file_format).

To use a VHD you need to have a program installed to "host" it. Think of it as a "guest" machine within a "host" machine. When you "run" the program that hosts the virtual machine you will be starting the "guest" machine within it. This guest machine is effectively isolated – which is great for testing, security, and restricting/limiting certain resources. To be able to do this, the VHD holds a completely installed OS and all other necessary software. This is part of what can make the actual VHD files extremely large. If you're interested in learning more about creating VHDs, check out this TechNet article: Create and Use a Virtual Hard Disk on Windows 7.

NOTE: Alternatively, if you're running Windows 7, you can also ATTACH a VHD natively without any additional software (I love this). I'll plan on writing up another post on this shortly and I'll link back to this! It's a great way for just quickly grabbing the files without any hassle of launching the VPC (and waiting for it to boot) and then copying files out, etc.

Depending on your operating system, there are a variety of recommendations on what to software to use to "host" the virtual machine:

Using the VHD with Windows Virtual PC (on Windows 7)

The remainder of the instructions here are for using and working with this VHD in Windows Virtual PC (Windows 7). Once Windows Virtual PC has been installed, you can "create" a Virtual Machine with only a few easy steps.

Creating the Virtual Machine 

(1) Launch Windows Virtual PC from the Windows Virtual PC group. This will show any already configured "shell" (or configuration) files in your "C:\Users\username\Virtual Machines" directory. These can be named .VMC (for older implementations of Virtual PC) or .VMCX (with new versions). For you, this list might be empty.

slide1 Using the VHD for our SQL Server 2008 HOLs

(2) To add a new virtual machine, select Create Virtual Machine from the top menu (see above). Next, you need to enter the details for the name and the configuration file for the VPC. The name is just how you plan to later reference the VPC and it can be helpful when you make copies/different versions of a VPC. You can always change this later as well. The location for the "settings" is stored within a VMCX file. Personally, I like to store this in the same location as the VHD.

slide2 Using the VHD for our SQL Server 2008 HOLs

 

(3) For memory and networking, your setting can vary. For memory, you need at least 1GB with a preference for 1.5GB or even higher, if possible. As for networking, you might want to access links or webpages or other resources so you might find this beneficial. If you want to access hard drives on the host machine, you can do this later (and more easily, IMO) through the Integration Features.

slide3 Using the VHD for our SQL Server 2008 HOLs

(4) Finally, choose "Use an existing virtual hard disk" to USE your expanded VHD as the "virtual hard disk" for your newly created virtual machine.

Using UNDO disks can be helpful as it allows you to change your VM into a secondary location and later choose (possibly days later) whether or not you want to save or discard those changes. Take a few minutes to read the details provided in the link.

slide4 Using the VHD for our SQL Server 2008 HOLs

Change the settings of the Virtual Machine 

Now that your virtual machine is setup, you can easily change any of the settings defined when creating the VM. You can do this by right-clicking on the VM or by choosing the Settings option from the menu. 

slide5 Using the VHD for our SQL Server 2008 HOLs

Starting and logging into your Virtual Machine 

To start the Virtual Machine (the "guest" machine on your "host" machine) use OPEN (again, right-click or from the menu):

slide6 Using the VHD for our SQL Server 2008 HOLs

This may take a few seconds to start as it's performing a full boot of an operating system (in the case of our HOLs VPC it's Windows 2003 Server). Once loaded, you can login. However, this is IMMEDIATELY where things can get confusing, especially if you've never used a virtual environment like this because the keystrokes aren't as you might be expecting. AND, if you have used earlier versions of Virtual PC Microsoft changed a few of the replacement keystrokes (this drove me CRAZY when I first booted with it!). If this is your first time using a virtual environment that's "hosted" then let me explain why it's necessary first. This can seem confusing but, it really does make sense. Many keyboard keystrokes (like Ctrl+Alt+Del) are tied to the host machine and cannot be changed even when changing window focus because they are OS level keystrokes. Ctrl+Alt+Del is an interrupt combination that's been used over the years to interrupt applications causing problems (and get to task manager, or to reboot when necessary). This keystroke combination is essentially always tied to the HOST – not the GUEST. As a result, you can select from the top menu (there's a button for Ctrl+Alt+Del) OR you can review the keystrokes below and use them.

slide7v3 Using the VHD for our SQL Server 2008 HOLs

Keyboard Shortcut [Confusion (IMO)]

Function/Keystroke       Virtual PC 2007        Windows Virtual PC (Win 7)
Logon/Ctrl + Alt + Del          Right-Alt + Del             Ctrl + Alt + End
Full screen toggle              Right-Alt + <Enter>         For full screen: Windows+Up Arrow, To toggle back, use the menu

And, now for the password… you can find our SQL Server 2008 SP1 HOLs VPC password in your the lab manual as well as in the 1stReadMe.txt file in the root of your DVD. For someone out there though, you might have lost the DVD, deleted the lab manuals and well… just WANT TO KNOW the password. It's expecting a US Keyboard and the password is Pass@word1. If your HOST machine is not using a US Keyboard, remember that your GUEST is. You will need to remember this as you type your password (especially the @ sign). For example, if you're on a UK Keyboard then "shift+2" is actually " (double-quotes). As a result, you still need to type shift+2 when typing in the password (as if you are on a US keyboard). Once you get into the VPC you can change your keyboard setting and save it. In fact, feel free to change the administrator password, if you'd like!

slide8 Using the VHD for our SQL Server 2008 HOLs

At this point, you're in. The HOLs VPC has 20 formal labs and dozens of samples/demo scripts for learning the many features of SQL Server 2008. Time to start having fun! Check out the LabManuals subdirectory and go from there.

Have fun!
Kimberly