Unattended Installation of RedHat Enterprise Linux 10.1 on VirtualBox
The following steps describe an unattended installation of RedHat Enterprise Linux 10.1 on VirtualBox. The host system in my case is Windows 10.
Table of Contents
General Preparations for new VM Installations
These steps have to be done once and can be used to install also other guest Operating Systems (e.g. Windows):
Add the path of vboxmanage to the Windows Path environment variable. For example with Win+r and then enter:
rundll32 sysdm.cpl,EditEnvironmentVariables
Add C:\Program Files\Oracle\VirtualBox to the User variable Path.
A directory c:\vms for the virtual machines on the host system should exist:
mkdir c:\vms
Preparation of the Linux guest installation
Download the RedHat Enterprise Linux 10.1 iso file from RedHat and place it in the folder c:\sw. The original RedHat iso file will be modified to include the Kickstart file. These steps need to be done only once on another RHEL 9 machine or another Oracle Linux 9.5 VM:
# install the lorax tool
dnf -y install lorax
# create the Kickstart file
cat >~/ks.cfg <<'EOF'
lang en_US
keyboard --xlayouts='de'
timezone Europe/Berlin
# root password: changeme
# the password hashes can be created with: openssl passwd -6
rootpw --iscrypted $2b$10$MvOC8eg0rIsuQQnXYrkslOXsvDOe8XLPd8YIgYoMvtGHySbP1nQCG
user --name=user1 --iscrypted --password=$2b$10$MvOC8eg0rIsuQQnXYrkslOXsvDOe8XLPd8YIgYoMvtGHySbP1nQCG
reboot
text
cdrom
bootloader --append="quiet crashkernel=1G-4G:192M,4G-64G:256M,64G:512M"
zerombr
clearpart --all --initlabel
autopart --type=plain --nohome
network --bootproto=dhcp --device=link --onboot=on
firstboot --disable
selinux --disabled
firewall --disabled
%packages
@^graphical-server-environment
kernel-headers
kernel-devel
glibc-devel
glibc-headers
gcc
elfutils-libelf-devel
make
bzip2
perl
%end
%post --interpreter=/usr/bin/bash --log=/root/ks-post.log
# permit root login
sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
# install VirtualBox Guest Additions
df -h
mkdir -p /tmp/vboxcdrom
mount /dev/sr1 /tmp/vboxcdrom
/usr/bin/bash /tmp/vboxcdrom/VBoxLinuxAdditions.run
umount /tmp/vboxcdrom
rmdir /tmp/vboxcdrom
%end
EOF
# remove a previous custom iso image and create the new one
rm -f /sw/rhel_10.1_uefi_custom.iso
mkksiso --ks ~/ks.cfg -R "set default=\"1\"" "set default=\"0\"" -R "set timeout=60" "set timeout=5" /sw/rhel-10.1-x86_64-dvd.iso /sw/rhel_10.1_uefi_custom.iso
Sample Output (click to expand):
[root@lin1 ~]# # install the lorax tool
[root@lin1 ~]# dnf -y install lorax
Last metadata expiration check: 0:44:08 ago on Tue 21 Apr 2026 09:16:20 PM CEST.
Package lorax-34.9.29-1.0.1.el9.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@lin1 ~]#
[root@lin1 ~]# # create the Kickstart file
[root@lin1 ~]# cat >~/ks.cfg <<'EOF'
> lang en_US
> keyboard --xlayouts='de'
> timezone Europe/Berlin
> # root password: changeme
> # the password hashes can be created with: openssl passwd -6
> rootpw --iscrypted $2b$10$MvOC8eg0rIsuQQnXYrkslOXsvDOe8XLPd8YIgYoMvtGHySbP1nQCG
> user --name=user1 --iscrypted --password=$2b$10$MvOC8eg0rIsuQQnXYrkslOXsvDOe8XLPd8YIgYoMvtGHySbP1nQCG
> reboot
> text
> cdrom
> bootloader --append="quiet crashkernel=1G-4G:192M,4G-64G:256M,64G:512M"
> zerombr
> clearpart --all --initlabel
> autopart --type=plain --nohome
> network --bootproto=dhcp
> firstboot --disable
> selinux --disabled
> firewall --disabled
> %packages
> @^graphical-server-environment
> kernel-headers
> kernel-devel
> glibc-devel
> glibc-headers
> gcc
> elfutils-libelf-devel
> make
> bzip2
> perl
> %end
> %post --interpreter=/usr/bin/bash --log=/root/ks-post.log
> # permit root login
> sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
> # install VirtualBox Guest Additions
> df -h
> mkdir -p /tmp/vboxcdrom
> mount /dev/sr1 /tmp/vboxcdrom
> /usr/bin/bash /tmp/vboxcdrom/VBoxLinuxAdditions.run
> umount /tmp/vboxcdrom
> rmdir /tmp/vboxcdrom
> %end
> EOF
[root@lin1 ~]#
[root@lin1 ~]# # remove a previous custom iso image and create the new one
[root@lin1 ~]# rm -f /sw/rhel_10.1_uefi_custom.iso
[root@lin1 ~]# mkksiso --ks ~/ks.cfg -R "set default=\"1\"" "set default=\"0\"" -R "set timeout=60" "set timeout=5" /sw/rhel-10.1-x86_64-dvd.iso /sw/rhel_10.1_uefi_custom.iso
xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.
xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE : 5830 nodes read in 1 seconds
libisofs: NOTE : Found hidden El-Torito image for EFI.
libisofs: NOTE : EFI image start and size: 4958257 * 2048 , 17164 * 512
xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded
Drive current: -indev '/sw/rhel-10.1-x86_64-dvd.iso'
Drive access : shared:readonly
Media current: stdio file, overwriteable
Media status : is written , is appendable
Boot record : El Torito , MBR protective-msdos-label grub2-mbr cyl-align-off GPT
Media summary: 1 session, 4962564 data blocks, 9693m data, 623g free
Volume id : 'RHEL-10-1-BaseOS-x86_64'
xorriso : UPDATE : 1 files restored ( 1662b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/EFI/BOOT/grub.cfg'='/tmp/mkksiso-wpfztjmq/EFI/BOOT/grub.cfg'
xorriso : UPDATE : 1 files restored ( 1795b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/boot/grub2/grub.cfg'='/tmp/mkksiso-wpfztjmq/boot/grub2/grub.cfg'
xorriso : UPDATE : 1 files restored ( 59b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/.discinfo'='/tmp/mkksiso-wpfztjmq/.discinfo'
INFO:iso arch = x86_64
INFO:Volume Id = RHEL-10-1-BaseOS-x86_64
WARNING:No isolinux/isolinux.cfg file found
WARNING:No s390 config files found
xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.
xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE : 5830 nodes read in 1 seconds
libisofs: NOTE : Found hidden El-Torito image for EFI.
libisofs: NOTE : EFI image start and size: 4958257 * 2048 , 17164 * 512
xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded
Drive current: -indev '/sw/rhel-10.1-x86_64-dvd.iso'
Drive access : shared:readonly
Media current: stdio file, overwriteable
Media status : is written , is appendable
Boot record : El Torito , MBR protective-msdos-label grub2-mbr cyl-align-off GPT
Media summary: 1 session, 4962564 data blocks, 9693m data, 623g free
Volume id : 'RHEL-10-1-BaseOS-x86_64'
xorriso : UPDATE : 7 files restored (8062.7k) in 1 seconds = 6.0xD
Extracted from ISO image: file '/EFI'='/tmp/mkksiso-c3r6_ufa/EFI'
xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.
xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE : 5830 nodes read in 1 seconds
libisofs: NOTE : Found hidden El-Torito image for EFI.
libisofs: NOTE : EFI image start and size: 4958257 * 2048 , 17164 * 512
xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded
Drive current: -indev '/sw/rhel-10.1-x86_64-dvd.iso'
Media current: stdio file, overwriteable
Media status : is written , is appendable
Boot record : El Torito , MBR protective-msdos-label grub2-mbr cyl-align-off GPT
Media summary: 1 session, 4962564 data blocks, 9693m data, 623g free
Volume id : 'RHEL-10-1-BaseOS-x86_64'
Drive current: -outdev '/sw/rhel_10.1_uefi_custom.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 623g free
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
xorriso : NOTE : Replayed 21 boot related commands
Updating '/tmp/mkksiso-wpfztjmq/EFI/BOOT/grub.cfg' to '/EFI/BOOT/grub.cfg'
xorriso : UPDATE : Added/overwrote '/EFI/BOOT/grub.cfg' (1906)
Differences detected and updated. (runtime 0.0 s)
Updating '/tmp/mkksiso-wpfztjmq/boot/grub2/grub.cfg' to '/boot/grub2/grub.cfg'
xorriso : UPDATE : Added/overwrote '/boot/grub2/grub.cfg' (2039)
Differences detected and updated. (runtime 0.0 s)
Updating '/tmp/mkksiso-wpfztjmq/.discinfo' to '/.discinfo'
xorriso : UPDATE : Adjusted attributes of '/.discinfo'
Differences detected and updated. (runtime 0.0 s)
xorriso : UPDATE : 1 files added in 1 seconds
Added to ISO image: file '/ks.cfg'='/root/ks.cfg'
xorriso : NOTE : Copying to System Area: 32768 bytes from file '--interval:imported_iso:0s-15s:zero_mbrpt,zero_gpt:/sw/rhel-10.1-x86_64-dvd.iso'
xorriso : UPDATE : Writing: 9376s 0.2% fifo 92% buf 50%
xorriso : UPDATE : Writing: 83776s 1.7% fifo 97% buf 50% 182.5xD
xorriso : UPDATE : Writing: 202016s 4.1% fifo 98% buf 50% 173.9xD
xorriso : UPDATE : Writing: 307568s 6.2% fifo 99% buf 50% 155.3xD
xorriso : UPDATE : Writing: 431504s 8.7% fifo 98% buf 50% 182.5xD
xorriso : UPDATE : Writing: 528608s 10.7% fifo 99% buf 50% 143.0xD
xorriso : UPDATE : Writing: 604960s 12.2% fifo 17% buf 50% 124.8xD
xorriso : UPDATE : Writing: 726528s 14.6% fifo 98% buf 50% 178.9xD
xorriso : UPDATE : Writing: 742400s 15.0% fifo 98% buf 50% 23.3xD
xorriso : UPDATE : Writing: 801264s 16.1% fifo 99% buf 50% 86.8xD
xorriso : UPDATE : Writing: 887808s 17.9% fifo 100% buf 50% 127.7xD
xorriso : UPDATE : Writing: 1003552s 20.2% fifo 98% buf 50% 171.0xD
xorriso : UPDATE : Writing: 1058560s 21.3% fifo 99% buf 50% 81.1xD
xorriso : UPDATE : Writing: 1144096s 23.1% fifo 98% buf 50% 126.2xD
xorriso : UPDATE : Writing: 1235840s 24.9% fifo 98% buf 50% 135.3xD
xorriso : UPDATE : Writing: 1275488s 25.7% fifo 100% buf 50% 58.4xD
xorriso : UPDATE : Writing: 1375008s 27.7% fifo 100% buf 50% 146.7xD
xorriso : UPDATE : Writing: 1466784s 29.6% fifo 99% buf 50% 135.3xD
xorriso : UPDATE : Writing: 1565888s 31.6% fifo 98% buf 50% 145.9xD
xorriso : UPDATE : Writing: 1623776s 32.7% fifo 98% buf 50% 85.1xD
xorriso : UPDATE : Writing: 1715536s 34.6% fifo 99% buf 50% 134.9xD
xorriso : UPDATE : Writing: 1789568s 36.1% fifo 98% buf 50% 109.0xD
xorriso : UPDATE : Writing: 1877776s 37.8% fifo 99% buf 50% 129.6xD
xorriso : UPDATE : Writing: 1968592s 39.7% fifo 98% buf 50% 133.7xD
xorriso : UPDATE : Writing: 2011582s 40.5% fifo 98% buf 50% 63.3xD
xorriso : UPDATE : Writing: 2084752s 42.0% fifo 99% buf 50% 107.7xD
xorriso : UPDATE : Writing: 2198368s 44.3% fifo 98% buf 50% 167.6xD
xorriso : UPDATE : Writing: 2247616s 45.3% fifo 98% buf 50% 72.4xD
xorriso : UPDATE : Writing: 2304960s 46.5% fifo 98% buf 50% 84.3xD
xorriso : UPDATE : Writing: 2391968s 48.2% fifo 98% buf 50% 128.2xD
xorriso : UPDATE : Writing: 2518656s 50.8% fifo 98% buf 50% 187.1xD
xorriso : UPDATE : Writing: 2588640s 52.2% fifo 100% buf 50% 114.6xD
xorriso : UPDATE : Writing: 2666576s 53.7% fifo 99% buf 50% 115.0xD
xorriso : UPDATE : Writing: 2778400s 56.0% fifo 98% buf 50% 165.1xD
xorriso : UPDATE : Writing: 2843040s 57.3% fifo 98% buf 50% 95.2xD
xorriso : UPDATE : Writing: 2926976s 59.0% fifo 98% buf 50% 123.9xD
xorriso : UPDATE : Writing: 3006848s 60.6% fifo 99% buf 50% 117.9xD
xorriso : UPDATE : Writing: 3112928s 62.7% fifo 98% buf 50% 156.6xD
xorriso : UPDATE : Writing: 3200256s 64.5% fifo 98% buf 50% 128.7xD
xorriso : UPDATE : Writing: 3274906s 66.0% fifo 98% buf 50% 110.1xD
xorriso : UPDATE : Writing: 3359456s 67.7% fifo 98% buf 50% 124.8xD
xorriso : UPDATE : Writing: 3450976s 69.5% fifo 97% buf 50% 135.0xD
xorriso : UPDATE : Writing: 3517904s 70.9% fifo 99% buf 50% 98.6xD
xorriso : UPDATE : Writing: 3594208s 72.4% fifo 99% buf 50% 112.4xD
xorriso : UPDATE : Writing: 3690336s 74.4% fifo 98% buf 50% 141.7xD
xorriso : UPDATE : Writing: 3793024s 76.4% fifo 98% buf 50% 151.6xD
xorriso : UPDATE : Writing: 3866160s 77.9% fifo 99% buf 50% 107.8xD
xorriso : UPDATE : Writing: 3939136s 79.4% fifo 98% buf 50% 107.5xD
xorriso : UPDATE : Writing: 4047200s 81.6% fifo 98% buf 50% 159.4xD
xorriso : UPDATE : Writing: 4113568s 82.9% fifo 100% buf 50% 97.7xD
xorriso : UPDATE : Writing: 4172864s 84.1% fifo 99% buf 50% 87.3xD
xorriso : UPDATE : Writing: 4243616s 85.5% fifo 98% buf 50% 104.2xD
xorriso : UPDATE : Writing: 4342880s 87.5% fifo 98% buf 50% 146.4xD
xorriso : UPDATE : Writing: 4417792s 89.0% fifo 99% buf 50% 110.4xD
xorriso : UPDATE : Writing: 4462512s 89.9% fifo 99% buf 50% 65.9xD
xorriso : UPDATE : Writing: 4533392s 91.4% fifo 99% buf 50% 104.5xD
xorriso : UPDATE : Writing: 4621888s 93.1% fifo 98% buf 50% 130.5xD
xorriso : UPDATE : Writing: 4676128s 94.2% fifo 99% buf 50% 79.9xD
xorriso : UPDATE : Writing: 4721344s 95.2% fifo 98% buf 50% 66.5xD
xorriso : UPDATE : Writing: 4795872s 96.7% fifo 98% buf 50% 109.5xD
xorriso : UPDATE : Writing: 4880144s 98.4% fifo 98% buf 50% 124.2xD
xorriso : UPDATE : Writing: 4928224s 99.3% fifo 87% buf 50% 70.7xD
ISO image produced: 4961833 sectors
Written to medium : 4962000 sectors at LBA 48
Writing to '/sw/rhel_10.1_uefi_custom.iso' completed successfully.
[root@lin1 ~]#
This step created a custom iso file (rhel_10.1_uefi_custom.iso) that can be used to perform the unattended installation. Remember this file needs to be created only once.
Unattended Installation of RHEL 10.1 on VirtualBox
Create the Virtual Machine and start the installation
Run these steps in a Windows command prompt to create the new VM and start the installation from the custom iso. You probably need to adjust the parameter –bridgeadapter1 to the name of your primary interface of the Windows host system (see the Output of this command: ipconfig /all|findstr /C:Description /C:IPv|findstr /V Virtual)
set "VHOST=" && set "MAC="
(set /p VHOST=Enter VM name ^(e.g. lin1^):
set /p MAC=Enter the MAC address of the VM if you would like to use a dedicated MAC address. Press Enter to let VirtualBox assign a random MAC:
call vboxmanage createvm --name %VHOST% --ostype RedHat10_64 --register
call vboxmanage modifyvm %VHOST% --clipboard-mode=bidirectional --drag-and-drop=bidirectional --audio-controller=hda --audio-out=on
call vboxmanage modifyvm %VHOST% --memory=8192 --cpus=4 --vram=128 --graphicscontroller=vmsvga --usb-ehci=on --firmware efi
call vboxmanage setextradata %VHOST% GUI/ScaleFactor 2
call vboxmanage storagectl %VHOST% --name "IDE" --add ide
call vboxmanage storagectl %VHOST% --name "SATA" --add sata --bootable on
call vboxmanage createmedium disk --filename c:\vms\%VHOST%\%VHOST%_1.vdi --size 512000 --variant Standard
call vboxmanage storageattach %VHOST% --storagectl "SATA" --port 0 --device 0 --type hdd --medium c:\vms\%VHOST%\%VHOST%_1.vdi
call vboxmanage storageattach %VHOST% --storagectl "IDE" --port 0 --device 0 --type dvddrive --medium c:\sw\rhel_10.1_uefi_custom.iso
call vboxmanage storageattach %VHOST% --storagectl "IDE" --port 0 --device 1 --type dvddrive --medium "C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso"
call vboxmanage modifyvm %VHOST% --nic1 bridged --bridgeadapter1 "Intel(R) Ethernet Connection (2) I219-LM"
if defined MAC call vboxmanage modifyvm %VHOST% --mac-address1=%MAC%
call vboxmanage sharedfolder add %VHOST% --name=sw --hostpath=c:\sw --automount --auto-mount-point=/sw
call vboxmanage showvminfo %VHOST%|findstr /C:"NIC 1"
call vboxmanage startvm %VHOST% --type=gui)
The second to last command shows the mac address that the VM will use. Add the IP/mac address to your local dns so that the new machine can retrieve the IP address you want to use for the VM.
Perform tasks after the unattended OS installation
The installation takes about 10 minutes. Now you are able to login to the system with the IP or hostname you specified in the DNS server (username: root password: changeme). If you would like to take advantage of the poor man’s RPM cache you could enable it now 🙂 Afterwards perform these steps:
# fix rcvboxadd
sed -i "/#test \! -f \"\$1\"/s/ #/ /" /sbin/rcvboxadd
bash -c "
# register the system with RedHat:
subscription-manager register
# update GPG keys
dnf -y update --nogpgcheck redhat-release redhat-gpg-keys
subscription-manager refresh
# install and update packages:
dnf -y update && dnf -y groupinstall 'Server with GUI' && dnf -y install libnsl bc binutils elfutils-libelf glibc glibc-devel ksh libaio libXrender libX11 libXau libXi libXtst libgcc libnsl libstdc++ libxcb libibverbs make smartmontools sysstat net-tools nfs-utils libstdc++-devel libaio-devel iotop kernel-devel-$(uname -r) sshpass expect telnet
# setup VirtualBox Guest Additions (this is needed to make the clipboard work)
/sbin/rcvboxadd setup
# Recompile VirtualBox Guest Additions kernel modules:
/sbin/rcvboxadd quicksetup all
# add user1 to the vboxsf group
usermod -G vboxsf -a user1
# disable screen lock for user root
gsettings set org.gnome.desktop.session idle-delay 0
# enable boot in GUI mode
systemctl set-default graphical.target
# set the /etc/hosts entry to: <ip> <fqdn> <hostname>
echo \"$(host `hostname`|awk {'print $4" "$1'})\" \"$(hostname|awk -F. {'print $1'})\" >> /etc/hosts
# adjust /etc/hostname
hostname > /etc/hostname
# disable the Gnome Welcome screen for all users
echo 'X-GNOME-Autostart-enabled=false' >> /etc/xdg/autostart/gnome-initial-setup-first-login.desktop
# disable the screen idle delay (disables the lock screen) for all gnome users
cat << EOF > /etc/dconf/db/local.d/01-session
# dconf path
[org/gnome/desktop/session]
# settings
idle-delay=uint32 0
EOF
dconf update
# disable the boot splash screen (plymouth)
grubby --update-kernel=ALL --remove-args=rhgb
# lower the grub timeout from 5 seconds to 2
sed -i s/GRUB_TIMEOUT=5/GRUB_TIMEOUT=2/g /etc/default/grub
# set the resolution to 1024x768x32
grubby --update-kernel=ALL --args vga=836
# generate a grub config file
grub2-mkconfig -o /boot/grub2/grub.cfg
init 6"
Your new RedHat Enterprise Linux 10.1 VM is now ready to use! Have fun.
Further info
If you get errors like the following:
/tmp/vbox.0/vbox_drv.c:50:12: fatal error: drm/drm_aperture.h: No such file or directo
Take a look at this github issue, and make sure that you are running the latest version of VirtualBox.
Some useful Links:
Delete a Virtual Machine
To delete a VM follow these steps.
Updating VirtualBox Guest Additions
Follow these steps to update the Oracle VirtualBox Guest Additions

Leave a Reply