Video Screencast Help
Endpoint Virtualization Community Blog

What's the difference between Activate and "Start layer automatically"?

Created: 05 Jun 2008 • Updated: 29 Jul 2010 • 4 comments
Scott Jones's picture
0 0 Votes
Login to vote

Q:
Lincoln asked, "we have OnPostActivate events in our layers, but they never run unless you manually de-activate and then re-activate the layers. All of our layers are set to start automatically. Shouldn't the OnPostActivate events run when SVS starts the layer during windows boot-up?"

A:
Lincoln, you've hit on a common misunderstanding caused by the language we use in the SVS Admin interface. The menu item "Start layer automatically" is actually a typo/mistake that never got corrected and has become institutionalized. It implies that there is some sort of "start" event for the layer. But there's not. It's supposed to say, "Set as Active on Start". "Active on Start" (meaning Windows start, not the layer or SVS start) is the correct technical term. (Trinket got it right, btw.) It means as Windows is booting, the layer is visible to the system ("active"). So there's never an Activate event to trigger your OnEvent action. That is, there's never a state change because the layer is never inactive.

More Detail

On Activate -- meaning someone or something somewhere executed "svscmd a" or called the Activate API -- SVS does several things:

  • Runs any OnPreActivate events
  • Makes the layer's content visible to the system (that is, adds it to the live redirection table)
  • Emulates Windows bootup (that is, executes all startup items in Run and virgin RunOnce keys, starts up services, runs Startup folder items, etc.)
  • Increments the reference count on services called (so they don’t get shut down during Deactivate if another program is using them)
  • Refreshes the Explorer UI so files, folders, shortcuts, etc. become immediately visible for the interactive user
  • Runs any OnPostActivate events
  • Probably a few other things I'm forgetting or not aware of to ensure that everything works right

In contrast, if a layer is set "Active on Start," SVS does none of the above. When fslx.sys loads and builds its initial redirection table, the table includes all of the layers that are "Active on Start". This is very early in the boot process, before the GUI loads. To the system, the layers are just there, all of them at once, as soon as fslx.sys is done loading and building its table. Windows (not SVS) executes the startup items in active layers, just as with any other installed software.

So if you have something that you need run once before a layered app is used, you have a choice. Do it as an an SVS event at activation time (and actually do an Activate after it's delivered -- easily done in NS by selecting the "Import and Activate" program when creating your delivery task). Or do it like you would with a conventional installation, using a RunOnce key in the registry (inside the layer, of course), which -- as long as the layer is set "Active on Start" -- Windows will process normally the next time it boots.

We've noticed that a lot of customers elect not to activate layers immediately on delivery. You often rely on the "Active on Start" setting and are ok with the layer not being available for use until the next reboot. I'm not quite sure why this is so common, but it means that there may actually never be an Activate event. In this scenario, any pre-launch configuration (whether it's one-time or on every boot) would be done using conventional means, not with the SVS events system. All options for launching things during Windows startup (well, the ones we mere mortals are supposed to know about, anyway!) are documented here: http://support.microsoft.com/kb/179365. I believe most of these are familiar to packaging gurus.

Comments 4 CommentsJump to latest comment

erikw's picture

Scott,
You gave a very good explanation. I like to add something to it.
Autoactivate is commenly used on home and personal computers. It is a easy way to get your servers alive.
At company's we never set layers on auto activate. We activate layers after the user is logged on.
This will set layers active dependend on the username. So if users work on flex machines, that means machines do not belong to one specific user, all software is present, but it will only be active on users logon and active directory dependence.
In SBC or Citrix environements where all layers need to be active, we build a vb script that will activate all layers after the machine bootsup.
Autoactivate will slow down logon procedures.

Regards
Erik
www.dvs4sbc.nl

Regards Erik www.DinamiQs.com Dinamiqs is the home of VirtualStorm (www.virtualstorm.org)

*************************************************************
If your issue has been solved, Please mark it as solved
***********

-3
Login to vote
Jordan's picture

If you want both worlds, layers starting at start up and inactivate events, you can use the SVS User Log-on hook.

Just be warned that since you actually are using SVS to activate the layers, as Scott described, that this can increase significantly Windows' start up time.

http://juice.altiris.com/article/1507

If a forum post solves your problem please flag is as the solution

+5
Login to vote
Lund's picture

Has any of this changed in the upcomming version - SWV 6.1?

 

Regards

Christian Lund

ATEA A/S

-1
Login to vote
Jordan's picture

Few changes.

Logon Hook is not supported on 6.1--though it should work but we don't test to make sure it does.

To avoid confusion we've renamed "Start Layer Automatically" to "Activate on System Startup".

If a forum post solves your problem please flag is as the solution

+1
Login to vote