Sequencing Mozilla Firefox with App-V 5.x


It’s a simple task to virtualize Firefox, as it lends itself well to application virtualization; however getting it right takes a little preparation. Before embarking on sequencing Firefox, please refer to this companion article – Prepare Mozilla Firefox for Enterprise Deployment and Virtualization – which covers configuring a Firefox installation for virtualizing. It’s important that Firefox is configured correctly for virtualization by disabling specific features.

User Experience

Typically, virtualizing an application changes the user experience due to the introduction of isolation. With App-V 5 there’s no such change to the way users might interact with Firefox. Users can even set a virtualized Firefox as their default browser.

Firefox features to disable

There are a couple of features that should be disabled when running Firefox under App-V 5:

  • Automatic updates for Firefox – Options / Advanced / Update / Firefox updates. Firefox updates should be delivered via new App-V packages. Updates for Add-ons and Search Engines should be OK as these are written to the user profile
  • Mozilla Maintenance ServiceFirefox installs an updater service that allows updating whilst avoiding UAC prompts. This service should be disabled or not installed

Read the article Prepare Mozilla Firefox for Enterprise Deployment and Virtualization for full details on removing these options during installation.

Managing the Firefox profile

Firefox stores preferences, extensions and other user data in:

  • %APPDATA%\Mozilla (preferences, bookmarks etc.); and
  • %LOCALAPPDATA%\Mozilla (browser cache)

The default behaviour of the App-V Sequencer is to exclude %LOCALAPPDATA% – this is a good thing and I don’t recommend removing this exclusion. %APPDATA% will be included by default and whether you leave this location included in the package will depend on your specific deployment requirements; however my recommendation is to exclude this location by adding [{AppData}]\Mozilla to the exclusion list in your sequence. On the client, Firefox will then create a new profile in the real file system when the user starts the browser for the first time.

Virtualizing the profile increases the complexity of upgrading Firefox packages especially challenging given Mozilla’s approach to Firefox releases. By storing the Firefox profile on the real file system, Firefox can be deployed via completely unrelated packages – no need to create upgrade versions. By excluding %APPDATA% and not virtualizing the user profile you will gain some flexibility with your Firefox deployment.

Sequencing Platform

Sequence Firefox on a clean Windows 7 SP1 x86 VM with all current updates and no other applications other than the App-V Sequencer. The Firefox version available from Mozilla is an x86 application, so I generally recommend sequencing Firefox on Windows 7 x86 virtual machine even though you may be deploying to 64-bit Windows. However confirm this in your own environment and re-sequence for 64-bit platforms if required.

Sequencer Configuration

Before sequencing, add the following recommended exclusions. :

  • [{AppData}]\Mozilla
  • [{Common AppData}]\Microsoft\RAC
  • REGISTRY\USER\ [{AppVCurrentUserSID}]\Software\Microsoft\Windows\CurrentVersion\Internet Settings

Download the following Sequencer Template as a starting point for your Firefox sequence:

App-V 5 Sequencer Template App-V 5 Sequencer Template

Installing Firefox

Download the Firefox installer in your target language from the Mozilla site. Sequence Firefox by following these high level steps:

  • Install Firefox
  • Configure profile defaults and preferences locking
  • Optionally add global add-ons and install plug-ins such as Adobe Flash Player (assuming you want this in the same package)

Automating this process as much as possible will create a cleaner package and make it faster to re-create a new Firefox package if required.

Before sequencing, copy all of the required files into the sequencing VM, which should like something like this:

AppVFirefoxSetupFolder

For a walkthrough of the sequencing process, using the installation script outlined in the Firefox deployment article, see the following screenshots:

First Run Tasks and Primary Feature Block

If the steps above have been followed for exclusions, installation and configuration of Firefox, there will be no first run tasks to complete. Additionally the resultant package will be reasonably small so there is no need to create the Primary Feature Block. Because you don’t need to complete first run tasks or create the Primary Feature Block, you could automate the entire end-to-end process of creating a Firefox package using the App-V 5 Sequencer PowerShell module.

Automating the Firefox sequence

With the provided script, sequencing Firefox with the App-V 5 PowerShell module is very simple. Use the PowerShell script below to create a Firefox package based on the steps outlined above.

Import-Module AppvSequencera
New-Item -Path C:\Packages\MozillaFirefox19 -ItemType Directory
CD C:\Packages\Firefox19
New-AppvSequencerPackage -Name "Mozilla Firefox 19" -TemplateFilePath .\AppV5SequencerTemplate.appvt -OutputPath C:\Packages -PrimaryVirtualApplicationDirectory C:\MozillaFirefox -Installer .\InstallFirefox.cmd

Finally

Save your package and deploy. With compression enabled, the package should be around 27Mb.

Print Friendly
  • Philip

    Hi Aaron,

    I have a situation where I actually want a Virtual Instance of Firefox to use a specific profile that comes with the bubble and not the user’s profile in the RFS APPDATAMozilla folder. Do you have any advice for achieving that?

  • JK

    Hi,

    Have you tried to Sequence the FireFox version 19.0.2 on Windows 8 x64 with APP-V 5 SP1? I excluded the FireFox profile and all other settings are working correctly but every time you launch the FireFox it creates the new profile.

    Best

  • bad.wurzach

    Hi Aaron,

    i have a problem with the addons. I started firefox 22 on my test client (windows 7sp1,64bit). then i go to extras and installed “Adblock Plus”. The Addon is active. After a restart from firefox the addon is visible but it’s deactivated.

    You hava idea what’s the problem is?

  • Koen

    Hi Aaron,

    First off, nice write up :)

    I have a question about this: “On the client, Firefox will then create a new profile in the real file system when the user starts the browser for the first time.”

    I have an application that is also creating user config files into the virtual appdata folder and I want it to create those files into the physical file system rather than in the vfs. I tried this method you mentioned by excluding the path when sequencing, but the application still creates all files in the vfs (%appdata%microsoftappvvfsappdata… instead of %appdata%…) also if i put already configured configuration files in the physical file system in that location the virtual application will not use them. Can you maybe go in to more detail about how this could be accomplished?

    Thanks, Koen.

    • Koen

      Hello Aaron,
      The problem was that the pvad was the same directory as the one where the physical file was (%appdata%). choosing any other pvad made it possible to use physical files in the %appdata% directory with the virtual application.
      Koen.

      • http://stealthpuppy.com Aaron Parker

        Good to hear. Were you using %APPDATA% as the PVAD?

  • Danny

    Hi Aaron, im a great fan of your blogs and they have been a great help to me.

    There is only one thing I am stuck on for quite a while now.

    The Firefox package is working great including some forced preferences like default pages/tabs, homedir as default download folder etc.
    The only thing im not able to get straight is profiling.. We use the RES Workstation manager for this to copy files/settings at application end to the users homedir (hidden preferences folder). But there is nothing to copy….

    The problem with this is that that the following directory and file:
    - %appdata%MozillaFirefoxprofiles
    - %appdata%MozillaFirefoxprofiles.ini
    Are created when im testing on the Sequencer it self, but when I use the package on the client this directory and file is not created, there is even no Mozilla directory under %appdata% of the specefic user. I found that there is a profile folder under “%localappdata%, but again the profiles.ini file is missing here.

    I tried multiple times with your AppV template and without it.

    We are useing a ServerOs for the client Desktop.
    - Both the Sequencer and the RDS server(s) are Microsoft Windows 2008 R2 Datacenter edition.
    - Were are yousing Microsoft AppV 5.1 (SP1) for packaging.
    - We are using RES Workspace Manager 2012 v9.7.3.1 SR3.
    - For firefox we use the newest installer Firefox_nl_24.0.0.exe (Dutch).

    Im stuck on this for quite a while now, and the same problem seems to popup for Google’s Chrome browser so im thinking there is is something wrong with the Sequencer or the Appv configuration but Ive no clue where to start.

    In short:
    Why is there no %appdata%MozillaFirefoxprofiles and %appdata%MozillaFirefoxprofiles.ini in the real fil system of the RDS server, is it somehow still in the “Bubble”? Rendering me unable to copy the users profile useing RED Workspace manager.

    Some help will be greatly appreciated.
    Danny

    • Danny

      I read an article on RESninja today, and it pretty much descripes the problem I’am experiencing. Is this realy the way to go? Or is there a simpeler more practical way to capture profiles/user data related to applicaions.

      It feels like a odd way to accomplish some basic functionality.

      Danny
      Going tot test this today at home or tomorrow at work.

    • http://stealthpuppy.com Aaron Parker

      Hi Danny, I’m not an expert with Workspace Manager, so not sure why you can’t see into the bubble, regardless of whether the profile in the virtualized or real file system.

      If you’ve excluded the profile location (%APPDATA%Mozilla), then the Firefox profile should, by all rights, end up on the real file system.

      What happens if you don’t run Firefox during sequencing, pretty sure that’s what I did (or didn’t do) during sequencing.

      • Danny

        Hi Aaron, thanks for your reply.

        The only thing we do for firefox with Workspace manager is capturing some user settings at application END.

        It would be way easier and more logical when you can just say capture “%APPDATA%Mozilla” instead of the complex path im capturing now, but ok for now it seems to work partly.

        I pointed RES to captures these two things:

        File: %APPDATA%MicrosoftAppVClientVFSB7E01815-2BBA-408F-B98A-D0D90ADA3FA2AppDataMozillaFirefoxprofiles.ini

        and Folder: %APPDATA%MicrosoftAppVClientVFSB7E01815-2BBA-408F-B98A-D0D90ADA3FA2AppDataMozillaFirefoxProfiles

        I just tested it with the solution provided by RESninja and this is what happens:

        Test 1 – delete only Mozilla appdata)

        If I login with my test user (user3) and startup firefox it will populate the profile folder, then I made some changes in Firefox like adding bookmarks.

        Then when im logging off the user (user3) and manual remove the mozilla folder on the RDS server (Full path: “C:Usersuser3AppDataRoamingMicrosoftAppVClientVFSB7E01815-2BBA-408F-B98A-D0D90ADA3FA2AppDataMozilla”)

        When user3 logs on again, it will recreate/populate the mozilla folder and I still have the profile including the history, bookmarks etc.

        Test 2 – completely delete user profile)

        Login with User3, start Firefox, make changes and logoff.

        Then login to the RDS server with my ADMIN account and delete “user3″ completely from that RDS server.

        (To simulating a first time login or a situation where you are load balanced to an other RDS server)

        Login again with user3 the user is recreated and when starting Firefox there is a new profile and all the settings/history/bookmarks etc are gone.)

    • Carl

      Hi, the only way I can get the Firefox profile to be created in the real file system (I use the exclusion [{AppData}]Mozilla when creating the sequence in App-V 5 Sp1), is to create the AppDataMozillaFirefox folders in the users profile. Then the profile is created on the real file system. If the folders don’t exist in the users profile and firefox is launched the profile is created within VFS.
      Any ideas?

  • Carl

    Hi, the only way I can get the Firefox profile to be created in the real file system (I use the exclusion [{AppData}]Mozilla when creating the sequence in App-V 5 Sp1), is to create the AppDataMozillaFirefox folders in the users profile. Then the profile is created on the real file system. If the folders don’t exist in the users profile and firefox is launched the profile is created within VFS.
    Any ideas?