If you want to run a domain controller on your network but don’t have access to a Windows Server license, you can use SAMBA, the free open-source software, and VirtualBox, the free virtualization software. We’ll describe the procedure for setting up a virtual server using VirtualBox and netboot.xyz iPXE and move on to setting up your domain controller with SAMBA.

We’ll go through the steps required to set up a local domain controller (testdomain.com) on your workstation with SAMBA. We can then join that domain with a Windows workstation.

The following outline covers setting up such a lab and the individual steps to get your own free domain controller running. While there are a few limitations for a SAMBA domain, such as not being able to run multiple sub-domains or child domains (such as phoenix.testdomain.com and munich.testdomain.com), you can still use Windows administrative tools (like ADUC and DNS) to modify settings and user accounts.

Outline:

  1. Download and set up necessary software: VirtualBox and iPXE.
  2. Create a virtual machine, and install an Ubuntu server with the netboot.xyz iPXE bootable .iso.
  3. Configure the Ubuntu server with SAMBA prerequisites, and set up the domain controller.
  4. Join a Windows workstation to the new domain.

Download and install VirtualBox

VirtualBox is a lightweight hypervisor for setting up labs and running temporary virtual machines on a workstation-class computer. For this guide, we’ll use VirtualBox, but the same principles apply to Server 2012 Hyper-V or VMWare ESXi. Start by downloading VirtualBox from Oracle. If you’re using Windows 10 64-bit like myself, get the VirtualBox 5.0.14 for Windows hosts. When attempting to run the VirtualBox .exe installer, Windows 10 may want to protect you with SmartScreen. Click More info and then Run anyway:

Windows 10 SmartScreen more info

Windows 10 SmartScreen more info

Windows 10 SmartScreen run anyway

Windows 10 SmartScreen run anyway

Set up VirtualBox with all default options selected.

VirtualBox setup

VirtualBox setup

Be aware that VirtualBox will install a USB driver and temporarily disconnect network interface cards.

VirtualBox setup NIC reset

VirtualBox setup NIC reset

Download the netboot.xyz iPXE .iso

Next we’ll download my favorite new utility, netboot.xyz. For this exercise, download the image labeled netboot.xyz-dhcp-iso to your Downloads folder. Netboot.xyz is an iPXE image that can bootstrap any number of operating systems from the internet, which allows us to get a virtual machine up and running quickly.

Typical virtual server building methods will have you performing a time-consuming process, finding the correct .iso on a developer’s site, downloading the .iso, selecting the correct virtual disk, and then booting and setting up. iPXE is a small .iso (or bootable image) that gives you a menu to bootstrap a number of different operating system distributions and utilities. It provides a menu similar to a BIOS for installing or booting into a live operating system.

After selecting which operating system we want in netboot.xyz, it’ll connect to the internet, download the distribution files, and begin the setup. In our case, we’ll tell VirtualBox to create a new virtual machine and set the VM to boot to a virtual CD drive, which uses our netboot.xyz-dhcp-iso.

Create a virtual machine

Start by hitting the New button, name your domain controller server (DC1), and select Linux for the Type and Ubuntu 64 for the Version:

VirtualBox setup VM

VirtualBox setup VM

Click Next, provide the OS with the amount of memory you want to provision (1,024MB), click Next again, and select Create a virtual hard disk now. For virtual hard disk type, I like to use VHD so I can migrate the VM to Hyper-V if necessary.

VirtualBox Setup VHD

VirtualBox Setup VHD disk

Choose whether you want a dynamically allocated (recommended) or fixed disk size, select the size of the virtual hard disk (8GB), and the click Create. We now find our VM is setup but Off. Also notice that the IDE Secondary Master Optical Drive is Empty.

VirtualBox setup initial VM

VirtualBox setup initial VM

We want to use the netboot.xyz-dhcp-iso as our optical drive, so go into Settings. Select Storage and then Controller IDE: Empty. Then click the drop-down disk icon, and click Virtual Optical Disk File.

VirtualBox setup IDE select .ISO

VirtualBox setup IDE select .ISO

From here, we browse to our Downloads folder and select the netboot.xyz-dhcp.iso file. Click Open, and your VM will boot to the netboot.xyz iso.

VirtualBox setup IDE netboot .ISO

VirtualBox setup IDE netboot .ISO

In my next post, I’ll explain how to install Ubuntu in VirtualBox with the netboot.xyz iPXE .iso.

0 Comments

Leave a reply

Please enclose code in pre tags

Your email address will not be published.

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account