Inside SVS :: How (and Why) fslx.sys Tracks Windows Processes
The core technology in SVS is known inside Symantec as "Fortress". The Fortress file system filter driver -- fslx.sys -- is the traffic cop that controls interaction between the operating system and applications in SVS virtual layers.
In the interest of simplicity, Fortress is architected to leverage and extend native Windows functionality wherever possible. This approach ensures that virtualizing an application has the minimal possible impact on the appearance, behavior and supportability of that app. For example, fslx.sys maintains the barrier between the real and the virtual by tracking Windows process trees -- keeping things in order the same way that windows itself does.
What's a PID?
Wikipedia defines a "process" as "an instance of a computer program that is being sequentially executed." All running processes on Windows get a PID (Process ID) #. You can see the PIDs for the major user space processes when you bring up Task Manager > Processes, select View > Select Columns... and check the PID box. Everything done by a process (including all file system and registry calls) is stamped with the process' PID. When a process kicks off another process, the new process gets a PID as well, and is tracked by Windows as a child process. A parent and all of its children, grandchildren, etc., form a "process tree". The process that starts the process tree is called the root process.
You can best see how this looks on any Windows machine by running Process Explorer, a totally awesome tool (essential for SVS development and support) that MS acquired when it bought Sysinternals. It can be downloaded from the MS Web site or from Download.com.
How SVS Uses This Information
Fslx.sys watches all process trees on the system and maintains a map in memory. When a file system operation is called, for example, SVS looks at what process is making the call and knows what process tree it is part of. So it knows what the root process is. (Very often, the process has no parent or children, in which case it is its own root.) SVS makes decisions about when/what to redirect (and to/from where) based where the the root process was launched from. That is, was it launched from a file that exists in a layer -- and which layer -- vs. a file in the base.
Example: When a File Create function call goes to the Windows IO Manager, SVS checks the PID of the process making that function call. It then checks the table to see what the process tree root is for that PID. Let's say the root process was launched from an executable in the read-only sublayer of application layer XYZ. SVS then knows where the new file needs to be created -- within the writable sublayer of application layer XYZ. There's some more complexity when a process tree "crosses over" from the base to a layer, or from one layer to another, but this is the basic concept.
How Process Tracking Is Used During Capture
When a capture is being done and a new read-only sublayer is being built out... Well, it's actually one of the most basic things that SVS does. The root of the process tree is the executable that you selected in the Browse dialog for the Single Program Capture. All writes made by that process and its children go into the read-only sublayer of the new layer. In contrast, a Global Capture doesn't worry about tracking processes -- it redirects all writes into the new layer's read-only sublayer.
As an historical note, Protect 1.x was a prototype for SVS Global Capture. Protect 1.x is just one continuous Global Capture. "Capture by PID" -- later known as Single Program Capture -- was one of the first things we wrote when starting on the updated filter driver for SVS 2.0.
The reason why every once in a while you have to use Global Capture to get the desired result is simple. It's possible to "jump the process tree" (my own term). That is, for a series of process launches to not be tracked by Windows as one contiguous process tree. The most common example -- and really the only one that I'm aware of that is a real-world concern -- is when an install process calls a Windows Service (other than the Windows Installer Service) and has the service do something on its behalf. Services are not tracked by Windows as children in a process tree.
Examples: Let's say an install routine is creating a printer (Adobe Acrobat being both the first example we encountered and the most common one that comes up). When creating a printer, you have to ask the Print Spooler Service to do some work. A Single Program Capture will see that as background noise, ignore it, and the printer does not get created correctly in the new layer. That's why Global Capture is recommended for Adobe Acrobat. VMware Workstation is another example -- you can put it in a layer, no problem, but you have to do a Global Capture because the install calls the Network Connections Service to create the VMware network interfaces.
The Windows Installer Service is handled differently by necessity. We did some special magic to make sure it gets handled correctly by SVS, since it's almost always called during a capture (at least in contemporary and "properly"-written app installs).
Conclusion
The great part for SVS development is that we didn't have to write any of this stuff. All the needed info was just there in Windows, waiting for SVS to come along and use it to make magic. This is one example of what I mean when I say that SVS extends the plumbing that is inherent in native Windows. MS put the process tracking system in place for a lot of reasons, but it's core to SVS being able to do what it does. It makes redirection and prioritization -- and the resultant normal visibility of virtualized apps -- possible.
- Login or register to post comments
- 3707 reads
- Printer-friendly version


















Virtual Runtime Archive
What is the differance in .vsa and .vra.
Difference between VRA and VSA
The difference between VSA (virtual software Applikation) and VRA (virtual Runtime Applikation) is that for a VRA you do not need a SVS license.
If you remove the license key form SVs, you will see that your only able to import a VRA.
Regards
Erik
www.dvs4sbc.nl
And VRAs come from software vendors...
...whereas VSAs you make yourself (or your IT department makes them, or some other user).
Scott Jones
Product Manager
Altiris, Inc.
Now Part of Symantec
And wise installation studio
VRA's can also be created with Wise installation studio.
Regards
Erik
www.dvs4sbc.nl
Wise Installation Studio
...well, that's not an "also" thing. Wise Installation Studio (WIS) is the tool used by software vendors to build the install packages (or Virtual Software Packages) for their products.
WIS is only available to software vendors and may only be used to package their own products that are sold or otherwise distributed externally.
Vendors using WIS are allowed to embed and freely redistribute the SVS Agent in a distribution package with their product's .vra file. This allows any customer to use the product, virtualized, whether they own SVS or not.
Scott Jones
Product Manager
Altiris, Inc.
Now Part of Symantec
Differance between layers
Can you please explain the functionallity differance between the same?
Functionality Differences When SVS is in Runtime Mode
When SVS is in Normal Mode (licensed), you can do everything with a runtime layer that you can with a normal layer.
However, when SVS is in Runtime Mode (no license), you can't do anything with normal layers except Delete (in case you somehow had some left over from a previous licensed installation and need to clean them up). For runtime layers, SVS in Runtime Mode lets you do everything except Export.
Scott Jones
Product Manager
Altiris, Inc.
Now Part of Symantec
Layers Coomunication
Whether we are able to communicate between layers?
Containment That's Clear.
Yes, absolutely. This is well covered in this classic Juice FAQ: click here
Scott Jones
Product Manager
Altiris, Inc.
Now Part of Symantec
Good piece
Very good article Scott.
Thanks for sharing
Regards
Erik
www.dvs4sbc.nl