Repairing a sparse virtual disk in Fusion
search cancel

Repairing a sparse virtual disk in Fusion

book

Article ID: 303388

calendar_today

Updated On:

Products

VMware Desktop Hypervisor

Issue/Introduction

This article describes the steps to repair a sparse virtual disk. You cannot repair a pre-allocated virtual disk. To determine if you have a sparse disk or a pre-allocated disk, see Making a Fusion virtual disk pre-allocated or sparse (1021565).

Note: Not all corrupted virtual disks can be repaired. Power outages, force-quitting Fusion, and powering off the Mac (rather than shutting it down) might cause unrepairable damage to a virtual machine. Bad sectors on a physical hard disk or a failing hard drive can also cause damage to a virtual machine by corrupting the virtual disk.

Symptoms:
  • The virtual machine fails to start after a forced Mac shutdown.
  • The virtual machine does not boot up after a crash.
  • When starting the virtual machine, you see the error:

    Operation on file failed. If the file resides on a remote file system, please make sure your network connection and the server where this disk resides are functioning properly.
     
  • When starting the virtual machine, you see the error:

    Cannot open the disk 'path_to_virtual_machine /virtual_disk.vmdk' or one of the snapshot disks it depends on. Reason: The specified virtual disk needs repair.
     
  • When trying to mount the virtual disk with VMDKMounter, you see the error:

    There is a problem trying to mount the virtual disk.
     
  • When trying to repair the virtual disk using vmware-vdiskmanager, you see the error:

    The virtual disk is corrupted but the repair process has failed.
     
  • When starting the virtual machine, you see the error:

    "Unable to delete snapshot" virtual disk needs repair


Environment

VMware Fusion 7.x
VMware Fusion Pro 11.x
VMware Fusion 3.x
VMware Fusion Pro 10.x
VMware Fusion 6.x
VMware Fusion 2.x
VMware Fusion Pro 8.x
VMware Fusion 11.x
VMware Fusion 4.x
VMware Fusion 1.x
VMware Fusion 10.x
VMware Fusion 8.x
VMware Fusion 5.x

Resolution

To repair a virtual disk:

Note: If you are using Fusion 3.1.0, you must obtain the correct version of the utility before proceeding with the repair. For more information, see Repairing a virtual disk in Fusion 3.1 and Workstation 7.1 (1023856).

  1. Ensure that your virtual machine is shut down and not suspended. If your virtual machine is suspended, see Fixing an unexpected signal 10 error in Fusion (1018757).
  2. Open Finder, navigate to /Applications/Utilities, and open Terminal.
  3. Copy and paste this line into the Terminal window:
     
    • If you are using Fusion 4.x or above:

      sudo /Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -R
       
    • If you are using Fusion 3 or below:

      sudo /Library/Application\ Support/VMware\ Fusion/vmware-vdiskmanager -R
       
    Note: If there is no space at the end of the command, press now. Also, do not press Enter now because the command is not yet complete.
     
  4. In a new Finder window, locate your virtual machine bundle. For more information, see Locating the virtual machine bundle in VMware Fusion (1007599).
  5. Right-click the virtual machine bundle and select Show Package Contents.
  6. Locate the .vmdk file that was in the error message and drag it into the Terminal window. This copies the file location into the command that has already been started. The command in Terminal looks similar to this:
     
    • If you are using Fusion 4.x or above:

      sudo /Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -R /Users/yourusername/Documents/Virtual\ Machines.localized/Windows\ XP.vmwarevm/Windows\ XP.vmdk
       
    • If you are using Fusion 3 or below:

      sudo /Library/Application\ Support/VMware\ Fusion/vmware-vdiskmanager -R /Users/yourusername/Documents/Virtual\ Machines.localized/Windows\ XP.vmwarevm/Windows\ XP.vmdk
       
  7. Enter the administrator password when prompted, then press Enter.

    Note: For security reasons, the typed password is not displayed. You do not need to enter your password again, for the next five minutes.
     
  8. Wait for the repair to complete. A message appears indicating whether the virtual disk repair is successful. After the command has run, you see one of these messages:
     
    • No issues: No errors were found on the virtual disk, <location of disk>
    • Issue repaired: The virtual disk, <path to disk>, was corrupted and has been successfully repaired.
    • Can't repair: The virtual disk, <path to disk>, is corrupted but the repair process has failed.
    • Can't repair: No result is displayed as the disk file damage is such as it has caused vdiskmanager to crash.

      Note: If you have any snapshots, you must repeat Steps 6 and7 for each main disk (the base disk and the main snapshot disks). For more information, see Contents of the virtual machine bundle in Fusion (1021016).
       
  9. To exit from Terminal, go to Terminal > Quit Terminal.

If the repair is successful, open Fusion and start the virtual machine. If the repair fails, you need to restore from a backup of your virtual machine or create a new virtual machine. For more information, see Installing Windows in a virtual machine using VMware Fusion Easy Install (1011677)


Additional Information

Locating the virtual machine bundle in VMware Fusion
Fixing an unexpected signal 10 error in Fusion
Contents of the virtual machine bundle in Fusion
Making a Fusion virtual disk pre-allocated or sparse
Repairing a virtual disk in Fusion 3.1 and Workstation 7.1
Fusion でスパース仮想ディスクを修復する
修复 Fusion 中的稀疏虚拟磁盘