One problem seems to be the samba4 postinst script is getting some values (realm, domain, netbios name, server role) from samba-common, and samba-common doesnt seem to use the values in smb.conf, particularly for domain.
My workaround is to
sudo apt-get install samba4-common-bin
then create replace the smb.conf file with a samba4 one, e.g. generated from a working samba4 installation, such as:
# Global parameters
[global]
server role = domain controller
workgroup = EXAMPLE
realm = example.com
netbios name = SERVER
[netlogon]
path = /var/lib/samba/sysvol/example.com/scripts
read only = No
[sysvol]
path = /var/lib/samba/sysvol
read only = No
Then run
sudo /var/lib/dpkg/info/samba-common.config
If you don't do the step above, then when samba4 installs, the postinst script attempts to provision the server, but debconf returns the domain as WORKGROUP instead of EXAMPLE and the provision fails - I don't know if this means the bug is in samba-common rather than samba4?
Then run
sudo apt-get install samba4
and it should all work correctly
One problem seems to be the samba4 postinst script is getting some values (realm, domain, netbios name, server role) from samba-common, and samba-common doesnt seem to use the values in smb.conf, particularly for domain.
My workaround is to
sudo apt-get install samba4-common-bin
then create replace the smb.conf file with a samba4 one, e.g. generated from a working samba4 installation, such as:
# Global parameters
[global]
server role = domain controller
workgroup = EXAMPLE
realm = example.com
netbios name = SERVER
[netlogon] samba/sysvol/ example. com/scripts
path = /var/lib/
read only = No
[sysvol] samba/sysvol
path = /var/lib/
read only = No
Then run dpkg/info/ samba-common. config
sudo /var/lib/
If you don't do the step above, then when samba4 installs, the postinst script attempts to provision the server, but debconf returns the domain as WORKGROUP instead of EXAMPLE and the provision fails - I don't know if this means the bug is in samba-common rather than samba4?
Then run
sudo apt-get install samba4
and it should all work correctly