Howto build Samba4 on Ubuntu 12.04 LTS

Most Samba4 packages for Ubuntu are outdated or the imap_ad module is missing. So just compile it by yourself or download a precompiled archive including start scripts from here:

https://sourceforge.net/projects/samba4ubuntu/

Build Samba4

Install the build requirements:

Checkout the source:

Maybe you want to follow the testing branch which contains all patches for the next stable release. If so, you can just switch to it:

Now you can build samba4. By default the install target dir is /usr/local/samba.
If you want to change that add, for example --prefix=/opt/samba4 to the configure command.

In the source dir there is a backup script which I recommend to use. If you changed the prefix you must also change the paths in the script according to your installation.

Now you should archive your fresh installation for later reuse.

 Install Samba4 on a different host

Usually you don’t want to compile samba on the fileserver where it should run. So just copy your tar file from your compile host or from https://sourceforge.net/projects/samba4ubuntu/ to your target host.

Install the runtime requirements:

the filesystem tools:

for a domain member server you need kerberos:

Extract the archive:

Add this to your  .bashrc . The colon at the end of the second line is important:

Create symbolic links to important libraries and run ldconfig:

To use Samba4 acls, add the following mount options to your data filesystems user_xattr,acl . If you use xfs you can also add barrier=1 which ensures that tdb transactions are safe against unexpected power loss.

Now you are ready to configure samba4 either as a DC, backup DC or domain member server.

In short. A fresh domain controller is set up as follows:

For further information take a look at the samba wiki:

Schreibe einen Kommentar