AnsweredAssumed Answered

CIFS and Windows 2003 64 bit

Question asked by s_gilou on Jul 23, 2010
Latest reply on Aug 2, 2010 by mrogers
Hi everyone,

Since I've had a lot of trouble to configure CIFS on a Windows 2003 64 bit server, I thought I'd share the info.

I'm using Alfresco 3.3g prepackaged edition (with the 32bit java jre)

The most important documentation to READ (not browse like I did most of the times…) is the File Server Subsystem wiki page
http://wiki.alfresco.com/wiki/File_Server_Subsystem

I recommend you print it and read the CIFS and troubleshooting parts carefully.

After a default install, CIFS did not work.
In order to really know it does not work, activate the logs in log4j.properties like it says in the wiki page
log4j.logger.org.alfresco.smb.protocol=debug
log4j.logger.org.alfresco.fileserver=debug

and in your alfresco-global.properties put:
cifs.sessionDebug=NETBIOS, SOCKET
(this is also documented in the wiki)

I had installed the 3.3g on Windows XP and on a Windows 2003 32 bit servers and both seemed to work with the default configuration withouout changing anything.

But for 64 bit, in order to use the Java-based socket implementation, this is what I did:

- in the alfresco-global.properties file I added:
cifs.hostannouce=true
cifs.disableNIO=true
cifs.disableNativeCode=true

# CIFS session debug flags (also enable org.alfresco.fileserver=debug logging level)
# Comma delimeted list of levels :-
#    NETBIOS, STATE, RXDATA, TXDATA, DUMPDATA, NEGOTIATE, TREE, SEARCH, INFO, FILE, FILEIO, TRANSACT
#    ECHO, ERROR, IPC, LOCK, PKTTYPE, DCERPC, STATECACHE, TIMING, NOTIFY, STREAMS, SOCKET, PKTPOOL
#    PKTSTATS, THREADPOOL, BENCHMARK
#cifs.sessionDebug=NETBIOS, SOCKET

I also created a file C:\Alfresco\tomcat\shared\classes\alfresco\extension\subsystems\fileServers\default\default\custom-file-servers-context.xml
in which I added the keyword "windows" at 2 places like it says in the wiki, see the following content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING/DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>


   <bean id="cifsServerConfig" class="org.alfresco.filesys.config.CIFSConfigBean">
      <property name="serverEnabled">
         <value>${cifs.enabled}</value>
      </property>
      <property name="serverName">
         <value>${cifs.serverName}</value>
      </property>
      <property name="domainName">
         <value>${cifs.domain}</value>
      </property>
      <property name="serverComment">
         <value>Alfresco CIFS Server</value>
      </property>
      <!– Set to the broadcast mask for the subnet –>
      <property name="broadcastAddress">
         <value>${cifs.broadcast}</value>
      </property>
      <!– Set to the IP for the adapter for Java socket –>
      <property name="bindToAddress">
         <value>${cifs.bindto}</value>
      </property>
      <!– Use Java socket based NetBIOS over TCP/IP and native SMB on linux –>
      <property name="tcpipSMB">
         <bean class="org.alfresco.filesys.config.TcpipSMBConfigBean">
            <!–
               Can be mapped to non-privileged ports, then use firewall rules to forward requests from the standard
               ports
            –>
            <property name="port">
               <value>${cifs.tcpipSMB.port}</value>
            </property>
            <property name="platforms">
               <value>windows,linux,solaris,macosx</value>
            </property>
            <property name="ipv6Enabled">
               <value>${cifs.ipv6.enabled}</value>
            </property>
         </bean>
      </property>
      <property name="netBIOSSMB">
         <bean class="org.alfresco.filesys.config.NetBIOSSMBConfigBean">
            <property name="bindTo">
               <value>${cifs.bindto}</value>
            </property>
            <property name="sessionPort">
               <value>${cifs.netBIOSSMB.sessionPort}</value>
            </property>
            <property name="namePort">
               <value>${cifs.netBIOSSMB.namePort}</value>
            </property>
            <property name="datagramPort">
               <value>${cifs.netBIOSSMB.datagramPort}</value>
            </property>
            <property name="platforms">
               <value>windows,linux,solaris,macosx</value>
            </property>
         </bean>
      </property>

      <property name="hostAccouncerEnabled">
         <value>${cifs.hostannounce}</value>
      </property>
      <property name="hostAccounceInterval">
         <value>5</value>
      </property>

      <!– Use Win32 NetBIOS interface on Windows –>
      <property name="win32NetBIOS">
         <bean class="org.alfresco.filesys.config.Win32NetBIOSConfigBean" />
      </property>
      <property name="win32HostAnnouncerEnabled">
         <value>${cifs.hostannounce}</value>
      </property>
      <property name="win32HostAnnounceInterval">
         <value>5</value>
      </property>

      <!– CIFS authentication –>
      <property name="authenticator">
         <ref bean="CifsAuthenticator" />
      </property>

      <!– Disable the use of asynchronous sockets/NIO code –>
      <property name="disableNIO">
         <value>${cifs.disableNIO}</value>
      </property>

      <!– Disable the use of JNI code –>
      <!– Only currently affects Windows –>
      <property name="disableNativeCode">
         <value>${cifs.disableNativeCode}</value>
      </property>

      <!– Session timeout, in seconds –>
      <!– Defaults to 15 minutes, to match the default Windows client setting        –>
      <!– If no I/O is received within that time the session is closed by the server –>
      <property name="sessionTimeout">
         <value>${cifs.sessionTimeout}</value>
      </property>

      <!– Enable WINS if used for NetBIOS name lookups –>
      <property name="WINSConfig">
         <bean class="org.alfresco.filesys.config.WINSConfigBean">
            <property name="autoDetectEnabled">
               <value>${cifs.WINS.autoDetectEnabled}</value>
            </property>
            <property name="primary">
               <value>${cifs.WINS.primary}</value>
            </property>
            <property name="secondary">
               <value>${cifs.WINS.secondary}</value>
            </property>
         </bean>
      </property>

      <property name="sessionDebugFlags">
        <value>${cifs.sessionDebug}</value>
      </property>
   </bean>
</beans>

And finally, I modified the registry in 2 ways:
- I created
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters]
"SMBDeviceEnabled"=dword:00000000

- In [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters], I deleted the VALUE of the KEY "TransportBindName"

After a restart of the machine:
- I could not use the nbtstat command anymore from the server
- I can not mount a drive anymore from that machine, since the modification in the registry also deactivate the SMB client, so you CAN NOT test the CIFS drive locally!!! (that took me some time…)
- My server name was not recognized anymore by default on the network: I could not ping it by server name, but I could ping it by IP address. So for my tests, from my XP machine, I edited my hosts file and added a link betwwen the server name and the IP address. Later, I'll ask my admin to put something manually in the DNS
- The alfresco starting logs would show that the CIFS server was started
- From my Windows XP machine, I can do a nbtstat -A IP_ADDRESS and this will show SERVER_NAMEA
- From my Windows  XP machine, I can mount a disk to the alfresco server and use CIFS

I think this is it.

I hope, this can help

Gilles S

Outcomes