Windows

How to install Windows 8 on a VHD (or Windows 7/2008 R2)

1

In this guide, I will explain how to install Windows 8 on a VHD (Virtual Hard Disk). This methods lets you have a second (or many more) bootable operating systems without having to dedicate a complete partition for every OS installed (and without affecting your current Windows installation!). A VHD is essentially a complete partition contained within a single file on the disk. Don’t want that OS anymore? Simply delete the .VHD file and you’re done. Quick and simple.

Now where VHD becomes handy is in testing the new developer preview builds of Windows 8. Note that this method will work on future builds of Windows 8 (Beta, RC and final) as well as Windows 7 and Windows Server 2008 R2. For the purposes of this guide, I’ll assume you currently have Windows 7 installed natively on your machine and want to install the Windows 8 Developer Preview on a VHD. Before we start, you should have already burned the installation ISO of Windows 8 to a DVD or made a bootable USB installation media.

A) Create a new empty VHD

A.1) Launch the Computer Management console (found in Control Panel > Administrative Tools).
A.2) Right-click on Disk Management (under Storage) and choose Create VHD. (Note: You might need to click on Disk Management first, then wait for it to load before you can have the contextual menu with the Create VHD option.)
A.3) Enter the location of the .VHD file. I HIGHLY recommend to place this file on the root of any disk. Note that you will need to remember the path of this file for use later in this guide.
A.4) Enter the disk space (80GB is usually good for most uses) and choose the Fixed size format.
A.5) Click OK and wait for the VHD creation to complete (displayed in the window footer). It usually takes about 5-15 minutes to complete.

B) Install Windows 8 on the VHD

B.1) Reboot the computer with the installation disk (or USB drive) inserted and boot from it.
B.2) On the first installation screen, choose the language options, then click Install Now.
B.3) Accept the license agreement and then choose Custom Installation.
B.4) On this screen, a list of available partitions/disks are displayed. But it’s missing the VHD we created earlier. This is because we need to attach it first.
B.5) Press SHIFT + F10, a command prompt window will appear.
B.6) Type the following command: diskpart
B.7) Then type the command (replace win8.vhd with the name of your VHD): select vdisk file=C:\win8.vhd
—> Got an error? This is because the drive letters may not be assigned in the same order as in Windows. Fortunately, the setup lists them starting from letter C and going up. So try the command again but this time using D:\win8.vhd, then E:\win8.vhd, etc. until it works.
B.8) Once you get a successful message, type the command: attach vdisk
B.9) Once your VHD is attached, type exit, then again exit to close the command prompt.
B.10) On the screen, click the Refresh button. After a few seconds, your VHD should now appear in the list.
B.11) Select the VHD and click Next. (Note: A warning might be displayed at the bottom saying Windows can’t install to this drive. Ignore it!)
B.12) Continue to install Windows 8 as usual, following the on-screen instructions.

And you’re done! The whole Windows 8 OS is now contained within a single isolated file on your disk.
During the boot process, you will have the option to choose between your Windows 7 or Windows 8 installation. Simply select the OS you want to use!

Hyper-V – Remote desktop to your own host limitations

0

In order to boost our development capabilities at work, we recently moved an Hyper-V solution on a VHD host. The host system is a standard Windows Server 2008 R2 system (running from a bootable VHD). We then use Hyper-V to create virtual machines with various configurations for development purposes.

Hyper-V and its basic virtual VGA adapter

The great thing about Hyper-V is that you can boot your VMs and let them run in the background. Should you need to see what’s going on (like a real monitor attached to a physical PC), you can use the built-in “Connect…” feature to see the VM screen. Hyper-V is using a basic VGA adapter to achieve that, which results in a 4:3 low resolution display of the VM. If you’re using that remote screen for development purposes, it’s quite counter-productive and annoying. Which is where the standard Remote Desktop (mstsc.exe) comes handy.

Isn’t that great when your host and VM can’t talk to each other?

The first thing I get while trying to connect to a VM running on my host is a “Not found” error. Sure enough, my VM has network access and so has my host. My colleagues can ping my VMs (and vice-versa) just fine, but impossible to ping the host from the VM or the VM from the host.

Don’t put your VMs on the same network adapter as your host…

Turns out it’s not a good idea to use the same network adapter for Hyper-V and your host. Even though your VMs have completely different and unique MAC and IP address, the packets are still trying to get in and out of the same physical interface which is a no-go. The solution was to use a second PCI-Express gigabit card (or a PCI) to add a second physical network adapter. The host is using the main network adapter while Hyper-V uses the second adapter. Now it all works perfectly.

I’ve seen some complex tutorials about creating local loopbacks adapters with NAT translation in order to use only 1 adapter and frankly, it doesn’t seem work the effort and it might affect performance in the end. So there you go, use 2 physical adapters for Hyper-V.

Windows 7 – Fix the explorer not auto-refreshing bug

5

One of the most irritating bug still present in Windows 7 is explorer not auto-refreshing when creating a new folder or copying/moving/renaming a file. The apparent cause to this problem is when you map network drives in My Computer. Turns out the fix is quite simple (or at least it worked for me):

1) Open My Computer and click Organize > Folder and Search Options

2) Under the View tab, uncheck the Hide protected operating system files (recommended) option.

3) On your desktop, you should now see 1 or more Desktop.ini files. Delete all of them (no, it won’t break your system, they are auto-generated).

4) Reboot your computer. Problem solved!

Note: I still get the bug when copying or moving files from a network drive but anything done locally on the computer seems to work again.
You might want to re-check that setting in Folder and Search Options once you’re done.

Go to Top