3 Replies Latest reply: Sep 8, 2010 12:41 AM by Laraine RSS

    Mac OS 10.6 Server

    Laraine Novice

      Hi.

       

      I am running a Mac OS 10.6 server in Fusion for a project. The virtual disk grew amazing in size. The manual states, that I have to use the VM Ware Tools under the guest so to shrink the virtual drive. The VM Ware Tools are installed on the server, but there is no gui, nor can I find any CLI commands.

       

      How do shrink a virtual Mac Server under Fusion?

        • 1. Re: Mac OS 10.6 Server
          WoodyZ Guru

          VMware Tools for Mac OS X Server are not as robust as for other Guest OSes and does not have a GUI however there is a CLI named "vmware-tools-cli".  It is located in the typical place, "/Library/Application Support/VMware Tools/", and you can execute it with the help argument to see what functions are available.

           

          Personally what I do to shrink the virtual hard disk of my OS X Server Virtual Machine is to use Terminal and dd in the Guest to prep it for shrinking and then use vmware-vdiskmanager on the Host to finish the shrink.

           

          In a Terminal in the Guest I use the following command to create a temporary file full of zeros.

           

          dd if=/dev/zero of=shrink_prep.tmp bs=1048576

           

          When the disk is full I delete the shrink_prep.tmp file and empty the Trash and then shutdown, not suspend, and close VMware Fusion.

           

          In a Terminal on the Host using vmware-vdiskmanager with the -k argument and the target .vmdk file I finfish the shrink process.  For proper syntax you can execute it without any argument and it will display the internal help information.  vmware-vdiskmanager is located in the typical place, "/Library/Application Support/VMware Fusion/".

           

          FWIW When I first installed OS X Snow Leopard Server the .vmdk  files took up 10.69 GB on the Host's Hard Drive and after a shrink as described here the size was 6.02 GB and well worth taking the time to shrink it.  It didn't take too long but it was nice to have the 4.67 GB of disk space back on the Host.

          • 2. Re: Mac OS 10.6 Server
            mudaltsov Expert VMware Employees

            vmware-tools-cli doesn't currently support shrinking HFS partitions, so zeroing out the space manually is the only way to go for now.

             

            In addition to the dd command, there is another way to zero out free space on Mac OS:

             

            1. Run Disk Utility (in /Applications/Utilities)

            2. Select the partition you want to shrink

            3. Go to the "Erase" tab

            4. Click "Erase Free Space..."

            5. Make sure "Zero Out Deleted Files" is selected

            6. Click "Erase Free Space"

             

            Then shut down the VM and proceed with using vmware-vdiskmanager to shrink the disk. Of course make sure you don't have any snapshots before doing this, or the zeroed out space will be written out to the snapshot files, using up even more disk space.

            • 3. Re: Mac OS 10.6 Server
              Laraine Novice

              Booth methods work just fine.

              Thanks!