Fixing Roaming Profiles in Samba

As I noted ear­lier, there are prob­lems with Windows’ roam­ing pro­files in Samba. To be more accu­rate, there are prob­lems with Windows’ roam­ing pro­files in gen­eral, but most peo­ple don’t bother enabling them until they migrate to samba. It appears as though they were designed to be oper­ated with an inter­mit­tant high-speed link, where it syn­chro­nizes your data (reg­istry, set­tings, Desktop folder, Start Menu, IE cookies/history/etc., along with all your actual data, includ­ing “My Documents,” and it’s chil­dren, “My Pictures” and “My Music”) when you login, and again when you log out. In prac­tice, this syn­chro­niza­tion means log­ging in takes about a minute, and log­ging out (depend­ing on how much stuff you’ve done) takes another minute or two — and it’s totally unac­cept­able to have your lab machines just sit on their hands for a minute while they unnec­es­sar­ily copy (lit­er­ally) hun­dreds of MB of crap they could just as eas­ily access directly from the samba share. For the Unix-heads around, imag­ine if net­worked home direc­to­ries worked by rsync’ing your home direc­tory to the client machine and then back again when you logged out — drag­ging your gig-or-so worth of set­tings, caches, and data both ways. Multiply that by a few dozen users and you fill up your client machines’ disks with a quickness.

So, after some googling, I found a cou­ple links describ­ing how to speed up this stuff by edit­ing the user’s reg­istries to point to the net­worked resources directly (which it won’t try to synchronize).

As an aside: the best gotcha I’ve ever seen is how Windows (evil bas­tard that it is) keeps your NTUSER.DAT reg­istry file on the pro­file share open after you’ve logged out. I fixed this by reboot­ing the Windows client box, though it’s prob­a­ble that killing the smbd process (smb­con­trol <pid-of-cxn-from-smbstatus> close-share) would do the job as well. It doesn’t appear as though it’s actu­ally doing any­thing with the file, just hold­ing it open.

After fid­dling around, login time for my user was back down to a rea­son­able 2 – 5 sec­onds (the time it takes to down­load and apply the NTUSER.DAT file). I also setup my boss’ pro­file the same way, since he actu­ally uses Windows for some­thing other than fix­ing it, and thus is in a bet­ter posi­tion to tell me if things go hor­ri­bly awry because of it.

4 Responses

  1. pel says:

    One thing to keep in mind when using roam­ing pro­files is that you should _make sure_ that the win­dows instal­la­tions the users fre­quent are almost iden­ti­cal. A few dif­fer­ences here and there will ulti­matly cor­rupt the users reg­istry and things start to go hor­ri­bly wrong.

    This is prob­a­bly some­thing you know — but it could be use­ful to know before the ensu­ing prob­lems gives you an ulsor… ;)

    I usu­ally recomend peo­ple not to use roam­ing pro­files and only set users home-directory to be cen­tral­ized. Sure, you have to add a few lines to your backup-script, but hey.. ulsors suck even more than extra work ;)

  2. Jimbob says:

    Yeah, the setups are already pretty homoge­nous thanks to Symantec Ghost and will soon be moreso thanks to Unattended (aside from the hilar­ity of “hit F12 at boot to re-install Windows”).

  3. Marco Barisione says:

    the best gotcha I’ve ever seen is how Windows (evil bas­tard that it is) keeps your NTUSER.DAT reg­istry file on the pro­file share open after you’ve logged out.

    Are you using Windows 2000? If a ser­vice holds a key open after the user logged out, then the reg­istry can­not be unloaded.

Leave a Reply

*