CentOS 7 Install and AD Join
- Aman.K
- Sep 20, 2018
- 3 min read
Updated: Feb 2
Linux is an important platform that you will come across in your IT career. CentOS will be one used more frequently as it is free, easy to use and is up to enterprise grade. In this guide I will walk you through installing it, putting a GUI on, getting updates and joining it to your Windows Active Directory.
Getting the OS: https://www.centos.org/download/
The link above will take you to the official website where you can download the ISO. I would suggest getting the DVD ISO. Save and download it.
Setting up the VM
Throughout this guide, I will be using Hyper-V, but you can use VMWare and VirtualBox. In Hyper-V, go to the right-hand sidebar and click New, Virtual Machine.
- Enter in a name for the VM, e.g. CentOSVM
- Check store in a different location, and save the VM to where you want
- Click next with Generation 1 ticked
- Add the amount of RAM you want, I normally put in 2048 with dynamic memory enabled
- Select your network adapter
- Create a virtual hard disk and allocate the amount of space you want to give the OS. I normally put in 60GB
- Select Install an operating system from a bootable CD/DVD-ROM
- Select Image file (.iso) and navigate to where you saved the ISO image you downloaded
- Click Finish
- Right-click the VM in the manager and go to settings. If you want to add more virtual processors, you can do so now. I tend to give 2 Virtual processors to my VMs.
- Click OK
- Double click the VM to start it up
Installing CentOS 7
- The first thing you will see when you boot up the VM is what language would you like the installation process to be in. Select the language and press continue.
- Set up your local settings such as date and time. Once you're happy with those settings click begin installation.
- You will now see a blue progress bar at the bottom. You will also be able to set up a root password and create a user account. I highly recommend that you make an administrator account now and set up the root password as well.
- Once the installation is done, click quit. This will restart the VM.
CentOS 7 is now installed.
Putting a GUI on
CentOS 7 gets installed with a normal CLI. To install a GUI follow the instructions below. This is for the GNOME Desktop GUI. You can choose another GUI if you would like.
Once the VM has restarted after the install of CentOS 7, it will prompt you for a login. Use the login details you made while the installation was happening. It will then ask you for the password to that account. Once done you will now be in the OS.
Enter in the commands shown below to start the install of the GNOME Desktop
Sudo dhclient
Sudo yum -y groups install "GNOME Desktop"
Once the install is complete type in "Startx". This will now take you into the GUI.
Update the OS
With the GUI installed, you want to now update the OS. Restart the VM, login again at the CLI and enter in "Sudo Update". Let the updates download. It will prompt you for a Y/N, enter in Y. This will start installing them. Once done just do another restart.
Joining a domain/AD
Before you can join a domain, you need to install some things. Enter in the following:
Sudo yum install oddjob realmd samba samba-common oddjob-mkhomedir sssd adcli
Startx
The first command will install the relevant objects and the second command will take you into the GUI.
In the GUI, click the power button that is in the top right hand corner and click on wired connection. Go into the settings of the wired connections and enable "automatically connect". Restart the VM and log back in. Enter in "Realm Discover". This will show you the domains you can join. Enter in:
Sudo realm join --user (username of Domain admin) (Domain here)
Enter in the passwords that it prompts you for. If you get an error saying that the hostname is not set correctly, enter in:
Hostnamectl set-hostname (newhostname)
Hostname (make sure its set)
Re-enter the Sudo realm join command again and you should now see this VM in your AD computers list.
Comments