Before you begin
To follow the steps in this guide you will need:
- A no-cost Red Hat Developer subscription and the RHEL 8 Binary DVD .iso file. When you register and download through developers.redhat.com, a subscription will be automatically added to your account.
- Your Red Hat username and password. Your account was created during step one. You will need this to register the system attach it to your subscription. Completing these steps are required for your system to download software from Red Hat.
- A system that meets the following requirements:
- A 64-bit x86 machine with 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.
- Has VirtualBox installed.
- 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.
Create the VM
In VirtualBox, create a new VM with the following criteria::
- 2 GB of RAM at a minimum. 4 GB or larger is recommended.
- A 20 GB or larger virtual disk.
- 2 or more Virtual CPUs are recommended.
Configure the VM to boot from the RHEL 8 Binary DVD .iso file that you downloaded earlier. In the VM’s settings, under Storage, select the optical drive under the IDE controller. Then, use the CD icon drop down menu on the right to select Choose Virtual Optical Disk File.
Optional VM configuration:
The default networking choice NAT is the easiest to use, but you will not be able to access services such as ssh or http running on the RHEL VM from the host or the network. However, you can define port forwards in the Advanced section under the network adapter configuration to provide access.
For example, in order to use ssh, define a port forward from Host Port 2222 to Guest Port 22. This will allow you to use ssh on the host machine by using port 2222:
$ ssh -p 2222 [email protected]
Alternatively, you can attach the VM to directly network by sharing the network adapter from the host system as a bridged network adapter. In this configuration, the VM gets its own IP address, usually using your network’s DHCP server. The VM appears on the network the same way a physical computer would with its own hardware MAC address. The host’s network adapter is shared by a device driver that is installed by VirtualBox. The VM’s virtual network adapter can only be bridged to one physical network adapter at a time. If your system has more than one network adapter you need to choose which one to attach to. If your system switches between wired and wireless connections, you will need to switch the adapter that the VM is bridged to when changing between wired and wireless.
Improved Network Performance with virtio (Windows and Linux hosts only)
For improved VM network performance on Windows and Linux hosts, in the VM’s settings under Network Adapter Type select Paravirtualized Network (virtio-net). The paravirtualized adapter removes much of the overhead of emulating a hardware network adapter.
Copy and Paste
In the VM settings General, on the Advanced tab, set Shared clipboard and Drag’n’Drop to Bidirectional. Copy and paste requires VirtualBox Guest Additions to be installed. After the RHEL VM is fully installed and has been registered, you can install the kernel packages that are required to install VirtualBox Guest Additions.
Tip: to copy and paste before you have setup VirtualBox Guest Additions, use
ssh from a Terminal Window on the host. You'll be able to copy and paste text to and from the Terminal window.
VirtualBox Guest Additions
Adding VirtualBox Guest Additions to the RHEL VM improves the usability in a number of ways:
- Enables copy and paste between the host and VM.
- Eliminates the need for the VM to capture the mouse pointer. The integrated mouse pointer is much smoother.
- The VMs screen is dynamically resizable so you can have more space to edit.
- Folders can be easily shared between the host and the VM making it easy to share source code.
First, make sure you’ve installed the latest updates using the instructions above. During installation a kernel module will be compiled and installed. There are a few prerequisites. First you should have installed Development Tools during system installation. If not, use:
$ sudo yum groupinstall "Development Tools"
Next, install kernel development packages so you can build loadable kernel modules:
$ sudo yum install kernel-devel elfutils-libelf-devel
Now insert the VirtualBox Guest Additions CD image using the Devices menu entry on the VM’s window. A pop-up will ask you if you want to run the software on the CD image. Click Run.
A terminal window will pop-up as the guest additions are built and installed. When complete, hit enter to close the window.
Some of the improvements, such as the mouse pointer integration will be immediately available. Others improvements won't be available until after the VM is rebooted.