VirtualBox RockyLinux

After installing Rocky Linux 8 on VirtualBox, It could be observed that the screen resolution not coming as expected. Even after selecting the resolution from the display settings, the issue resumes post-reboot.

On my setup, the screen resolution should have been (1920 x 1080) after the restart but by default, it selects (800 x 600).

In order to fix this issue, you will have to couple of steps where you have to install a few packages and run one script. Open the terminal to install kernel sources, headers, and other required packages.

sudo dnf install kernel-devel kernel-headers make gcc perl 

Once you install the above packages then insert the guest additions on the virtual machine by selecting the device menu option. If it inserts then it should try to run the script automatically. If it fails to do so then follow the next steps.


If it mounts successfully, then VirtualBox Guest Additions should be available in the mounted path. It should be /run/media/<user>/ path. You can verify using the mount command in the terminal. You may see error while mounting explained at the end.(#VERR_PDM_MEDIA_LOCKED)


Jump to the directory where Guest Addition is mounted.

cd /run/media/<user>/VBox_GAs_<VirtulBox Version>

Then run the script VBoxLinuxAdditions.run

sudo ./VBoxLinuxAdditions.run

If the script runs successfully and you reboot your system it should come with proper screen resolution.


You may see the error like could not mount the media or VERR_PDM_MEDIA_LOCKED. This might be happening if Guest Additions are already mounted. In that case, simply follow the steps without mounting the Guest Additions. just verify with the mount command whether it is mounted in /run/media/<user> path.

could not mount the media/drive VERR_PDM_MEDIA_LOCKED

Spread the love

Rohit

I am a software developer by profession. I love coding and learning new skills.

One thought on “How to Fix the Screen Resolution issue on VirtualBox for Rocky Linux8?

Leave a Reply

Your email address will not be published. Required fields are marked *