Wednesday, May 22, 2013

Windows 7 profile trouble

Event ID 1511: Windows cannot find the local profile and is logging you on with a temporary profile. Changes you make to this profile will be lost when you log off.

Or

Event ID 1521: Windows cannot locate the server copy of your roaming profile and is attempting to log you on with your local profile. Changes to the profile will not be copied to the server when you log off. This error may be caused by network problems or insufficient security rights.

  • Login as a different user (with admin rights)
  • Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList, find Keys named SID.bak (like "S-1-5-21-4129847285-3583514821-2567293568-1001.bak")
  • Delete them
  • If needed, delete C:\Users\USERNAME

This seems to happen when a machine on the network thinks it is the domain master browser and convinces the real PDC of it. I have seen it happen with a Mac (10.6.8), and with a new NAS. They were both running Samba (just like the actual PDC which is a Debian Samba server).

To prevent Samba on these machines to try to become domain master browsers, add this to the [global] section of /etc/smb.conf (or /etc/samba/smb.conf, or whatever it is on your machine):

os level = 1
lm announce = No
preferred master = No
local master = No
domain master = No

Maybe "os level = 1" is exaggerated, but I used that anyway. The "local master = no" setting doesn't get activated on the Mac (testparm -sv | grep master still shows it set to Yes), but it works anyway now.

To check the master browser from Linux or Mac: nmblookup -M YOURDOMAIN or nmblookup -M -- - for all, which may show others which are not in the same domain/workgroup.

Labels: , , , ,

Saturday, December 13, 2008

A propos d'antivirus

Hier soir, en passant sur un site web, j'ai attrapé un ou des virus/malware ou autre, et j'ai stupidement perdu des heures pour m'en débarrasser au lieu d'aller me coucher et de résoudre le problème en 10 minutes le lendemain.

Résumé des enseignements de la mésaventure:
  • Ne pas oublier que Linux permet de facilement effacer/renommer des fichiers que Windows ne peut pas. J'ai bêtement commencé par des recherches web qui menaient tous à des forums suggérant l'nstallation d'utilitaires comme MoveOnReboot ou autres. Outre que le programme a lamentablement échoué dans sa tâche, il y a l'absurdité d'installer un nouveau programme pour juste effacer quelques fichiers. De plus, comment savoir que celui-là est OK, parmi l'avalanche de pop-ups causés par l'infection (qui me proposent tous d'installer des pseudo-antivirus gratuits depuis leurs généreux sites web infestés de malware).
  • Ne pas oublier la recherche de fichiers par date et heure. Une fois qu'on a l'un des fichiers coupables, ça permet facilement de retrouver tous les autres. Total Commander a ça dans la page "Advanced" de sa fenêtre de recherche (Alt-F7).
  • Actuellement, parmi les antivirus gratuits que j'avais, Avira Antivir est celui qui a le mieux reconnu le problème (sans pouvoir le résoudre). Il est le plus énervant avec son pop-up géant et quotidien, mais au moins, il voit les virus. (Ceux qui ont été inutiles étaient Moon Antivirus qui ne voyait rien, ClamWin qui ne voyait pas grand chose et qui est d'une lenteur incroyable, et Avast qui ne voyait rien, peut-être parce qu'il ne met plus à jour ses définitions depuis 2-3 mois, parce que je n'ai pas renouvelé la clé d'enregistrement)
  • Au lieu de l'habituel Run (HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\), les virus actuels tendent à se cacher dans le mécanisme de Winlogon de Windows (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\).
  • StartupMonitor est vraiment indispensable. C'est lui qui m'a immédiatement fait réaliser qu'il y avait un problème. (Dommage que ni lui ni son compagnon StartupCPL n'incluent Notify dans les parties de "registry" qu'ils gèrent)
Bref, la procédure rapide et efficace est:
  1. Examiner Run et Notify pour identifier les suspects.
  2. Examiner les dates et heure de création des fichiers suspects pour identifier les vrais coupables, puis rechercher d'autres fichiers avec ces dates et heures.
  3. Démarrer Linux pour effacer ou renommer les coupables
  4. De retour dans Windows, nettoyer le registry.
Hélas, dans 6 mois ça ne suffira sans doute plus. Il y aura des virus plus malins...

Mise à jour: un ami me fait remarquer que les vendeurs d'antivirus proposent des CD bootables dont il y a un rapport de test ici (le meilleur semble être celui de Kaspersky pour le moment). Si on n'a pas déjà un LiveCD Linux comme Knoppix ou Ubuntu, ou si on ne sait pas exactement quels fichiers il faut effacer, c'est sûrement la solution la plus simple.

Labels: , , , ,

Saturday, April 26, 2008

System hive too large with 32 bit XP and 3GB switch

When using the /3GB switch with 32 bit Windows XP, you can easily hit a 12 (or 10.4?) MB limit for the system registry hive. This is the size of your C:\Windows\System32\config\SYSTEM file.

Symptoms include errors like Windows cannot start new hardware devices because the system hive is too large (exceeds the Registry Size Limit). (Code 49), and can get as bad as a STOP error when trying to boot the system with the /3GB switch.

To reduce the size of this registry hive, you can:

Run a registry optimizer like Lars Hederer's free NTREGOPT.

This will defragment the registry and save some space.

While there, also get his registry backup and restore program ERUNT ("Emergency Recovery Utility NT"). Run that regularly, and consider making him a donation for his fine utilties.

If that is not enough, you need to

Remove references in the registry to hardware you no longer use.

Usually, this is mostly external drives and USB flash drives which are no longer connected to the system. These can be removed automatically with the Veritas VxScrub program. Just run
Vxscrub -p
and reboot.

If you would like to also remove refenrences to unused printers, mice, keyboards and other stuff, you need to do it manually in the Device Manager, deleting devices one by one.

To make Device Manager display all the devices in the registry instead of only the currently connected devices, you need to run this in a command prompt window (or put both lines into a batch file which you could name ShowAllDevices.bat:
set DEVMGR_SHOW_DETAILS=1
set DEVMGR_SHOW_NONPRESENT_DEVICES=1
start devmgmt.msc
Then in Device Manager, you need to select View -> Show hidden devices. They will appear in a lighter color.

After deleting what you don't need, reboot and run NTREGOPT (which will have you reboot again).

A note about NTREGOPT:
It is not a very polite utility in a multitasking environment. It will tend to completely freeze your system, and it's progress bars are not very informative either (they only move when going from one registry hive to the next). The software and system hive optimization can easily take many minutes, during which you can do nothing on the system except watching a progress window which seems caught in an endless loop. Don't worry and be patient. The utility does work fine.

Labels: , , , ,