If you are using VirtualBox and want some additional features present in your guest VM (RHEL), then you will probably end up “trying” to install Guest Additions within your VM. (e.g Shared folders, viewing guest properties from the host)
In my case, I had a VM up and running fine, but was unable to get the IP address of the VM from my host using the following command. (Host = Windows 10)
- VBoxManage guestproperty enumerate <vm_name> | findstr IP
So after doing some research, I landed on a solution. Install Guest Additions for VirtualBox on my VM and I will be able to retrieve the VM property “/VirtualBox/GuestInfo/Net/0/V4/IP” !
Next step, install Guest Additions using the following link.
Unfortunately I encountered the following error….. Arrrgggg…
Unable to insert the virtual optical disk C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the machine CentOS. Would you like to try to force insertion of this disk? Count not mount the media/drive ‘C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso’ (VERR_PDM_MEDIA_LOCKED).
After some serious digging on the internet, I was able to finally find a solution.
- Before doing anything, you should install gcc kernel-devel bzip2 on the VM.
- yum install -y gcc kernel-devel bzip2
- Download the corresponding “VBoxGuestAdditions_<version>.iso” from the following link.
- With your VM turned off, remount the Optical Drive (cdrom) to the location of the new .iso file.
- Now mount the .iso location
- mount /dev/cdrom /mnt
- From within the /mnt folder, you can install Guest Additions using the following command. (May need to use sudo)
- Reboot the VM to start the Guest Addition service.
Note: If there are issues with the install, the output from the Guest Addition install will reference log files that will help you understand the issue.