Microsoft KB Archive/931819

= How to use Filemon and Regmon to troubleshoot SoftGrid-enabled applications =

Article ID: 931819

Article Last Modified on 11/30/2007

-

APPLIES TO


 * Microsoft SoftGrid Application Virtualization for Terminal Services
 * Microsoft SoftGrid Application Virtualization for Windows Desktops

-



INTRODUCTION
For Microsoft SoftGrid, Process Monitor is the recommended tool to use to troubleshoot the file system and the registry. For more information about Process Monitor, visit the following Microsoft Web site:

http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/processmonitor.mspx

However, this article discusses how to use Filemon and Regmon to troubleshoot SoftGrid-enabled applications.



Summary
This article requires that the user who performs these procedures must be logged on to the SoftGrid client as an account that has local administrator rights. The examples in this article use the default SoftGrid client drive letter Q. Although this article is primarily about Filemon, you can use the same steps for Regmon. To download Sysinternals Filemon and Regmon, visit the following Microsoft Web site:

http://www.microsoft.com/technet/sysinternals/default.mspx

Creating an .osd file

 * 1) Make a copy of the .osd file for the application that you want to troubleshoot.
 * 2) Rename the .osd file from {filename}.osd to {filename}_support.osd.
 * 3) Edit the .osd file by using a text editor.
 * 4) Change the VERSION attribute of the SOFTPKG element from its current value to Support.

Example: renaming .osd file Rename ea70.osd to ea70_support.osd Example: (changing VERSION and SOFTPKG)

From:



To:



Creating a .reg file for Filemon
If you use Filemon version 7.00, you can skip this step. For more information about why Sysinternals Filemon and Regmon may not start in the Virtual Environment, click the following article number to view the article in the Microsoft Knowledge Base:

931822 Error message when you try to run the Sysinternals FileMon and RegMon from inside the Microsoft SoftGrid Virtual Environment: &quot;The system cannot find the file specified&quot;

 Create a .reg file that is named Filemon.reg. Edit the .reg file by using a text editor.  Add the following text.

For Filemon and Regmon version 7.01 and 7.02 Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Filemon701] &quot;Type&quot;=dword:00000001 &quot;ErrorControl&quot;=dword:00000001 &quot;Start&quot;=dword:00000003 &quot;ImagePath&quot;=&quot;\\??\\c:\\windows\\system32\\drivers\\filem701.sys&quot;

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Regmon701] &quot;Type&quot;=dword:00000001 &quot;ErrorControl&quot;=dword:00000001 &quot;Start&quot;=dword:00000003 &quot;ImagePath&quot;=&quot;\\??\\c:\\windows\\system32\\drivers\\regsys701.sys&quot; For Filemon and Regmon version 6.x Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Filemon] &quot;Type&quot;=dword:00000001 &quot;ErrorControl&quot;=dword:00000001 &quot;Start&quot;=dword:00000003 &quot;ImagePath&quot;=&quot;\\??\\c:\\windows\\system32\\drivers\\filem.sys&quot;

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Regmon] &quot;Type&quot;=dword:00000001 &quot;ErrorControl&quot;=dword:00000001 &quot;Start&quot;=dword:00000003 &quot;ImagePath&quot;=&quot;\\??\\c:\\windows\\system32\\drivers\\regsys.sys&quot; Note In this .reg file, replace &quot;windows&quot; with &quot;winnt&quot; on Windows 2000-based computers.  Save the .reg file

Configuring the .osd file to import the .reg file
If you use Filemon version 7.00, you can skip this step. For more information about why Sysinternals Filemon and Regmon may not start in the Virtual Environment, click the following article number to view the article in the Microsoft Knowledge Base:

931822 Error message when you try to run the Sysinternals FileMon and RegMon from inside the Microsoft SoftGrid Virtual Environment: &quot;The system cannot find the file specified&quot;

 Edit the .osd file that you created in the initial step by using a text editor.</li>  Add the following SCRIPT and HREF elements after <DEPENDENCY> but before </DEPENDENCY>. <SCRIPT TIMEOUT=&quot;60&quot; TIMING=&quot;PRE&quot; EVENT=&quot;LAUNCH&quot; WAIT=&quot;TRUE&quot; PROTECT=&quot;FALSE&quot;> <HREF>%systemroot%\regedit.exe /s filemon.reg</HREF> </SCRIPT> </li> Save the changes to the .osd file.</li></ol>

Example: (adding SCRIPT and HREF elements) <DEPENDENCY> <CLIENTVERSION VERSION=&quot;2.0.5.0&quot;/> <SCRIPT TIMEOUT=&quot;60&quot; TIMING=&quot;PRE&quot; EVENT=&quot;LAUNCH&quot; WAIT=&quot;TRUE&quot; PROTECT=&quot;FALSE&quot;> <HREF>%systemroot%\regedit.exe /s filemon.reg</HREF> </SCRIPT> </DEPENDENCY>

Configuring the .osd file to run external applications
Filemon must be run within the Virtual Environment. Otherwise, activity that occurs on the Q drive cannot be monitored.

After you start Filemon, click Volumes, and then click Volume Q: (FIXED). You will receive the following error message:

Filemon could not attach to drive Q:

To run Filemon from the Virtual Environment, you must configure the .osd file to grant access to the Q drive for external applications. To do this, follow these steps:  Edit the .osd file that you created in the initial step by using a text editor.</li>  Add the following script and scriptbody elements after <DEPENDENCY> but before </DEPENDENCY>. SCRIPT TIMEOUT=&quot;0&quot; TIMING=&quot;PRE&quot; EVENT=&quot;LAUNCH&quot; WAIT=&quot;TRUE&quot; PROTECT=&quot;TRUE&quot;> <SCRIPTBODY>%systemroot%\system32\cmd.exe</SCRIPTBODY> </SCRIPT> </li> Save the changes to the .osd file.</li></ol>

Example <DEPENDENCY> <CLIENTVERSION VERSION=&quot;2.0.5.0&quot;/> <SCRIPT TIMEOUT=&quot;60&quot; TIMING=&quot;PRE&quot; EVENT=&quot;LAUNCH&quot; WAIT=&quot;TRUE&quot; PROTECT=&quot;FALSE&quot;> <HREF>%systemroot%\regedit.exe /s sft_filemon.reg</HREF> </SCRIPT> <SCRIPT TIMEOUT=&quot;0&quot; TIMING=&quot;PRE&quot; EVENT=&quot;LAUNCH&quot; WAIT=&quot;TRUE&quot; PROTECT=&quot;TRUE&quot;> <SCRIPTBODY>%systemroot%\system32\cmd.exe</SCRIPTBODY> </SCRIPT> </DEPENDENCY>

Running Filemon within the Virtual Environment

 * 1) Run the .osd file.

Note When the .reg file opens, the file silently adds itself to the local Registry. The command prompt from the PRE LAUNCH script then appears.
 * 1) At the command prompt, locate and then run Filemon.exe.
 * 2) On the File menu, click Capture Events to stop the capturing process.
 * 3) On the Edit menu, click Clear Display.
 * 4) On the Volumes menu, click Volume Q: (FIXED).
 * 5) On the File menu, click Capture Events to start the capturing process.
 * 6) Close the Command Prompt window.
 * 7) After you close the Command Prompt window, the application continues to load. When you receive the error message, continue with the next step. If the application does not open without displaying an error message, wait 30 seconds or the time that is typically required for the application to fail. Then continue with the next step.
 * 8) On the File menu select Capture Events to stop capturing
 * 9) On the File menu, click Save to save the .log file.
 * 10) Review the log for potential issues.



Tips
<ul> Do not configure Filemon to filter before capturing the failure. Instead, filter the results after the log is saved.</li> To locate the failure, search for &quot;.wav&quot;. When an application fails, it typical calls the critical stop sounds even if the system is not configured for sounds. The failure is typically located several lines above the line that contains &quot;.wav.&quot;</li> The key problem results are the following results: <ul> FILE NOT FOUND</li> PATH NOT FOUND</li> ACCESS DENIED</li></ul> </li> External applications such as Imasrv.exe ordinarily do not access the Q drive when the problem result is ACCESS DENIED. Applications such as this do not require access to the Q: drive.

Note Imasrv.exe is the Citrix Independent Management Architecture (IMAService).</li> Compare the log against a Filemon log from a working system. For example, compare the log to a log from a local installation or Sequencer.</li> Not all failures result in an error. During sequencing, the application may use a file from the following path:

%systemroot%\system32

However, the application may use that same file from the Q drive during streaming. This may indicate that the version of the file that is on the Q drive must be updated or removed from the package. You can compare the nonworking and the working logs to help determine how to handle the file.</li></ul>

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.

Keywords: kbexpertiseinter kbhowto KB931819

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.