Sharing Firefox and Thunderbird profiles on a dual boot system

Want to share Thunderbird and Firefox passwords, cookies, and mail folders between Linux and Windows on a dual-boot system? Here’s how.

I recently installed Linux alongside Windows on my system, and among other things, I wanted to share my E-mail and web browsing settings (bookmarks, stored passwords, etc.) I use Thunderbird to read my mail and Firefox as my main browser. After some hunting around and experimentation, I got it working. There doesn’t seem to be a site with clear instructions all in one place, so here’s how to do it. For the record, by “Windows” I mean Windows XP Professional SP2, and by “Linux” I mean Ubuntu 5.04 (Hoary).

  1. Set aside a portion of your hard disk to share between the two OSes. Since Linux’s NTFS support is still not quite ready for prime time, I believe the best option is to create a FAT32 partition for all the data you want to have available in both modes. For consistency’s sake, I mounted this under /u on Linux and U: on Windows, but it doesn’t have to be at all similar. I’ll use those names in the examples below.

    Note that to access a FAT32 partition as a regular user under Linux, you will need to give some additional mount options. Here’s what my /etc/fstab line looks like:

    /dev/sda5 /u vfat quiet,uid=1000,shortname=mixed,umask=002 0 0

    That makes all the files in /u look like they’re owned by user id 1000, my non-root user ID under Linux.

  2. Under Windows, create a directory U:\username and a subdirectory U:\username\Application Data on the new partition to hold your Windows profile information. You’ll probably want to share more than just these two apps, so it pays to organize things a bit.
  3. Make sure you aren’t currently running either Thunderbird or Firefox.
  4. Copy your Thunderbird and Firefox profile directories to the new partition on Windows. The profile directories are, by default, located in C:\Documents and Settings\username\Application Data\Thunderbird and C:\Documents and Settings\username\Application Data\Mozilla\Firefox. Copy both of those directories to U:\username.
  5. Update Thunderbird to use the new directories. For this, you’ll need to open a command prompt (Start -> Programs -> Accessories -> Command Prompt) since you’ll be passing some command-line options. (You can also do it by creating shortcuts, but hey, you’re installing Linux, so you probably don’t mind command lines too much.) From the command prompt, type cd “\Program Files\Thunderbird” (substitute your Thunderbird installation directory if different) and thunderbird.exe -p.

    A Thunderbird “profile manager” window will appear. Delete the existing “default” profile and create a new one. What you call it doesn’t matter, but what does matter is that you click the “Choose Folder…” button and browse to U:\username\Application Data\Thunderbird\Profiles\default. Inside that directory will be another directory with a random name like “9c4tcbid.slt”. Select that directory and hit the Select button. Click Finish. Select the newly created profile and make sure Thunderbird starts up okay with all your settings intact.

  6. Repeat the above process for Firefox: go to its install directory, run firefox -p, delete the old default profile, and select the new copy of the profile directory.
  7. Now boot into Linux.
  8. For Thunderbird, you can just use the same profile directory. Run thunderbird -p (if you’re on a Debian-based distro, mozilla-thunderbird -p) and repeat the profile selection process above, choosing the same profile directory. Some pages about this procedure claim you may have to quit Thunderbird then restart it to get this change to stick. I didn’t find that was the case, but you might. Check to make sure your existing mail folders and server configuration is still there. You may have to re-enter mail server passwords.
  9. Firefox is a bit more involved, in part because there are enough extensions that break under one OS or the other that you probably won’t want to share those. So you’ll take a more surgical approach here, sharing just those parts of the Firefox profile that actually need to be shared. Luckily, it’s pretty easy with symbolic links.

    Go to your Linux Firefox profile directory: cd ~/.mozilla/firefox/random-directory-name

    Remove the existing saved password and cookie files: rm key3.db signons.txt cookies.txt

    Make symbolic links to replace those files (I’m assuming you’re using a shell that supports csh-style globbing; if not you’ll have to do it as three commands.)

    ln -s /u/username/Application Data/Mozilla/Firefox/Profiles/default.nbl/{key3.db,cookies.txt,signons.txt} .

  10. Now launch Firefox. There’s just one thing left: to tell it to use the bookmarks file in the shared directory. You could do that with a symbolic link too, but since Firefox actually supports relocating the bookmarks file, it’s probably better to use that capability rather than trying to trick it any more than necessary.

    Enter about:config into the URL bar. Scroll down to the line that starts “browser.bookmarks.file”. Double-click it and enter /u/username/Application Data/Mozilla/Firefox/Profiles/default.nbl/bookmarks.html into the dialog box.

  11. Restart Firefox and you should see the bookmarks and personal toolbar from your Windows profile.

That’s it! Changes to your saved passwords, cookies, and bookmarks will appear on the Windows side, as will new mail downloaded to local Thunderbird folders.

I hope this was useful to someone. If you spot any errors or omissions in the above, please post a comment.

23 Responses to “Sharing Firefox and Thunderbird profiles on a dual boot system”

  1. heiz0r Says:

    thx a lot for that tutorial, it was just what i needed.

  2. Jeff Says:

    Nice tutorial — a few changes:

    New versions in Linux (apparently) need -profilemanager, rather than -p. -p still works in Windows, but would not work in Linux.

    If you don’t have a browser.bookmarks.file entry, right click to add a string entry. NB: my system appeared to ignore this setting, so I made symlinks of bookmarks.html and bookmarks.bak.

  3. David Says:

    This is a great tutorial.. unfortunately, I can’t get Firefox working all the way.

    I get the following error after doing everything exactly as your tutorial states (although I manually added the browser.bookmarks.file .. which seemed to work fine):

    “Could not initialize the browser’s security component. The most likely cuase is problems with files in your browser’s profile directory. Please check that this directory has no read/write restrictions and your hard disk is not full or close to full. It is recommended that you exit the browser and fix the problem. If you continue to use this browser session, you might see incorrect browser behaviour when accessing security features.”

    I’m not sure if its the symbolic link that didn’t work, or if it’s just the way I’m mounting my drive. As the user I’m logged in as, I do have full read/write on the drive.. so I’m not sure that’s it. Any suggestions?

  4. David Says:

    Also.. can you post how to do symlinks of bookmarks.html and bookmarks.bak, just for thoroughness? :)

  5. David Says:

    Alright, I think I figured it out myself…

    I’m on a completely fresh dual boot install… and I didn’t even have any of the “key3.db signons.txt cookies.txt” files from using Firefox in Windows before I tried sharing them in Linux. Once I booted in Windows and browsed around through Firefox a bit (thus making the 3 files), I went back into Linux and relinked them. That seemed to do the trick!

    Thanks for the tutorial!

  6. CoolAJ86 Says:

    Thank You So Much!!!

  7. Abhi Says:

    This was exactly what I was looking for! Thank you!

  8. Alex Says:

    As all the people said, this is exactly what I was looking for. WinXP and Ubuntu, sharing Firefox and Thunderbird profiles.

    Is there any problems in sharing the extensions with Thunderbird? I mean, I also use extensions with Thunderbird, is there any way just to share the mails but not the extensions?

  9. koreth Says:

    I don’t really use extensions with Thunderbird, so I haven’t put any effort into looking at that. Perhaps someone else reading this will have an idea! I’m sure it’s possible somehow.

  10. Matthias Says:

    tried this stuff for two hours.. first firefox (on windows) wouldn’t let me move my profile ((moved) profile is in use, extensions broke), then thunderbird on linux komplained about the moved profile (profile is in use (while win-thunderbird did not complain)).. tried to link cookies and bookmarks which somehow didn’t get saved in the new profile.. I’m giving up.. would have been nice though…

  11. Ben Says:

    Great tutorial!

    If you follow this tutorial for Thunderbird+extensions (namely new mail item -> http://moztraybiff.mozdev.org/) Thunderbird won’t work under Windows.

    To fix it you follow a similar approach to the Firefox installation.

    (You probably don’t need to do exactly as I did, but this solution works - namely I’ve probably overkilled it)

    1. Place your thunderbird profile on the FAT32 partition
    2. In your Linux thunderbird profile make symbolic links to all the files on the FAT32 partition excluding the `extensions’ directory. This is what I executed:

    ln -s /path/to/fat32/profile/chrome .
    ln -s /path/to/fat32/profile/ImapMail .
    ln -s /path/to/fat32/profile/Mail .
    ln -s /path/to/fat32/profile/News .
    ln -s /path/to/fat32/profile/*.* .

    3. Create a extensions directory

    You should be ready to roll.

    Incidently, what is the purpose of the perion (.) at the end of each symbolic link command?

  12. FrankieBegbie Says:

    Ben - the period (.) means “current directory”

    e.g.

    ln -s /path/to/some/folder .

    ..would mean (in a more English-y way) “create a symbolic link from /path/to/some/folder in the currect directory”

  13. RainbowWarrior Says:

    This has been a good tutorial, thanks. Has anyone found more info on extensions? I have two Firefox extensions that keep data which I would like to share. One is StumbleUpon, which I think will work by sharing the stumble* files in the profile directory with a symlink. I guess I’ll have to test that and report back.

    The other one is Session Saver. Session Saver is awesome… a must-have extension. It would totally rock if I could have the saved session come back up regardless of which OS I’ve booted into. But I don’t know where the session data is saved.

  14. Kieran Says:

    An excellent, concise tutorial. This is (almost) exactly the method which I use. One issue that I would raise is that Firefox version 1.0.4(+) doesn’t appear to have the browser.bookmarks.file variable, however, as Jeff pointed out, it’s simple enough to link the bookmarks.html and bookmarks.bak to the shared profile folder.

    As a final word, I’d just like to point out that there is a linux kernel driver available, which would save many users the need to share their profiles on a fat32 partition and, instead, access the winodws profile directly*.

    * Of course, you would have to set the permissions to allow this.

  15. tired Says:

    you can edit profiles.ini directly instead of invoking “-p”

  16. Ben Says:

    WARNING: When following step 10:
    Enter about:config into the URL bar. Scroll down to the line that starts “browser.bookmarks.file”. Double-click it and enter /u/username/Application Data/Mozilla/Firefox/Profiles/default.nbl/bookmarks.html into the dialog box.

    Make a backup of your bookmarks file first!! Firefox decided to overwrite mine! Fortunately I have a paranoid backup strategy.

  17. b9b9b9 Says:

    Take care that “ln -s /path/to/fat32/profile/*.* .” means that a link is created also against prefs.js in the FAT32 partition
    This can be dangerous as in the winzoz file there are winzoz path names!!!

  18. FredFrin Says:

    1. Does this really work with Thunderbird? I tried doing the same thing with XP Pro & Suse Linux 9.3 some time ago, and recall there was some mail folder corruption after downloading mail via Linux. I thought at the time this was due to different Win/Linux line endings. Can anyone confirm this does not happen?

    2. Just tried re-locating my firfox profile & noted if the original was deleted (incl files), firefox would hang after start (no menus avail, no default page). It works if the extensions folder can be found in the original location. I guess something’s referring to that location in the settings with absolute path, have not found where yet. I use Adblock & TabMix etns only. I guess I should un- & re-install the extns …

  19. gregor Says:

    1. on my system (win xp / ubuntu) thunderbird works fine - i haven’t testet firefox yet. i only share my mailboxes, adressbooks and the calendar files from the calendar extension. i wouldn’t share the whole profile, as noted above there are some issues with win/linux filepaths. an by the way enigmail is a single platform extension.

    be careful with the hibernation while running thunderbird. sounds logical but i forgot an had some hassle to fix a corrupted mailbox. i solved it using the compact option from thunderbird.

  20. David Says:

    A word of caution: if you already have a working profile set up on u:\, DON’T delete it. I did this and now wish I hadn’t, because the new profile doesn’t get my old settings and I can’t get the old profile back. ARGGH.
    I did this because I made a new directory (Old: G:\Thunderbird New: G:\Apps\Thunderbird) and needed a new profile. But the new profile does three things to me: first, it failed to get my old mail, which I solved by adjusting the local folders directory in the account settings; second, the skin I used is gone (I’ll figure that out soon) and third, most disturbingly, a pop-up now appears requesting a Software Security password. I don’t recall setting one when I first installed, so I’m at a loss on this.
    OK. Well, if anyone has a suggestion about the Security thing, I’d love to hear it. Thanks.

  21. David Says:

    Fixed it all. Starting with #3: http://kb.mozillazine.org/Master_password gave me the information I needed to reset the password. While I was at it, I changed the Firefox as well. #2 - I pulled down Tools->Theme->Install->(directory holding theme)->Open #1 - see above.

  22. benlisp Says:

    I tried this with SuSE 9.3. First it worked fine, but after performing an online update Thunderbird 1.0.8 was installed and then it stopped working: On startup it claims that the
    profile is in use.

    Moving the profile back to a Unix filesystem the Thunderbird again can be started and the following link is created in vslqp3iw.default:

    lrwxrwxrwx 1 benni users
    16 2006-05-14 17:25 lock -> 127.0.0.1:+21623

    I suspect that creating such a link in a FAT32 system fails and then Thunderbird assumes that the profile is in use.

    After removing Thunderbird and reinstalling it from the original
    SuSE 9.3 distribution it works again.

  23. pierre MacKay Says:

    I have been tryinbg to do this dual OS thing, starting from a solid Linux installation, but I am stuck because I cannot find anything named profiles.ini either in my own Documents and Settings folder (XP) or in \Program Files\Mozilla Firefox\ I upgraded to Firefox 1.5, and the install log files look
    fine. I even set the search for a total scan for the text string Relative, but nothing came up. THe log says that no components were corrupted.

    How do I get my XP Firfox and Thunderbird to look for the shared stuff on my shared Fat-32 partition, and is there any problem with the Linux “12″ line-end as being different from the XP “1512″ line-end?

    Many thanks

    Pierre MacKay

Leave a Reply