Can’t Mount the Media/Drive in Virtual Box
The first step to solving a problem is to understand it. When attempting to insert the Guest Additions CD Image (in order to enable Shared Clipboard and Drag’n’Drop between my host PC and the Linux guest PC), I keep getting the following image:
I tried uninstalling and reinstalling both the virtual machine and Linux. Followed a series of guides online about disabling and then reactivating the drive to no effect.
I’m going to further look into the VERR_PDM_MEDIA_LOCKED issue and see if that is due to some sort of setting on my host computer
As an aside, I posted in the Slack Forum for Techworld With Nana. This was a last resort, because I first attempt to see if I can solve any technical/programming issues on my own. I was recommended the website NoloWiz to troubleshoot the issue:
The first attempt at troubleshooting involved manually removing the disk from the virtual drive, as follows from NoloWiz
- Open the VirtualBox VM settings.
- In the “Storage” panel select Controller: IDE -> Optical Drive.
- Right-click “Optical Drive” and from the popup menu click “Remove disk from virtual drive”.
- Finally, we can insert Guest Additions CD images without error.
Having tried the first possible solution with no success, I’m moving on to the second recommendation regarding errors while installing Virtual Box Guest Additions. This involves the use of the command line interface (CLI) to issue a series of commands.
We make a directory to mount the Guest Additions installation CD
Using sudo (the “safer” version of root directory) we make a directory, or folder, using the mkdir
command. Then we issue the -p
flag (I’m not sure what this flag is yet), then we create the destination for the creation of the folders mnt
and within mnt
the subdirectory cdrom
.
sudo mkdir -p /mnt/cdrom
Next we issue the mount
command to mount the CD:
sudo mount /dev/cdrom /mnt/cdrom
Subsequently, we run the Guest Additions installation software in the mount:
cd /mnt/cdrom sudo ./VBoxLinuxAdditions.run
Hmm…I at first thought that the aforementioned commands didn’t work as intended. I restarted the virtual machine and it does seem to work!
(I’m not sure if it doing it again fixed the issue. I think restarting the VM might have been the essential aspect here.)
I’ve come to find three things that generally seem to make up at least 50% of issues:
- Is the device plugged in?
- Is there a typo? (syntax, variable scope, etc)
- Did you restart your computer?
I think it’s always important to try and solve problems and challenges by yourself at first. But after trying several different resources to no avail, I had to ask someone in the Slack community for assistance — which is fine. Not asking for guidance when it’s required can be as inefficient as asking for it too often.