VHD Install

With Windows 7 (and Windows 8 also) there is one great possibility that was not there before - booting from VHD files (a.k.a. virtual disks). Great thing about that is possibility to install new operating system (works for Windows 7 and Windows 2008 R2) without killing of your original installation (Vista in my case). Unlike installing it in Virtual PC/Server or Hyper-V, here that OS is working on bare metal. All drivers are accessible. It is just like dual boot but without hassle of repartitioning your drive. For more details on how it exactly works, you can take a look at Mark Russinovich’s TechEd lecture about that feature.

As with much of beta features, there is little bit more command line work required for this to work. I found a lot of guides on Internet, but none of them worked for me and most of them included playing with bcdedit which is no longer needed (as of beta 1). It does seem that quite a lot of them was written before Windows 7 public beta and nobody updated them. I will share with you what worked for me as quickest way to do installation without unnecessary steps.

Booting installation

Illustration

First step is to boot into Windows 7 (or Windows 2008 R2) installation. On installation screen press Shift+F10 and you will be presented with Command prompt. That is our destination for now.

Creating virtual disk file

In this example I will create 20 GB VHD file but you can select whichever size you want.

We need to use DISKPART in order to get anywhere.

DISKPART
CREATE VDISK FILE="D:\Virtual Machines\Native\Windows7.vhd" MAXIMUM=20480 TYPE=FIXED
SELECT VDISK FILE="D:\Virtual Machines\Native\Windows7.vhd"
ATTACH VDISK
EXIT

Because of some weird reason (or bug), creating virtual disk file (CREATE VDISK) with path longer than 14 characters kept failing with “The pathname for a virtual disk must be fully qualified.” error. Workaround was to create VHD file at root (and choose short file name) and move it to desired place afterwards. Other commands (SELECT VDISK and ATTACH VDISK) do not mind long file names, so rest of procedure is just fine. [2009-01-22: As I was informed, problem is in using “Windows” as part of name. If you select name without that word, everything goes fine]

Although CREATE VDISK creates dynamic disk (extends as needed) by default, I use fixed since performances are slightly better and Windows 7 tends to extend dynamic disk anyhow to its maximum size during installation. Please notice that CREATE VDISK step will take quite a while if you create fixed disk so be patient (or go with dynamic one).

You could use already existing virtual disk file but there are some reports that it has problems with Virtual PC/Server generated files. Cannot confirm that since I haven’t tried that my self. I did tried one already existing fixed Hyper-V virtual disk file and it worked without problems.

Installing

Illustration

After attaching virtual disk file we can continue with installation. I saw some guides going through BCDEDIT in order to set some parameters but there is no real need (at least with Windows 7 beta 1) for it.

As install type select Custom and you will get drive selection among which virtual disk file is also visible.

There will be small warning at the bottom that says “Windows cannot be installed to Disk X Partition Y”. This may seem troubling but as you take a look to details, there is slightly different wording of message. It says that it “may not support booting to this disk” through BIOS. Since we are not going through BIOS booting process (remember, this is just file on disk), we can just safely ignore this message and click on “Next”.

Installation will then go as usual and after some time and few restarts, your system will be ready for usage.


[2009-05-05: Clearing up some issues]

Customer Care

Illustration

More than ten years into Starcraft’s existence, Blizzard still cares.

There is new patch available. This one is version 1.161 and solves some issues in order to make Starcraft better on modern machines.

It is very surprising to see vendor that still cares about old customers. More than nine millions of them.

Ice Surprise

My Corsair Flash Voyager has lost it’s USB connector few weeks before, so I found my self shopping for new USB drive. I needed something that can stand a lot of abuse (I carry it on keychain in my pocket) and it needed to be small as well.

Illustration

My choice fell on Super Talent’s Pico-C 8 GB model. It is very small and feels like it can take a lot of punishment. In package there was also keychain attachment which I used to attach drive to my keys. That was lousy decision since that keychain was what failed me next day. My USB drive was lost. Since it was right before Christmas, it was impossible to find another.

As snow fell right before New Year, I gave up whole idea of ever finding it again and eBayed myself nickel version of same model. After snow, there came rain, and since temperatures were below zero centigrade, there was lot of ice everywhere (just in one morning, I removed more than five millimeters of ice from my car).

Yesterday (2009-01-20), around one month from date of loss, my wife found that USB drive. She found it at my parking spot in backyard. It was not visible before since it fell into muddy surface, later covered with snow, and it was iced for around two weeks. I assume that parking on that same spot, didn’t help much in search.

I felt little bit uneasy putting it in USB, but my fears were unfounded. It worked perfectly and all files were there. It was just as nothing happened.

I do like device that can take that kind of beating and keep functioning. If only Super Talent could produce half-decent keychain…

Booting Windows 7 Installation From USB Drive

Illustration

Windows 7 gives us possibility to install itself from USB drive (yes, you can do it with Windows Vista also). This is, at least in my eyes, great option since USB is much faster and comfortable option to work with. It is much easier to take USB than to burn DVD each time I need to install Windows on some computer.

Procedure to make USB proper boot drive is done with DISKPART utility.

DISKPART
LIST DISK

SELECT DISK 

CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
FORMAT FS=FAT32 QUICK
ACTIVE
EXIT

Please take great care which disk you select (my USB is marked red). If you select wrong one, you WILL lose your data.

If format gives you error that file system is unsuitable for formatting just unplug USB and repeat whole procedure. For some reason that solves all formatting problems. You can also format it from Explorer window and continue with next diskpart command if that is more convenient.

After everything is done, mount/insert Windows 7 (or Vista) installation DVD. Notice which drive letter is it (mine is F:) and which drive letter is your USB (mine is W:). Then copy all files from one to another using xcopy:

XCOPY ^^F:^^*.* /e /f ^^W:^^\

After everything is copied, your drive is ready.

If booting does not work, be sure to enable Legacy USB support in BIOS. It worked for me.

Color Combination Thou Shalt Not Use

Illustration

Currently there is handball world championship in Croatia. I am not such a big handball fan so I don’t even plan to visit any game (played some 20 minutes of walking distance) but I do plan to watch it on TV few times.

I was at my parents place yesterday doing some unrelated work, but with TV near it was difficult not to scan a result from time to time. I cannot help it if I am curious person. But my curiosity had huge problem (or small one) - font and coloring of part that was displaying game result. Somebody - I can only assume professional designer - decided that red numbers on light red background should be used.

I do wear glasses when I work on computer but my vision is good enough to be able to do all other tasks without them (those who are familiar with my habit of loosing glasses everywhere know that I also do programming for few days without them). If I cannot be sure what numbers do I see on it on 72cm TV from other side of room, my father had no fighting (seeing) chance.

Illustration

I give you enlarged part of that (captured and cropped from RTL’s own video at resolution of 1280x1024). On this picture you can see how really close colors are.

I am angry when vision of some designer (or even worse - designer comity) decides that need for fire theme is more important than actual readability of final solution. I can partly understand their (probable) excuse. They were all doing work on high-resolution, high-fidelity monitors and that problem was not visible there. What was missing was that final testing phase: looking at whole thing from user perspective. User perspective in Croatia is still CRT TV and HD is rarely to be found.

There is real lesson to be learned here even for application development. Always test your program in your user’s environment. “It works on my system” is a poor excuse for user.