Category Archives: Microsoft

Legacy Entrapment

Where does it all begin?  When does a pattern emerge?  How do we decide that one thing is better than another?  Why do we make the choices we do?

Obviously we can blame our parents first.  That which we know probably started with them.  Then we can blame the media and the Internet for the remaining bits.  We see, we do.  We like to copy that which we have seen.  If we see someone do something and it worked for them, then it should work for us.

This is the nature of primates.  The roots are deep.  It is hard to ignore those aspects of ourselves.  We see, we do.

Sometimes things are designed to be so easy to do it is hard to avoid them.  Once they are used, it is hard to stop.  Things like telephones and televisions come to mind.  Simplicity attracts use.  Use attracts others.  Soon, a large group of customers are avid fans of that which they use.

Enter the entrapment.  Once a user gets hooked on a way something works, the user expects it to always do certain things.  The momentum of the mind will accept minor deviations in future products but will not tolerate having its basic needs met. Continue reading

Microsoft Build Macros

I hit this same problem every time I start a Visual Studio project.  Well, not every time, but it is a common occurrence. When there are multiple projects involved, it is sometimes necessary to point to different directories.  It is possible to hard code the locations but this is not good sometimes based on needing to move the solution to a shared location.

Quite some time ago, Microsoft invented their own way of dealing with this.  Instead of fixing the locations, it can be specified based on a “macro”.  These macros are defined at:

Macros for Build Commands and Properties

These macros are replaced with the real values during the build. It can be very helpful with regards to a retail versus a debug build. The most common ones I use are $(solutiondir) and $(projectdir). Any good tip is that the names already include the backslash so you will not need to specify that after the macro. Anything entered in as a path in Visual Studio should be relative to a macro unless the path is the same for everyone that might use the build.

The list is fairly extensive so you will probably find what you want. Even if you don’t, there is a way to create your own (which I am not going to cover).

Internet Explorer Enhanced Security Configuration (IE ESC)

If you ever have to install a Windows server (2008, 2008 R2) and try to use Internet Explorer, you might notice how annoying IE is related to being secure.  Essentially you have to fight it do anything useful.  At one point I was using it to install Chrome to get around the constant security popups.

Here is an example from trying to visit http://www.citrix.com.

It asks this for each web site that the current web site loads something from.  In this case, I was prompted five times for five different web sites that citrix.com uses.  In some cases it is impossible to keep IE ESC happy and the site never loads properly.

It is for a good cause (server security) but you might as well turn IE off completely.  Administrators are going to expect being able to install and update software from the web.  The web browser plays a key role in doing this.  Having a dysfunctional IE makes the process much more painful.

I briefly have tried to defeat this before.  Nothing worked for me so I gave up on IE and switched to Chrome.  Today, I finally found the right way to switch this off.

Continue reading

Windows Virtual Memory Explained

Mark Russinovich certainly knows his stuff.  He has posted a blog from late last year about “Pushing the Limits of Windows: Virtual Memory“.  Again, I was searching for stuff related to pagefiles and found this highly technical information about how Windows memory works.

It is possible to figure out the best pagefile size from this article but it is more of an art than a science:

So how do you know how much commit charge your workloads require? You might have noticed in the screenshots that Windows tracks that number and Process Explorer shows it: Peak Commit Charge. To optimally size your paging file you should start all the applications you run at the same time, load typical data sets, and then note the commit charge peak (or look at this value after a period of time where you know maximum load was attained). Set the paging file minimum to be that value minus the amount of RAM in your system (if the value is negative, pick a minimum size to permit the kind of crash dump you are configured for). If you want to have some breathing room for potentially large commit demands, set the maximum to double that number.

You will need to understand the basics of virtual memory and commit limit before it will start to make sense.  In general it helps to overestimate but not necessarily too much.  As memory grows to be several GB, it make good sense to not use the old formulas and instead focus on what would really be useful.  Otherwise you will end up wasting GB of space on your disk for a pagefile that does not need to be that big.

Blocks Versus Files

This topic presents an interesting problem.  A disk is made up of sectors which are arranged as clusters by the file system.  Both NTFS and FAT use a cluster model to clump together sectors into bigger chunks.  The cluster model has been around since the original DOS and still runs strong today.  The boot sector of the volume contains how many sectors of a certain size belong to one cluster.  On my Vista system the clusters are 4K (8 sectors of 512 bytes each).  This can vary for USB Flash Drives and smaller hard drives.  My flash drive reports a cluster size of 32K (64 sectors/cluster).  All of this is fine but then the question becomes why should I care?

The answer becomes more relevant when virtualization comes into the picture.  For a VM, the disk is virtual and is actually a file within another file system (most of the time).  Microsoft and Citrix use the VHD format for the VM files.  The VHD specification is public knowledge since Microsoft has documented as of a couple of years ago.  Given that there is a VHD file, everything needed by the operating system is there.  However, it becomes very difficult to manage this information from the outside.  Yes, there are ways to mount VHD drives within a native operating system, but this process is not necessarily easy to automate.  Well, at least not for everyone.

Then a new factor enters the equation.  Since the outside tools cannot see inside the VHD to understand what Windows is actually using, it becomes very difficult to do any kind of analysis or consolidation.  Microsoft does have a solution for compressing a VHD with Virtual PC 2007.  Unfortunately, there are many steps and it involves executing code both inside and outside the VM.  Wouldn’t it be nice if this could be managed completely from the outside?  Wouldn’t it be nice if every cluster (block) was paired with a file?

This sounds difficult and overall the problem is very tough.  The benefits however would be huge.  Basically any file operation performed on the inside could potentially be performed on the outside.  This would include things like defragmentation and shrinking the VHD to get rid of the blank chunks.  It could also include peering into the VHD to see what is there and even the hope of doing updates.

Other possible ventures would include merging virtual disks and even creating virtual disks out of multiple virtual disks.  It is possible to focus on the files instead of the blocks, it would much more possible to have base and delta disks which would both be allowed to change but yet form a cohesive volume to the user.  It is good to dream.

The sources of information look promising.  Microsoft has published APIs related to defragmenting disks which can locate a file on disk.  The API also allow for cluster relocation.  Beyond this, there are projects for Linux to understand NTFS.  Those teams have done much to discover the structure of NTFS and have included this knowledge in their programs and their documentation.  With these kind of guidelines, with patience, NTFS starts to open up and new things become possible.

There is a bit of vagueness about going on here.  It is still too early to talk about in detail.  However, it does seem that specific tasks are within reach which did not look so possible before.  Combining the knowledge of VHD with NTFS to form new tools looks incredibly attractive.

Windows Disk Management

It can be frustrating when the right information is not available.  In Windows there are tools designed to help determining disk configuration but for whatever reason, they are fairly hidden.  Perhaps this is intentional to protect the system from the user.  It would not be hard to make a mistake that could potentially disrupt the entire machine.  For those that are more curious than wanting to change things, it really does not need to be so hidden.

This post is going to take you on a quick tour of the “Disk Management” tool present in Vista.  You can get to the tool through the Control Panel if you really pay attention.  To make it easier, there are screen captures of the decision points.

Continue reading

Easy Sysinternals Tools

This is a tip for those of you that have to figure out what is not working on a given system.  It has been known for a number of years that Sysinternal tools are the best at determining problems.  A couple of years ago Microsoft bought the company.  There was some concern that Microsoft would either charge for the tools or hide them away.  Both of these worries turned out to be unfounded.

It is even possible to use the original domain www.sysinternals.com to find the tools on Microsoft sites.  What is not as widely known is that it is possible to directly execute the tools from the web.  Microsoft has set up a web site that allows direct execution of the most popular Sysinternal tools.  It might seem a bit obscure but once you try it, you’ll understand the value.  By downloading and running the executables, the process of installing is skipped.  If you know what you want, this would be much faster and easier way to run a specific tool against the machine that you are currently at.  In theory, it would even allow for the possibility of writing scripts that would use the Live Sysinternals tools directly.  It is both simple and clever.

Just today I needed to run WinObj to track down some objects.  This turned out to be a nicer option, especially since I only need it from time to time.

I remember when Sysinternals used to be called NTInternals.  It had caused a bit of a stink with Microsoft which had insisted that they change the name.  Now it does not matter but the NT name died quite some years ago.

Here is the brief documentation from the new web site:

What is this?

This is a file share allowing access to all Sysinternals utilities. We have developed this to test an alternate distribution mechanism for our utilities. This will allow you to run these tools from any computer connected to the Internet without having to navigate to a webpage, download and extract the zip file. If you are unfamiliar with Microsoft Windows Sysinternals, it is highly recommended that you visit the website at http://technet.microsoft.com/sysinternals before using these tools. If you have any questions or comments on this file share, please email syssite@microsoft.com

Regards, The Microsoft Windows Sysinternals Team

Vista Snipping Tool

Sometimes tools that come with the operating system pleasantly surprise you.  Vista comes with a tool called the “Snipping Tool”.  It basically makes the PrintScrn key obsolete in Windows.  Typically people will use the PrintScrn key to capture the screen or window into the clipboard.  Once there, it can be pasted into MSPAINT or similar graphics editor.  Once edited, then it can be used in other documents or even saved as an image.

Until a few months ago, that was the only way I did screen image captures.  It was very useful for capturing relevant screen shots for reports and of course blog posts.  The problem with PrintScrn is that it usually captures too much.  Even with limiting it to only one window, it is usually more than needed.  Secondly, not every user is even going to know about the PrintScrn trick.  It certainly is not a beginner kind of thing.

Enter the Snipping Tool.  It is part of the Accessories in Vista and it picks up where PrintScrn left off.  Unlike PrintScrn, it actually has an interface.  It also can isolate parts of the screen in four different ways.

  1. Free-form
  2. Rectangle
  3. Window
  4. Full Screen

These methods can be selected when the Snipping Tool is started from the New drop down menu.  Free-form is used to trace around the area with the mouse (much like a pair of scissors).  Rectangle cuts sections out based on a sized box.  Window takes a snapshot of the entire window.  Obviously Full Screen captures everything.  

Once captured, the tool switches mode to allow you to make small additions (pen and highlight).  Then the result can either be saved to a file, copied to the clipboard, or sent in an email.  It’s a pretty handy tool.  It has sped up the process of doing partial screen captures greatly.

Microsoft has put together a great introduction video for the Snipping Tool.  The basics are covered and it always helps to see these kind of tools in action.

This tool would be most handy for people needing to document anything related to computers (including training manuals and research reports) but would also be great for bloggers as well.  Essentially whenever you would like to share information that you can see on your screen, it would be perhaps the easiest way to do it.

This probably does not fall under the category of being Citrix related but it does seem worthwhile to pass on useful tips from time to time.

Bill Gates – Looking Back, Moving Ahead

 

Bill Gates - Looking Back, Moving Ahead

Bill Gates - Looking Back, Moving Ahead

Just today I was looking for some Microsoft videos related to MMS 2008 when I located some video gems about Bill Gates and his history at Microsoft.  The Microsoft web site is providing a collection of videos for use with the press.  The primary video revolves around Bill Gates.  It contains some very interesting new material and includes a number of interviews with very famous Microsoft employees and even some of Bill Gates’ family.  The video collection is of very high quality and shows a great deal of production work went into it.  If you have any interest in Microsoft or Bill Gates, I highly recommend watching them.

To get the full list of videos, go here.

There are a number of stories from the various interviews that you might find interesting.  For example, there is a video clip dedicated to the 1978 picture of the original 11 Microsoft employees in Albuquerque.

In a way, the Bill Gates video is a summation of his work until now.  It was built to acknowledge his accomplishments during his departure in June 2008.  Regardless of how you feel about him, it is clear that he succeeded even though he dropped out of Harvard.

His Dad has a great quote towards the beginning of the video.  He basically says that “we didn’t know that we have something world-class going on in our living room”.  Nothing like a parent to set you straight :) .  I’m sure it was a joke but it does indicate how proud his father is.

The main video is fifteen minutes long and is well worth it.  It is more like a documentary you would see on TV than a typical company promotional video.

Virtual Hard Disk Specification

The Virtual Hard Disk Image Format Specification (VHD Spec) has been available from Microsoft since October 2006.  You can bypass registration and download straight from here.

The document is only seventeen pages long but manages to capture how it is set up.

The specification was originally created by Connectix and was gained by Microsoft from the acquisition in 2003.  Since then VHD has become more and more successful.  It is used by all Microsoft virtualization products (VirtualPC, Virtual Server, Hyper-V) and is gaining support from Citrix products as well (PVS and XenServer).  VHD looks to be the rising star for Windows based virtual machines.

Strangely, I had the opportunity to meet the creator of the original VHD specification at a BriForum 2008 dinner.  Unfortunately I did not get his business card.  His career path took some strange turns based on working at Connectix, being acquired by Microsoft, working for Microsoft, leaving to work at Calista, and then being acquired yet again by Microsoft.  He was part of the Calista contingent at BriForum 2008 in Chicago along with Nelly Porter.

The VHD format has some tricks up its sleeve.  Two of these are related to disk types.  There are three basic disk types.  They are:

·         Fixed hard disk image

·         Dynamic hard disk image

·         Differencing hard disk image

Fixed disk is pre-allocated to the size specified at creation.  Dynamic disk allocates on the fly based on a certain chunk size (for example 2MB).  Differencing disk is where two or more images are combined to form one virtual disk image.  Differencing would allow for a primitive cloning to take place.  It is similar in concept to linked clones but without the protection of the base not changing.

Being a virtual disk, it has no concept of files.  File interpretation is based solely on the file system code in Windows (NTFS).  This is another way of saying it is a block-based model.

Given the momentum of VHD within Citrix and Microsoft, there is a good chance that VHD will be used for more tasks.  Microsoft has acquired Kidaro, for example, which would imply that VHD will get a major push for transporting VMs around the extended enterprise (read mobile and home workers).  Given the nature of the Kidaro TrimTransfer technology, it should be possible to make this as painless as possible.

There is a competing model at Microsoft under the banner of Windows Imaging Format.  Instead of focusing on disks, it focuses on files.  It uses Single Instance Store (SIS) and is being used for Vista deployment.  It is an excellent model for deploying large sets of files especially with small variations between copies (instances).

Both of these formats allow for mounting (VHDMount and ImageX) into Windows.  VHDMount comes from Virtual Server 2005.

The hope is that VHD will become the standard over time.  There is another format called Open Virtualization Format (OVF) that is set to work across all platforms in the future.  This new format is intended to supercede all existing formats and make it easier to transport workloads between vendors.