Windows8 Room

Windows 8 Basics, Tips, Tricks and other related useful Infos

After installing Windows 8, you might need Windows 7 for some reason. You can install Windows 7 to Virtual PC, or you can install to VHD system, which I’m going to show you how.

VHD stand for Virtual Hard Disk, which is a function where you create one file and you treat that file as a hard disk. It’s like CD/DVD ISO image if you have used before, you mount image to drive. Same for VHD, you mount VHD file to a drive, and you can read / write just like normal hard disk.

Windows 7 Enterprise / Ultimate and Windows 8 supports OS installation to VHD file. At PC bootup, just like you select other OS, you can select VHD as one of the boot partition. After booting, VHD works as system drive, and other physical drive (including drive holding VHD file) can also be used normally.

Good thing for installing OS to VHD is,

– Can use all PC resources (unlike Virtual PC, only HDD is virtualized)

– Since system drive is in singe file, you can easily make backups and restore.

– No need to prepare partition for each OS you need.

– If you don’t need OS anymore, just delete VHD file and remove from boot item list.

There are demerits; you can’t use hibernation, restriction when using Bitlocker, performance may be slow, when using VHD. Refer to article in Computerworld for details.

Using VHD is good in case where you don’t have enough performance for using Virtual PC, or you want to use peripherals, and you don’t want to create new partition for new OS. You can compress and store VHD file somewhere, and you can decompress and use when only you need them.

Note that current OS which support booting from VHD file is Windows 7 Ultimate / Enterprise and Windows 8.

This time, I’m going to show how to install Windows 7 Ultimate to VHD in Windows 8 Pro environment, but you can install Windows 8 to VHD in Windows 7 or Vista environment. Also, you will need license for per OS you are going to install.

First, you need to create VHD file. Press “Win + X” key and open “Disk Management”.

vhdの作成 1

From menu, select “Create VHD”.

vhdの作成 2

Select VHD file location, size, and type. Since Windows 7 does not support VHDX, set to VHD. For type, Fixed size is better in performance, but you can save disk space by selecting Dynamically expanding type. Select depending on usage.

vhdの作成 3

After creating VHD file, it will automatically gets mounted. Right click disk and initialize disk.

vhdの作成 4

vhdの作成 5

After initialization, right click partition and create new volume, with NTFS format.

vhdの作成 6

vhdの作成 7

vhdの作成 8

vhdの作成 9

vhdの作成 10

If message asking to format disk appears, press cancel and close message.

vhdの作成 11

Now you have VHD file ready, lets install OS. To install OS to VHD file, you can install using imagex tool, and ordinal way, installing from setup media. This time, I’m going to use imagex tool, which is simpler and no need for DVD drive if you have OS setup disk in iso format.

Using imagex is simple, but you need to download and install 1.6GB install kit. Get Automated Installation Kit from Microsoft page.

Automated Installation Kit (AIK)

AIK導入 1

After downloading iso file, right click and mount image.

AIK導入 2

Run StartCD and install.

AIK導入 3

Click Windows AIK Setup and install AIK.

AIK導入 4

If you don’t have .NET Framework 2.0 installed, message will be shown. In this case, select .NET Framework Setup from menu and install.

AIK導入 5

AIK導入 6

AIK導入 7

After installing .NET Framework, run AIK setup again.

AIK導入 8

AIK導入 9

AIK導入 10

AIK導入 11

After AIK installation, you need to prepare setup media for OS you are going to install to VHD, such as Windows 7 Ultimate. Only file you need from setup media is sources\install.wim file when using images.

install.wim

After AIK installation, you will find Deployment tool command prompt shortcut in Start screen. Right click and choose “Run as administrator” from app bar.

コマンドプロンプト起動

コマンドプロンプト起動

If VHD file is not mounted at this point, right click VHD file and mount.

In this example, OS setup media is in D: drive, and VHD is mounted in E: drive. For Windows 7 Ultimate, there are many editions you can choose to install from. You need to check installation number for edition you want to install. Check with imagex command.

imagex /info d:\sources\install.wim

index確認

IMAGE INDEX is installation number, NAME is edition. Check number. If you choose edition other than Ultimate or Enterprise, you can still install, but will not boot from VHD file. For Windows 7 Ultimate, this should be 4 or 5.

Now, install using imagex command. 4 should be replaced with your installation number.

imagex /apply d:\sources\install.wim 4 e:

Windows 7 インストール 1

Wait for while for OS to get installed to VHD.

Windows 7 インストール 2

After OS installation completes, add boot item to BCD to boot from VHD file. Run “bcdedit” to see list of current boot item in BCD store.

bcdedit

Either copy existing item and modify parameter, or create item from scratch if you are used to it. It’ll be safe if you make backup copy of BCD with export command before making modification.

Make copy of current OS boot item. Name “Windows 7 VHD” can be anything, name you like.

bcdedit /copy {current} /d "Windows 7 VHD"

bcd 編集 1

After making copy, GUID for entry will be shown. Right click command prompt, select Mark and copy GUID to clipboard.

bcd 編集 2

Modify item’s parameter, and specify created VHD file for boot drive. “[C:]” should be typed as is, including “[]”, and specify VHD path of your own.

bcdedit /set {Copied GUID} device VHD=[C:]\vhd\win7disk.vhd
 bcdedit /set {Copied GUID} osdevice VHD=[C:]\vhd\win7disk.vhd

bcd 編集 3

Run bcdedit again, and check boot loader for Windows 7 is correctly configured. (Be sure you have not modified Windows 8 item)

bcd 編集 4

You are ready to go. Restart PC, and you should see Windows 7 VHD in boot item.

Windows 7 Boot

If Windows 8 boots even if you choose Windows 7 VHD, or shows error, check boot loader settings, or check if you are trying to install 64bit version of Windows 7 on PC without 64bit support.

Windows 7 boots, and setup wizard should start.

Windows 7 Setup 1

Windows 7 Setup 2

Windows 7 Setup 3

This is all for installing Windows 7. VHD file is mounted as C: drive, and original Hard Disk is mounted as D: drive. (You can find VHD file in D: drive).

Windows 7

If you want to make backups for Windows 7 environment, boot with Windows 8 and make backup copy of VHD file. If you don’t need Windows 7 anymore, delete VHD file and remove boot item with bcdedit.

For your info, if you install Professional edition with imagex, following message will be shown at very end of setup process.

Windows 7 Boot fail


This post is also available in: Japanese

Leave a Reply

Your email address will not be published. Required fields are marked *


*