matt wilkie's picture

Work in progress. I'll continue to update this post for awhile.

Goal: A home Active Directory based environment from one physical machine.

With Samba 4, this means one server as Domain Controller and a second as File Server, with both of these hosted in an LXC container. Everything is behind a router and not directly exposed to internet.

[1] Download and create bootable USB or CD from Turnkey Linux Containers image.

Install it. Possibly need to fix network settings.

It lives at: http://lxc.home.lan/

[2] Install LXC Domain Controller:

Create default inithooks conf. Adjust values after the '=' as desired (i.e. set your own passwords, email, domains, etc).

# create default inithooks file
cat > /root/inithooks.conf <<EOF
export ROOT_PASS=secretrootpass
export DB_PASS=secretmysqlpass
export APP_PASS=secretadminwppass
export APP_EMAIL=admin@example.com
export APP_DOMAIN=www.example.com
export HUB_APIKEY=SKIP
export SEC_ALERTS=SKIP
export SEC_UPDATES=FORCE
EOF

Download and install Domain-Controller:

lxc-create \
  -n dc \
  -f /etc/lxc/bridged.conf \
  -t turnkey -- domain-controller

-n dc: what to name the machine, e.g. \\dc from a Windows workstation.

-f .../bridged.conf: use bridged network config, the DC will show up as a unique machine on the network, distinct from the LXC controller.

-t turnkey: tell LXC scripts to use the turnkey template

-- domain-controller: the name of the Turnkey app to download and install. Important: there is intentional whitespace between `--` and `domain-controller`

Start the domain controller:

lxc-start -n dc

It lives at: http://dc.home.lan/ and \\dc

[3] Install LXC Fileserver:

largely same as #2.

lxc-create \
  -n files \
  -f /etc/lxc/bridged.conf \
  -t turnkey -- fileserver

It lives at: http://files.home.lan/ and \\files

[4] Join Fileserver to domain.

Configure.

(I don't have this part working. Fileserver is joined to domain but user syncing etc. is not happening).

[5] Join windows workstation(s) to domain.

Install RSAT tools for easier domain administration, including user and group management. Some of the tools error out, but the important ones work.

[6] Live long and prosper.