Ubuntu Linux is a user-friendly, open-source operating system widely used in enterprise environments for servers, cloud infrastructure, and secure application deployment. Its long-term support releases and robust security features make it a top choice for IT teams.
In this lab, we will add an Ubunutu Linux machine to our virtual homelab. We will them explore some of its features like navigating the command line, analyzing filesystem hierarchy/permissions and keeping system up to date. At the end, we will add the Ubunutu VM to the Windows Domian we previously created.
- VirtualBox
- Ubuntu Linux
- Windows Server 2022
- Download Ubuntu from this link:(https://www.virtualbox.org/wiki/Downloads). Choose the version that matches the OS of your host computer.
2. On the main menu of VirtualBox, click New > Name the VM, Select the Linux ISO image, Check "Skip Unattended Installation" > Add 4096 MB of base memeory and 2 processors > Create a virtual hard disk that is 50 GB > Check configuartions and click "Finish".
3. The new VM will populate on VirtualBox. Click start. The bootloader will pop up and we will choose the first selection "Try or Install Ubuntu"
4. Once Ubuntu starts, it will take us through the final configurations. Choose your Lanuguage > Choose your Accessibility Settings > Select Keyboard Layout > Check "Use wired connection " > Select Interactive Installation > Default Selection for Applications > Install Third Party Software > Erase Disk and Install Ubuntu > Create usernmame and password > Select Timezone > Review Selections > Click Install.
5. Once the installtion in complete the VM will restart. Log in with your account and it is ready for use.
Navigating the Command Line
- We will go over basic commands for navigating through the command line.
"pwd" - print working directory
"ls" - list directory contents
"cd" - change directory
"mkdir" - make directory
"rmdir" - remove directory
"touch" + filename - create file
"cat" + filename - display contents of file
Connnecting to Domain
- In this portion of the lab we will be connecting the Ubunutu VM to the Windows Domain we previously created. First, we need to make sure our Ubunutu VM is in the same VNET as the Domain Controller. On VirtualBox, Click on Ubuntu VM > Setings > Network > Adapter > Choose same network DC is located in.
- Boot up the Domain Controller and Ubuntu VMs. Log on to DC > Open Command Line > Type command "Ipconfig" > Take note of IP address. Log onto Ubuntu VM > Open Terminal > Type "sudo su" for superuser ppriviledges > Type command "ping" + IP address of DC. The purpose of this to make sure the Linux machine can connect to the Windwos machine.
- We need to point the Ubuntu VM to the DC by changing some network settings. On the Ubuntu VM, click icon on bottom left corner > Type Advanced Networking > Click Wired Connection 1 > CLick IPv4 Settings. In the box next to "Additional DNS servers" type the IP address of the DC because it is hosting DNS.
- To ensure Network configuartions have been changed and updated, type the command show below.
- Now we need to install packges required to facilitate domain discovery, authentication and user management. This will allow us to join Windows Domain from Ubunutu machine. Type the command shown below.
- Next, we will chnage hostname of machine to reflect the domain we are trying to join. We will name the machine to "ubuntu" followed by your domain name. Exmaple shown below.
- The next command is used to disable systemd resolve service which acts a local DNS resolver. Instead we want our Windows Machine to act as our DNS server.
- Now we are going to tell our Ubunutu where we are going to resolve by editing the resolv.conf file. In terminal type "nano etc/resolv.conf" > Navigate to bottom of fle > Change "namesever" to the IP address of your Windows Machine and Chnage "search" to the name of your domain.
- We will use one of the packages we installed to discover our domain. Type "realm discover" + domain name
- Before we join the domain, I will show that the Ubunutu machine is not currently in the domain. On the WIndows machine, naviagte tu Server Manager > Tools > Active Directory Users and Computers > Computers
- FInally, we will join the domain using an account with administrative priviledges so we don't get any permission issues. Type "realm join -U" + username + domain name. Type in password. If no errors, we have sucessfully join the Ubunut machine to domain.
- We can verify that the Ubunntu VM has been added by checking the same location in the previous step.
