Networking

How to deploy a Samba domain controller in under 10 minutes

If you need an inexpensive domain controller that doesn't take a lot of time to deploy, here's how to spin one up with the help of the TurnKey Linux Domain Controller appliance.

sambadchero.jpg
Image: Jack Wallen

Say you want to deploy an Active Directory-compatible domain controller that supports shares, printing services, centralized Netlogon authentication for Windows systems, but...you don't want to shell out the cash for a Windows Server license, or perhaps you'd rather stick with open source software. So, how is this possible? The answer is Samba and TurnKey Linux.

Since the release of Samba 4 (the software that had previously been thought of as a file/folder/printer sharing service), the open source tool can interact with Netlogon authentication for Windows machines, giving it the ability to stand in as a Windows Domain Controller. Thanks to TurnKey Linux, deploying such a machine has become incredibly easy.

TurnKey offers a virtual appliance, with everything you need to deploy that domain controller already installed. In less than 10 minutes, you can have the controller up and running and ready to be populated with users, shares, and more.

Let's walk through the process of getting your Samba 4-powered Domain Controller ready for work.

SEE: Linux 4.8 adds Pi, Surface support but Linus Torvalds fumes over 'kernel-killing' bug (ZDNet)

Importing the appliance

The first thing you must do is download the appliance from TurnKey Linux (this will be an .ova file). After that is downloaded, fire up VirtualBox and click File | Import Appliance. In the resulting window (Figure A), click the folder button, navigate to and select the downloaded .ova file, and then click Open.

Figure A

Figure A
Image: Jack Wallen
Importing the domain controller appliance into VirtualBox.

Click Next and review the settings. By default, the import will hand only 512 MB of RAM over to the appliance, so you might want to up that by double-clicking the RAM entry and giving it a bit of additional memory (Figure B).

Figure B

Figure B
Image: Jack Wallen
Upping the RAM from the default 512 MB.

Once the settings look good, click Import, and you're done.

Before you run the virtual machine, you will need to configure the networking. By default, the appliance will be set to NAT. In order for the appliance to exist on your network, you'll want to do the following:

  1. Select the TURNKEY DOMAIN CONTROLLER from the left pane.
  2. Click Settings.
  3. Click the Network tab.
  4. Select Bridged Adapter from the Attached To drop-down.
  5. Click OK.

Now your Domain Controller is ready for action.

Running and configuring the Domain Controller

It's time to fire up the virtual appliance. Select the TURNKEY DOMAIN CONTROLLER entry from the listing of available virtual machines (in the VirtualBox main window), and then click the Start button. During the first boot of the virtual machine, you will only have to configure four items:

  • The name of the realm to be used (Figure C)
  • The domain to be used
  • The password for the root user account
  • The password for the Samba administrator

Figure C

Figure C
Image: Jack Wallen
Configuring the realm for your domain controller.

Once you've set the Samba administrator password, you'll be asked if you want to initialize the TurnKey HUB services; tab down and select Skip (unless you want to take advantage of the TurnKey Backup and Migration services).

Next you'll be asked to enter an email address for system notification (this is for the TurnKey security alerts—it's not for domain controller notifications). You can tab down to skip this as well.

Finally, you'll be prompted to install the latest security fixes. Go ahead and run that by tabbing to Install and hitting Enter on your keyboard. This could take awhile depending on when you installed and how many updates are available, so head off and take care of some other task.

When the installation of the updates is finished, you'll be prompted to reboot. Once the reboot completes, you'll be presented with the various addresses to log into. The address you want to primarily use is for Webmin, which will be https://IP_OF_SERVER:12321. Log in with the username root and the password you set up during the initial configuration stage.

Your domain controller is ready to be configured to meet your network needs. The most important section to configure will be under Servers | Samba Windows File Sharing. In this section you'll want to click Windows Networking (Figure D) where you can set up Workgroup, WINS Mode, Server Name/Aliases, Default Service, Master Browser, Remote Announce To, and much more.

Figure D

Figure D
Configuring the Windows Networking Options.

A quick and easy domain controller

If you're looking for one of the fastest and cheapest ways to get a domain controller up and running, look no further than this virtual appliance by TurnKey Linux. Fire one up on a test network of virtual machines and see if you can't get it to serve exactly as you need.

Also see

About Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.

Editor's Picks

Free Newsletters, In your Inbox