{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiag4uxysvsycpxxaby3epb4do6jbqvfcsxqbrvcsf7jj5glbfhyhy",
"uri": "at://did:plc:ws6dhxzqnqxu5aqxt4kd27oc/app.bsky.feed.post/3mnef3724ap72"
},
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreiemyx7p3kbay7lxv4mpvjuprcco4dgexojpcsx56ivgquhxdkk7nm"
},
"mimeType": "image/webp",
"size": 60866
},
"description": "Eject the locked disc image, then mount Guest Additions inside the guest to clear the error for good.",
"path": "/fix-virtualbox-unable-to-insert-the-virtual-optical-disk-verr_pdm_media_locked/",
"publishedAt": "2026-06-03T05:32:49.000Z",
"site": "https://allthings.how",
"textContent": "The \"Unable to insert the virtual optical disk\" error shows up the moment VirtualBox tries to load an ISO into a virtual machine's CD/DVD drive but the drive already has something locked in it. The full message usually ends with `VERR_PDM_MEDIA_LOCKED`, and it almost always appears when you pick **Insert Guest Additions CD Image** while a disc is still mounted and held open by the guest operating system. It is a host-side state problem, not a damaged disc, so the fix is to release the lock and re-mount cleanly.\n\nā
\n\nQuick answer: Fully shut down the virtual machine, open Settings ā Storage, select the optical drive holding VBoxGuestAdditions.iso, click the small CD icon and choose Remove disk from virtual drive (Force Unmount if asked). Start the VM again and re-insert the image.\n\nThe error appears when the optical drive already holds a locked disc image.\n\n* * *\n\n### What VERR_PDM_MEDIA_LOCKED means\n\nThe error code is literal. The guest OS has locked the disc currently sitting in the virtual CD/DVD drive, so VirtualBox cannot swap in a new image on top of it. This frequently means the Guest Additions ISO is already loaded, or the same ISO is attached to another running virtual machine. The disc inside the guest is fine. The drive just will not accept a second image until the first one is released.\n\nBecause the lock lives on the host's view of the drive, forcing the guest to \"auto-mount\" or clicking **Force Mount** inside the guest does not resolve it. You have to clear the drive first.\n\n* * *\n\n### Method 1: Eject the locked disc from the optical drive\n\nThis is the fastest fix and works on Windows, Linux, and macOS hosts.\n\n**Step 1:** Shut the virtual machine down completely. Use a normal shutdown from inside the guest OS rather than a saved state. If a VM is in a saved state, start it and then shut it down properly.\n\n**Step 2:** In the VirtualBox Manager, right-click the virtual machine and open **Settings** , then go to the **Storage** tab.\n\n**Step 3:** Under **Controller: IDE** , select the optical drive that holds the Guest Additions disc. Click the small CD icon in the attributes area and choose **Remove disk from virtual drive**. If that option is greyed out, choose **Remove Attachment** instead.\n\n**Step 4:** If VirtualBox asks, click **Force Unmount**. Save the settings, start the VM, and insert the Guest Additions image again from the **Devices** menu.\n\nš”\n\nIf the same ISO is attached to a second virtual machine, remove it there too. An image held open by another VM will keep triggering the lock.\n\n* * *\n\n### Method 2: Clear the disc from Virtual Media Manager\n\nWhen the optical drive in Storage looks empty but the error persists, the image may still be registered globally.\n\n**Step 1:** Shut down every open virtual machine. Any VM in a saved state should be started and then shut down so nothing keeps the media reserved.\n\n**Step 2:** Open **File ā Virtual Media Manager** in the VirtualBox Manager.\n\n**Step 3:** Look for `VBoxGuestAdditions.iso` in the optical disks list. If it is checked or attached, release it. Removing it here detaches the registration that keeps the drive locked.\n\n**Step 4:** Reboot the virtual machine and try inserting the image again. The drive should now accept it.\n\n* * *\n\n### Method 3: The VM has no optical drive at all\n\nA slightly different message, \"machine has no optical drives,\" means the VM was created without a CD/DVD device. You cannot attach an ISO as a drive. The drive is the hardware; the ISO is the removable media that goes inside it.\n\n**Step 1:** Shut down the virtual machine and open **Settings ā Storage**.\n\n**Step 2:** Next to the controller entry, click the disk icon with the green plus that adds an optical drive. When prompted, choose **Leave empty**.\n\n**Step 3:** Start the VM, open the **Devices** menu and select **Insert Guest Additions CD Image**. If the lock error returns at this point, fall back to Method 1 to eject and re-insert.\n\n* * *\n\n### Mount Guest Additions manually inside a Linux guest\n\nIf you only triggered the error while trying to install Guest Additions on a Linux guest, you can skip the swap entirely and mount the disc from inside the guest. After selecting **Insert Guest Additions CD Image** from the **Devices** menu, open a terminal in the guest.\n\n\n sudo mkdir -p /mnt/cdrom\n sudo mount /dev/cdrom /mnt/cdrom\n cd /mnt/cdrom\n sudo ./VBoxLinuxAdditions.run\n\n\nMount and run Guest Additions from the guest\n\nOn some systems the optical device shows up as `/dev/sr0` instead. In that case use `sudo mount /dev/sr0 /mnt/cdrom`. If the basic mount fails, add the loop option with `sudo mount -o loop /dev/cdrom /mnt/cdrom`.\n\nWhen you cannot mount it at all, copy the ISO into the guest and loop-mount the file directly. The image lives on the host at the path shown below.\n\n\n sudo mkdir /media/GuestAdditionsISO\n sudo mount -o loop path/to/VBoxGuestAdditions.iso /media/GuestAdditionsISO\n cd /media/GuestAdditionsISO\n sudo ./VBoxLinuxAdditions.run\n\n\nLoop-mount a copied ISO file\n\nA read-only warning during the mount is normal and does not stop the installer from running. You know the installation worked when the script finishes building kernel modules and tells you to reboot. After restarting, the guest display resizes with the host window, which is the clearest confirmation that Guest Additions loaded.\n\nš\n\nOn a Windows host the ISO is at C:\\Program Files\\Oracle\\VirtualBox\\VBoxGuestAdditions.iso. On macOS it sits inside /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso.\n\n* * *\n\n### Default ISO paths and device names by host\n\nHost / Guest| Path or device\n---|---\nWindows host ISO| C:\\Program Files\\Oracle\\VirtualBox\\VBoxGuestAdditions.iso\nmacOS host ISO| /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso\nLinux guest optical device| /dev/cdrom or /dev/sr0\nCommon mount points| /mnt/cdrom, /media/cdrom0, /media/VBOXADDITIONS_xxx\n\n* * *\n\n### Why the lock keeps coming back\n\nIf the error returns after a fix, only a few specific conditions are usually responsible. Work through them in order before retrying.\n\nā ļø\n\nThe disc image is attached to a second virtual machine that is still running. Detach it from that VM and use the Insert Guest Additions CD Image menu item rather than wiring the ISO into Storage by hand.\n\nThe other common cause is starting the VM from a saved state. A saved state preserves the locked drive, so the eject never takes effect. Boot from a full shutdown, reproduce the issue once if needed, then shut down cleanly from inside the guest and apply Method 1.\n\nOne more point worth keeping straight. The virtual machine's CD drive is separate from the host's physical drive and gets its own letter inside a Windows guest, often `D:`. If you want the guest to read a disc sitting in the host's tray, point the VM at it through **Devices ā Optical Drives ā Host Drive**. Pointing the virtual drive at an ISO file instead of the physical disc avoids passthrough quirks entirely.\n\nOnce the drive ejects cleanly and the Guest Additions installer finishes, the lock is gone and the same ISO will mount on demand from the **Devices** menu without throwing the error again.",
"title": "Fix VirtualBox \"Unable to insert the virtual optical disk\" (VERR_PDM_MEDIA_LOCKED)",
"updatedAt": "2026-06-03T05:32:49.971Z"
}