Setup RHEL VM on KVM and add to DNS

Setting up a RHEL VM in KVM

Spinning up a RHEL VM on KVM is a straight forward process.  I use this in my lab to build up numerous Red Hat servers for different RHCE labs that I need to run through during my studies.  My IDM server has a DNS server running, so adding an A record of the newly created VM allows me to connect to the servers by hostname rather than IP.  The below video shows the entire process step by step.  The steps are also printed out below the video for your convenience.

virt-manager
  • Choose New VM
  • Local install media ISO
  • Use ISO Image (select location)
  • We will use 1 GB of RAM and 1 CPU
  • Increase the drive space from 9 GiB to 30 GiB
  • Change the server name to server3
  • Leave the network as the default bridge network that we set up earlier
  • Choose install Red Hat Enterprise Linux 7.4

Installing RHEL 7.4

  • Choose English for the language
  • Choose Mountain Time Zone
  • Choose Infrastructure Server under Software Selection
  • Installation Destination, leave it set for automatically configure partitioning
  • Choose Network & Hostnames
  • Turn on the NIC, verify that the server gets an IP address
  • Change the hostname, I set mine to server3.den.therootuser.com
  • Begin installation

Registering the Server

subscription-manager register
subscription-manager list --available --all
subscription-manager attach --pool {poolid}
yum update

If you do this install with CentOS you won’t need to use subscription-manager, and you can go straight into using yum update.  If you want to use RHEL and don’t have a subscription Red Hat offers free developer subscriptions (non-production) that you can obtain.

Adding A record to DNS server

  • Login to IDM server (https://rhellab.den.therootuser.com) – Default username is admin
  • Choose Network Services
  • Choose DNS / DNS Zones
  • click on the zone name (den.therootuser.com)
  • Click Add
  • Record Name: server3
  • Record Type: A
  • IP address: 192.168.1.148
  • Click Add

Test A record with ping

ping server3
ssh server3

Wrap up

The server is now up and running and part of DNS.  If you have any questions, please feel free to leave me a comment and I will do my best to answer your questions.  I hope you have enjoyed this article with the included video.

Cheers,

Ivan Windon – RHCSA

Share

Ivan Windon

Ivan Windon is a Site Reliability Engineer at IBM. Ivan is actively engaged in Cloud Technologies with AWS, Google, and Azure. Ivan has extensive experience with Linux and Windows administration, DNS, Networking, IDM, and Security. In his free time, he enjoys being with his wife and two children. The family enjoys hiking, and traveling when able. His favorite locations are Yosemite NPS, and San Francisco, California.

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.