These instructions will walk you through building a virtual RHEL 10.x server and applying the DISA (Defense Information Systems Agency) STIG (Security Technical Implementation Guide). We will use OpenSCAP, an open-source tool designed for automated security auditing and compliance management based on the Security Content Automation Protocol (SCAP).
All this will be demonstrated using the KVM (Kernel-based Virtual Machine) hypervisor module and QEMU (Quick Emulator), a free open-source hypervisor and machine emulator, all running on a Debian based version of Linux. This article will show you how to get QEMU, KVM and virt-manager up and running.
Setting Up Virtual Machines with QEMU, KVM, and Virt-Manager on Debian/Ubuntu
You will need a bootable ISO file of RHEL 10.x which you can obtain by creating a free account on https://developers.redhat.com/ and downloading the latest x86_64 DVD ISO from :
https://developers.redhat.com/products/rhel/download#downloadsbyrelease.
In this example the ISO file will be saved in a folder named 'ISO' in the /opt directory on the host/hypervisor system.
The STIG requires separate disk partitions, or volumes, be created for different functional parts of the operating system. At a minimum this will insure that if a rouge process overloads the system with logging it will not fill up the root volume and crash the system, thus enabling you to still be able to login and fix the problem.
The Disk partitioning layout is presented here for virtual disk space requirements and will be referred back to later during the operating system (OS) install.
Recommended disk partition/volume sizes:
| Mount Point | Recommended Size | Minimum Size | Notes |
|---|---|---|---|
| /boot | 1G | 1G | Use '/boot' from Mount Point menu |
| /boot/efi | 1G | 512M | Use '/boot/efi' from Mount Point menu |
| / | 20G | 10G | Use '/' from Mount Point menu |
| /home | 20G | 5G | Use '/home' from Mount Point menu |
| /var | 20G | 8G | Use '/var' from Mount Point menu |
| Swap | 8G | 4G | Use 'swap' from Mount Point menu Up to 1/2 size of RAM |
| /tmp | 10G | 8G | Enter '/tmp' for the Mount Point |
| /var/tmp | 2G | 1G | Enter '/var/tmp' for the Mount Point |
| /var/log | 2G | 1G | Enter '/var/log' for the Mount Point |
| /var/log/audit | 2G | 1.5G | Enter '/var/log/audit' for the Mount Point |
| Total | 86G | 40G | disk space |
(Yes the swap sizes are overkill for the small test system presented here, but most of the production RHEL systems I manage have way more than 16G of RAM.)
Assuming you have KVM and QEMU installed and working correctly, let's get started.
To change things up we will use the qemu-img and virt-instal commands to create out virtual machine instead of doing it through the Virtual Machine manager GUI.
Formatting '/var/lib/libvirt/images/rhel10.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=92341796864 lazy_refcounts=off refcount_bits=16
image: /var/lib/libvirt/images/rhel10.qcow2
file format: qcow2
virtual size: 86 GiB (92341796864 bytes)
disk size: 196 KiB
cluster_size: 65536
Format specific information:
compat: 1.1
compression type: zlib
lazy refcounts: false
refcount bits: 16
corrupt: false
extended l2: false
Child node '/file':
filename: /var/lib/libvirt/images/rhel10.qcow2
protocol type: file
file length: 194 KiB (198144 bytes)
disk size: 196 KiB
--name rhel10 \
--vcpus 2 \
--ram 2048 \
--disk path=/var/lib/libvirt/images/rhel10.qcow2 \
--os-variant rhel10.0 \
--network network=default \
--boot uefi \
--cdrom /opt/ISO/rhel-10.2-x86_64-dvd.iso \
--graphics spice
☐ On the following screen select "English (United States)" and press the "Continue" button.
☐ Under "Storage Configuration" select the "Custom" option and click the "Done" button.
☐ Run the following commands to update/patch the system.
☐ Now that we can see what the IP address is, we should be able to ssh to the RHEL10 virtual server from the host/hypervisor. Open a local terminal window and try logging in using SSH with your admin account.
$ ssh admin@192.168.x.x (see ifconfig output for IP address)
# subscription-manager repos --enable codeready-builder-for-rhel-10-$(arch)-rpms
# curl -fsSL https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-10 -o /tmp/RPM-GPG-KEY-EPEL-10
# rpm --import /tmp/RPM-GPG-KEY-EPEL-10
# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
Extra Packages for Enterprise Linux 10 - x86_64 6.6 MB/s | 6.6 MB 00:01
Last metadata expiration check: 0:00:01 ago on Tue 01 Sep 2026 08:12:59 PM UTC.
Dependencies resolved.
====================================================================================================
Package Architecture Version Repository Size
====================================================================================================
Installing:
htop x86_64 3.3.0-5.el10_0 epel 196 k
Installing dependencies:
hwloc-libs x86_64 2.11.1-4.el10 rhel-10-for-x86_64-baseos-rpms 2.1 M
ocl-icd x86_64 2.3.2-8.el10 rhel-10-for-x86_64-baseos-rpms 69 k
Transaction Summary
====================================================================================================
Install 3 Packages
Total download size: 2.3 M
Installed size: 3.5 M
Is this ok [y/N]: y
☐ You might see an error after exiting htop, which can be easily fixed by creating
Can not save configuration to /root/.config/htop/htoprc: No such
# mkdir .config
# htop
#
logout
$ exit
logout
Connection to 192.168.122.166 closed.
No comments:
Post a Comment