Fix: VirtualBox Cannot Register Hard Disk Already Exists
When VirtualBox says a hard disk is already registered, it means the UUID conflict. You can fix it in 30 seconds with a command or by cloning the disk.
Quick Answer
Open a terminal and run: VBoxManage clonehd olddisk.vdi newdisk.vdi then register newdisk.vdi. Or use VBoxManage internalcommands sethduuid olddisk.vdi to change the UUID in place. Both work, cloning is safer.
Why This Happens
VirtualBox tracks every disk by a unique UUID. When you try to register a disk that's already in the VirtualBox media manager — maybe you copied a VDI from another machine, or you imported a virtual appliance twice — you get this error. It's not a bug, it's by design. VirtualBox doesn't let two disks with the same UUID exist in its registry. I had a client last month who copied a Windows 10 VDI from an old laptop to a new one, spent an hour trying to attach it, and got this error every time. He thought the disk was corrupted. It wasn't. Just a UUID conflict.
The error usually pops up as a popup with the message "Cannot register the hard disk... because a hard disk with UUID... already exists." Sometimes it's a silent fail in the log. Either way, the fix is simple.
Main Fix: Clone the Disk (Safe)
- Find your VDI file. Look in the VirtualBox VMs folder, usually
C:\Users\YourName\VirtualBox VMs\on Windows, or~/VirtualBox VMs/on Mac/Linux. If you don't know where it is, open VirtualBox, go to File > Virtual Media Manager, and the path is listed there. - Open a command prompt or terminal. On Windows, press Win+R, type
cmd, hit Enter. On Mac/Linux, open Terminal. - Run this command — replace paths with yours:
This creates a brand new VDI with a fresh UUID. The clone is identical to the original, so your VM will boot fine.VBoxManage clonehd "C:\Users\You\VirtualBox VMs\OldVM\disk.vdi" "C:\Users\You\VirtualBox VMs\NewVM\disk_clone.vdi" - Register the new disk. In VirtualBox, select your VM, click Settings > Storage, click the controller, then the small hard disk icon, and choose "Add Existing Disk". Browse to the new VDI file.
- Remove the old reference. If the old disk still shows up in the Virtual Media Manager as unavailable, right-click it and choose Remove. It won't delete the file, just the registry entry.
Alternative Fix: Change UUID In Place (Faster)
If you don't want to copy the file (maybe it's a 100GB disk and you're short on space), you can just change the UUID of the existing disk. But be careful — this modifies the original file. Back it up first if you're nervous.
- Open terminal/command prompt.
- Run:
This assigns a random new UUID. Note: this command doesn't work on VMDK files, only VDI and VHD. For VMDK, you have to use the clone method.VBoxManage internalcommands sethduuid "C:\Users\You\VirtualBox VMs\disk.vdi" - Now attach it to your VM like in step 4 above.
When the Main Fix Fails
Sometimes VirtualBox gets stubborn. Here's what I've seen work after the clone or UUID change still throws an error:
- Check if the disk is referenced in another VM. Go to File > Virtual Media Manager and see if the disk appears under another VM. Release it by right-clicking and selecting Release.
- Restart VirtualBox. Close it completely, kill any VBoxSVC process in Task Manager (Windows) or Activity Monitor (Mac). Then reopen. The background service sometimes caches old UUIDs.
- Delete the VirtualBox.xml file (advanced). Located in
~/.config/VirtualBox/on Linux,~/Library/VirtualBox/on Mac, or%USERPROFILE%\.VirtualBox\on Windows. This is the master registry. Back it up first, then delete it. VirtualBox rebuilds it when you open it again. You'll lose all your VM settings though, so only do this if you're desperate. - Use a different disk format. If clone fails, try:
Then register the VMDK. VirtualBox treats them as completely separate media types.VBoxManage clonehd disk.vdi disk.vmdk --format VMDK
Prevention Tip
Never copy a VDI file manually and try to attach it directly. Always use the VirtualBox export/import feature (File > Export Appliance). Or, if you must copy the file, run the clone command right away before you register it. I keep a batch file on my desktop that does: VBoxManage clonehd %1 %~n1_clone.vdi so I can drag and drop a VDI onto it. Saves me every time.
Had a client who kept hitting this because he was backing up VDI files to a network drive and then trying to use them on his laptop. The UUIDs clashed every time. After I showed him the clonehd command, he never called about it again. Simple stuff.
Was this solution helpful?