Deploying RHCSA home labs
Table of Contents
RHEL VMs guests on a Rocky Linux host with kvm#
#TBC
RHEL VM guests on a Windows host with VirtualBox#
Target is to build two RHEL VMs on in Virtualbox on a Windows machine.
Virtualbox must always be executed as administrator.
The installation of the extension pack might fail many times. What worked for me is patience and repetition, until I saw the green tick in the menu.
Shared clipboard and shared folder features will not work even if you activate them from the Virtualbox menu. What helped is to mount the VboxGuestAdditions.iso file from the GUI, check it in the shell terminal with lsblk, register the VM to Red Hat CDN with sudo subscription-manager register and provide my registration account details, reboot the machine, issue a dnf repolist to refresh the DNF repos, install the kernel headers with dnf install kernel-devel-$(uname -r) and reboot the VM again.
After that, I was able to move the cursor into and out of the VM window, and the globally shared directory is now visible on both the VirtualBox VM and the host machine.
Here is the result after I solved the issue with the Guest Additions:
user01@localhost:~$ sudo findmnt
[sudo] password for user01:
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/rhel-root xfs rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota
├─/dev devtmpfs devtmpfs rw,nosuid,seclabel,size=4096k,nr_inodes=213251,mode=755,inode64
│ ├─/dev/mqueue mqueue mqueue rw,nosuid,nodev,noexec,relatime,seclabel
│ ├─/dev/hugepages hugetlbfs hugetlbfs rw,nosuid,nodev,relatime,seclabel,pagesize=2M
│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev,seclabel,inode64
│ └─/dev/pts devpts devpts rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000
├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime,seclabel
│ ├─/sys/fs/selinux selinuxfs selinuxfs rw,nosuid,noexec,relatime
│ ├─/sys/kernel/tracing tracefs tracefs rw,nosuid,nodev,noexec,relatime,seclabel
│ ├─/sys/kernel/debug debugfs debugfs rw,nosuid,nodev,noexec,relatime,seclabel
│ ├─/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup cgroup2 cgroup2 rw,nosuid,nodev,noexec,relatime,seclabel,nsdelegate,memory_recursiveprot
│ ├─/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime,seclabel
│ ├─/sys/fs/bpf bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700
│ ├─/sys/kernel/config configfs configfs rw,nosuid,nodev,noexec,relatime
│ └─/sys/fs/fuse/connections fusectl fusectl rw,nosuid,nodev,noexec,relatime
├─/proc proc proc rw,nosuid,nodev,noexec,relatime
│ └─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=36,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=4952
├─/run tmpfs tmpfs rw,nosuid,nodev,seclabel,size=349244k,nr_inodes=819200,mode=755,inode64
│ ├─/run/user/1000 tmpfs tmpfs rw,nosuid,nodev,relatime,seclabel,size=174620k,nr_inodes=43655,mode=700,uid=1000,
│ │ ├─/run/user/1000/gvfs gvfsd-fuse fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000
│ │ └─/run/user/1000/doc portal fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=1000
│ ├─/run/credentials/systemd-journald.service
│ │ tmpfs tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,seclabel,size=1024k,nr_inodes=1024,mo
│ ├─/run/media/user01/VBox_GAs_7.2.20 /dev/sr0 iso9660 ro,nosuid,nodev,relatime,nojoliet,check=s,map=n,blocksize=2048,uid=1000,gid=1000,
│ └─/run/user/0 tmpfs tmpfs rw,nosuid,nodev,relatime,seclabel,size=174620k,nr_inodes=43655,mode=700,inode64
├─/boot /dev/sda2 xfs rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota
└─/mnt/shareddir sharedDir vboxsf rw,nodev,relatime,iocharset=utf8,uid=0,gid=978,dmode=0770,fmode=0770,tag=VBoxAuto
user01@localhost:~$
The filesystem used by VirtualBox to expose a common directory on both the host and guest machines is displayed as vboxsf and is mounted on /mnt/shareddir.
user01@localhost:~$ ls /mnt/shareddir/
ls: cannot open directory '/mnt/shareddir/': Permission denied
user01@localhost:~$ sudo ls /mnt/shareddir/
user01@localhost:~$
When I create a new file on the mount point path in the guest machine, I was able to find it in the host machine directory.
user01@localhost:~$ sudo touch /mnt/shareddir/test1
user01@localhost:~$ ls /mnt/shareddir/
ls: cannot open directory '/mnt/shareddir/': Permission denied
user01@localhost:~$ sudo ls /mnt/shareddir/
test1
user01@localhost:~$ ls -l /mnt/shareddir/
ls: cannot open directory '/mnt/shareddir/': Permission denied
user01@localhost:~$ sudo ls -l /mnt/shareddir/
total 1
-rwxrwx---. 1 root vboxsf 11 Oct 1 02:56 test1
user01@localhost:~$
Sometimes a VM hangs when booting. I found ways to handle the issue:
- when the boot menu is stuck at ‘Booting Red Hat Entprise Linux`, it is probably due to the VirtualBox Guest Additions ISO file. Press CTRL-C two times
- sending CTRL-ALT-DEL from the VM GUI. The exact path as of VirtualBox version 7.2.20 is Input -> Keyboard -> Insert Ctrl-Alt-Del
- sending a reset to the VM from the VM GUI. The exact path as of VirtualBox version 7.2.20 is Machine -> Reset
- restart VirtualBox with administrative privileges