VirtualBox Red Hat Guest on Windows Host

“In the early days of the personal computer, there were many choices of operating system; today, there are many solutions available to choose from for a virtualization strategy.”

― Matthew Portnoy, Virtualization Essentials

Photo by Ricardo L on Unsplash

Recently at my job I have been dragged back re-entered the world of Red Hat Enterprise Linux. They do things different than in alternative operating systems like Debian, which is different from OpenBSD, and the variations continue in Slackware, which was my very first Linux flavor. Although I have used Red Hat before, it has been about 15 or so years since I have done so seriously and things have changed significantly. I’ll be installing RHEL version 8.6 inside a VirtualBox host machine running Windows 10. For this post I’ve taken inspiration from: https://developers.redhat.com/rhel8/install-rhel8-vbox

Snapshots

BEFORE you change something major in a VirtualBox virtual machine you should take a snapshot of it! This can avoid getting the VM into an unbootable state. It’s among the first things covered in the VirtualBox documentation.

A few videos that should help to get started:

https://www.youtube.com/watch?v=Kl-Qc6N9znw

https://onlinecomputertips.com/support-categories/software/775-virtualbox-snapshots/

RH Developer Subscription

(no cost)

Something that has changed since I last used Red Hat is if you want access to anything other than the most basic tools you will have to sign up for a subscription to the Red Hat Developer network. Fortunately, this doesn’t cost anything except your data, which you may or may not be concerned about. As for me, I figure FAANG already has all my data anyway so I am not bothered (well apparently I am bothered a little or I wouldn’t have mentioned it).

Sign up for a subscription here https://developers.redhat.com/products/rhel/download

After one year you will need to renew your subscription. Instructions are here https://developers.redhat.com/articles/renew-your-red-hat-developer-program-subscription

Machine Requirements

You will also need a machine that meets the following requirements:

Has VirtualBox installed.

A 64-bit x86 machine with hardware virtualization assistance (Intel VT-X or AMD-V). 

At least 4 GB of RAM.

At least 28 GB of available disk space for the VM and the .iso file.

Notes:

Hardware virtualization needs to be enabled in the BIOS/UEFI setup for your system.

On Windows it may be necessary to disable Hyper-V in order to avoid conflicts with VirtualBox.

Creating and installing the virtual machine is covered in detail in the following links. Note that the yum package manager has been replaced by dnf, so the two commands (yum or dnf) are interchangeable.

https://developers.redhat.com/rhel8/install-rhel8-vbox#create_the_vm

Note that the video memory may need to be increased to keep the mouse from bouncing around.

https://developers.redhat.com/rhel8/install-rhel8-vbox#installation

Pay attention to these instructions in particular!

Choose the Workstation base environment, add Development Tools, Graphical Administration Tools, and Container tools. Note: Do not select Server with a GUI.

Workstation in particular (not server with GUI) will be important when it comes time to install guest additions.

However I WOULD NOT disable kdump to save memory as that article suggests.

https://developers.redhat.com/rhel8/install-rhel8-vbox#system_registration

https://developers.redhat.com/rhel8/install-rhel8-vbox#install_updates

https://developers.redhat.com/rhel8/install-rhel8-vbox#virtualbox_guest_additions

Post Install

The following changes will require you to shut down the virtual machine.

Make clipboard bidirectional:

Up the CPU count:

Perhaps you’ll want to fiddle around with the other settings, but I’d strongly suggest creating a snapshot before changing ANY setting. Failure to do so will risk getting the VM into a state where it can’t be started again. Possible changes include: increasing main and/or video memory, enabling 3D acceleration, setting up shared folders, and many more.

More Packages:

Developers will almost certainly want to install the Extra Packages for Enterprise Linux. To do so enter:

sudo subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

at the terminal prompt. Isn’t it fun how Red Hat packages have gotten strewn all over the place in the past several years?

Install VS Code

Installing VS Code on Red Hat Linux just involves importing a key from Microsoft and then installing the code rpm package:

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'

dnf check-update

sudo dnf install code

Troubleshooting

I had a co-worker have problems with screen stutter -- having the virtual machine spit out multiple letters per keystroke. Seemed to mostly go away after he changed back to the default window size. It only stutters if he has too many tabs or windows open now. See here: https://forums.virtualbox.org/viewtopic.php?f=8&t=93272

Previous
Previous

Useful Utils

Next
Next

Rewriting History: git interactive rebase