For installing the VirtualBox Guest Additions, the relevant ISO file needs to be mounted. On clicking Devices –> Insert Guest Additions CD image, the following error is displayed.
Unable to insert the virtual optical disk /usr/share/virtualbox/VBoxGuestAdditions.iso into the machine <virtual-machine-name>.
Could not mount the media/drive '/usr/share/virtualbox/VBoxGuestAdditions.iso' (VERR_PDM_MEDIA_LOCKED).
The solution to the problem of accessing the VBoxGuestAdditions is to copy it from the host operating system to the virtual machine (VM). After copying, it can be mounted on the VM using the mount command. And, then, the script for installing the Guest Additions can be run. For example,
$ cd /tmp $ # Replace 192.168.1.11 with the IP address of the host operating system network interface $ rsync -avz 192.168.1.11:/usr/share/virtualbox/VBoxGuestAdditions.iso . $ sudo mkdir /media/VBoxGuestAdditions $ sudo mount -o loop /tmp/VBoxGuestAdditions.iso /media/VBoxGuestAdditions $ cd /media/VBoxGuestAdditions $ sudo ./VBoxLinuxAdditions.run ...