Windows 7, the most awesome OS till date, was released unto manufacturing on October 22nd, 2009. About 17 percent of the people in the world were already using it within a month of its release. ‘Windows 7 definitely is a great improvement over Windows Vista’, but in saying this I’m actually paraphrasing the millions who love this OS. So, does that mean I don’t like Windows 7?
Well, 7 is what Vista was intended to be; it indeed does a great job of it. True, Windows 7 has the upper hand due to its ability to troubleshoot compatibility better, hence making it possible to run applications once made for Windows 3 and it’s derivatives. The Windows XP mode has been a boon to companies that wish to flaunt license ownership of Windows 7 copies but too miserly to spend on newer software.
“Two out of three people have software problems only because they don’t upgrade their hardware when the time spells need.”-Denver Dias
Consumers loved the Aero interface in Windows 7 better; it made capable some real futuristic stuff. The controls were also easy to understand – Aero shake and snap made a lot more sense to the masses than Aero peek introduced in Windows Vista. Windows 7 boots quicker and shuts down quicker – personally, I loved this part ever since the first beta release. To sum it up, Windows 7 is a great OS. It was still not that different from Vista. I never got why people hated Vista. There is not that much more in 7 on the surface that could make me upgrade from Vista. So, why was my Facebook username ‘Denver7’?
More importantly, why am I writing this post with Internet Explorer 9 on Windows 7?
7 had an awesome feature that caught my eye…
My favourite file-types
There is a huge gap between a computer user and a computer enthusiast in terms of thinking. It might sound weird as I say this and I don’t speak for the whole brotherhood, but the truth is every computer enthusiast has a few, at least one, favorite file types. While I’m ready to admit I do have a few and some of us actually list them, the others amongst us tend to avoid discussing it in public to make sure they’re not bullied or discriminated against – you know, like being called a nerd.
The following is a list of my favorites:
- WIM: This is the Windows Imaging file format with an extension ‘.wim‘. It also has a variant with the ‘.swm‘ extension. This is the format Microsoft uses to store all the editions of Windows, since Vista, on a single disk. Yes, a DVD of Windows 7 contains all the editions of Windows 7 in it. The reason, I like this format a lot, is it’s ability to store a huge amount of data in an archival form. Also, it is a great format for incremental backup systems. My experiments with files of this type has shown that 50 GiB worth data can be stored on a WIM file of size lesser than 3 GiB.
- VHD: This is an abbreviation for Virtual Hard Disk. The conventionally accepted format has an extension ‘.vhd‘ and like WIM it has varying extensions and hence a variety of data structures, some of them being ‘.vdi‘(Virtual Box), ‘.vmdk‘(VMware) and various others. One specific example that I could relate to, if I were a novice, when talking about VHDs is the extension ‘.vmdf‘ used by Acer in its eData Security on it’s Aspire series computers.
- EXE: This abbreviates executable. Files with this extension are those that perform actual work in software. Executables are generally written in assembly code but newer executables tend to use APIs from the .Net Framework for streamlining the process of running all applications. Like WIM and VHD, the files classified as an executable had varying extensions earlier, like ‘.com‘ a.k.a command. As DOS steadily lost the position of kernel in the newer Microsoft OSs, the .exe extension came into prominence.
Lets move on to the more non-geek part of this enterprise, shall we?
Why it’s relevant
The best part of this said feature is that it uses just my favorite three file formats. So, technically all we’re going to do is use a few executables to create a virtual hard disk and later actually boot from the virtual hard disk.
Before we jump to actually creating a virtual hard disk, lets clearly understand what we’re about to do.
Virtual Hard Disk
A virtual hard disk is a file just like any other; it can vary in size but cannot be larger than your physical hard disk itself. Conversely, the contents of this file tends to replicate a physical hard disk as much as possible.
There are three types of virtual hard disks:
- Dynamically expanding: This kind occupies the least space possible your physical hard disk, but the VHD eventually expands to take in more files you throw into it. When a VHD of this kind is created, you get to mention the maximum file size, so the VHD does not expand limitlessly. Secondly, when you use VHDs in virtual machines, it shows you the maximum size of the hard disk you earlier defined. Thirdly, removal of files does not reduce the VHD size. In order to reduce the size a maintenance procedure needs to be followed; but it is too complex and requires a lot of physical hard disk space to perform successfully.
- Fixed size: In this variant, you get a VHD of a fixed size that does not expand, or contract. I recommend using this as your sizing parameter to avoid losing space later unexpectedly.
- Incremental: OK! There is not really a name for this one. It is generally a feature offered by a Virtualizing software to be able to undo recent operations on a VHD, a very handy feature. Microsoft Virtual PC has this as ‘Undo Disks’ and Oracle’s Virtual Box has this as ‘Differencing Disks’. What is done here, is that all your recent changes are stored in a separate file every session. When you start a new session the hard disk contains a summation of all the previous sessions. You could get your virtualizer to remove the last few sessions to get back to a previous state.
Now, lets get to VHD creation. In Windows 7, open the Command Prompt with Administrator rights. The best way to do this, is type “cmd” in the Start search; some entries will appear; right click on “cmd” and click on ‘Run as administrator’. If a UAC promptpops up, permit the program.
Now there is this executable called Diskpart. It should be typed in the command prompt as it is…
On completely loading, this is how it appears.
Now, you’ll need to type the following command but feel free to change whatever you like.
create vdisk file=C:VHDDenver.vhd type=expandable maximum=30720
As you can see, I’m going to create a virtual disk with filename Denver.vhd of the expandable type. The maximum size I’ve mentioned is 30720 MiB which comes to exactly 30 GiB. Now, the first time I typed this command in it gave me an error message, because I didn’t create the folder VHD in my C: drive. So, I created the folder and retried the command, and it worked.
Tip: Instead of retyping the last command, just click the Up arrow key and the last command will appear.
And this is how the file looks in Explorer after creation.
Then you go back to the command prompt and type the following…
select vdisk file=C:VHDDenver.vhd
Once this is done, you can attach the virtual disk using the following command.
Now, we need to know what disk number the VHD has been alloted.
Further, most of the commands are sequential, so go only by that order.
Now, we select disk 4 using the obvious command…
select disk 4
After this you can ask it to create you a primary partition. I made an error while doing it the first time, now, but make sure that when you make an error it should be something meaningless or you might end up losing your data.
create partition primary
Now the next step is not necessary since there will only be one partition but here goes…
And then you see partitions listed, select the partition you’re interested in…
select partition 1
Set the partition active. This is not necessary right now but it’ll sure be useful later.
Then you can assign it a drive letter and use it however you want.
This is a thing I’ve tried to train into myself all my life – avoid doing anything with a GUI if it is possible to perform the same tast better using command prompt. But, I too am a human being like most of the readers, so I do make mistakes. Now before you assign a letter to the drive here is what you can do…
format fs=NTFS label=Denver unit=512 quick override
The command above formats the drive with the NTFS file format system with the unit allocation size of 512 bytes. It labels my drive ‘Denver’ and overrides any other command.
And this is how my Z: virtual drive looks on explorer.
Now, I’ll add some files into the Z: drive.
Now, checking my VHD file itself it looks like this…
While my Virtual drive has gained weight, so has my parent partition, the C: drive.
If this were a fixed drive, all of the 30 GiB of space would have been taken up at once. This would actually be a good thing because you need not worry about loss of free space when the the VHD loses free space.
Moment of truth!
All of this, that you’ve seen here, is just a part of the feature that caught my eye. The sequel to this is pretty exciting too. All you need to do is wait, a while; or if you know me well, a lot. However, if you’re curious and know enough about this, there are clues in this post to guide you toward the said feature.
Well, that is it for now. Don’t expect the sequel to be the next post, but, you sure can expect something as cool as this to surface here.
As for Denver7, well, somethings you’ll never know.
Once again, I’d like to mention my Facebook page RevRYL where you’ll get regular updates about this blog and its posts. You could also discuss your issues with computers, if any, and suggest me any cool topics to cover. All suggestions, critiques and gifts are welcome.
Speaking of gifts, you can Buy me stuff by clicking on link all the way up…