Cross Compiling Samba

Download the source and uncompress:

tar -xzf samba-3.6.23.tar.gz

And cross compile for ARM:

cd samba-3.6.23/source3
./configure --without-krb5 --without-ldap --without-ads \
  --disable-cups --enable-swat=no --with-winbind=no \
  --target=arm-linux-gnueabi --host=arm-linux-gnueabi \
  --prefix= --with-configdir=/etc \
  samba_cv_CC_NEGATIVE_ENUM_VALUES=yes \    
  libreplace_cv_HAVE_GETADDRINFO=no \
make install DESTDIR=/home/export/rootfs

Creating smb.conf

Create a Samba configuration file (smb.conf) and place it in /etc. Below is a minimal example configuration, sharing the home directories located in /home.

workgroup = WORKGROUP
netbios name = SAMBA_FS
path = /home
writable = yes
comment = Home Directories

Starting Samba

Samba can be started using the following. smbd is the main Samba3 daemon and handles the SMB protocol. nmbd provides NetBIOS name server support.

/sbin/smbd -D
/sbin/nmbd -D

Creating users

You can add new Samba users using

smbpassword -a <username>

To be successful, there must be an entry in /etc/passwd corresponding to the user.

Notes on minimal systems

If smbd or nmbd reports smbd: error while loading shared libraries: cannot open shared object file: No such file or directory, then you are missing the GCC low-level runtime library. You can copy it from your arm-linux-gnueabi cross compiler:

cp /usr/arm-linux-gnueabi/lib/ /home/export/rootfs/lib

If smbd fails to start, check the logs in /var/log.smbd. If smbd fails to daemonise and there is no error message, potentially you have a user account problem. If you don't have a /etc/passwd file, create one with a root and nobody user:


Download pre-built binaries

The link below contains a bzip2 tarball of Samba compiled for ARM: