Shrinking a virtual disk using scripts in VMware Fusion
search cancel

Shrinking a virtual disk using scripts in VMware Fusion

book

Article ID: 339600

calendar_today

Updated On:

Products

VMware Desktop Hypervisor

Issue/Introduction

This article provides the steps to shrink a virtual disk in VMware Fusion 5.x, 6.x and 7.x using scripts.

Notes:
  • The VMware Tools user interface inside the virtual machine in Fusion 5.x and 6.x no longer has the option to shrink the virtual disk.
  • You can also use Clean up Virtual Machine option under Settings > General to shrink the virtual disks.


Symptoms:


Environment

VMware Fusion 7.x
VMware Fusion 5.x
VMware Fusion 6.x
VMware Fusion 8.x

Resolution

Shrinking the virtual disk in a Windows virtual machine


To shrink the virtual disk in a Windows virtual machine:
  1. Power on the Windows virtual machine.
  2. Open a Command Prompt with administrator privileges.
  3. Run these commands:

    cd C:\Program Files\VMware\VMware Tools

    C:\Program Files\VMware\VMware Tools> VMwareToolboxCmd help disk

    This displays a list of options that are available for shrinking.

    For example:
    C:\Program Files\VMware\VMware Tools>VMwareToolboxCmd.exe disk shrink c:\
Please disregard any warnings about disk space for the duration of shrink process.
Progress: 100 [===========>]

Disk shrinking complete.


          Shrinking the virtual disk in a Linux virtual machine


          To shrink the virtual disk in a Linux virtual machine:
          1. Open Terminal.
          2. Run these commands:

            cd /usr/bin

            /usr/bin$ vmware-toolbox-cmd help disk

          Shrinking the virtual disk in a Mac OS X virtual machine


          To shrink the virtual disk in a Mac OS X virtual machine:
          1. Open Terminal.
          2. Run these commands:

            cd /Library/Application Support/VMware Tools

            ./vmware-tools-cli help disk

          Note: To perform a normal shrink operation, use the shrink only option.

          Run all the commands after logging in to the virtual machine (Windows, Linux, Mac OS X).