Some snippets for dealing with virtual machines, mostly for VMWare and macOS.
Run this inside a Windows VMWare virtual machine guest to shrink it.
- Run your Windows VMWare virtual machine guest system
- Install VMWare Tools in the guest system
- Copy the windows-guest-cleanup-vm.bat file into your Windows guest system, for example into
~/Desktop
In the guest system, right-click and choose Run as Administrator. Enter your administrator password if needed.
Run this inside a macOS VMWare virtual machine guest to shrink it.
- Run your Windows VMWare virtual machine guest system
- Install VMWare Tools in the guest system
- Copy the macos-guest-cleanup-vm.command file into your macOS guest system, for example into
/Applications - In Terminal,
cdto the folder where you saved it and typechmod gou+x macos-guest-cleanup-vm.command, press Enter
In the guest system, double-click to run or right-click and choose Open
Run this in your macOS host to defragment and shrink all VMWare Fusion virtual machines that are present in ~/Documents/Virtual Machines.
- Save the macos-host-cleanup-vmware-vms.command file in your macOS host, for example into
~/Documents/Virtual Machines - In Terminal,
cdto the folder where you saved the file and typechmod gou+x macos-host-cleanup-vmware-vms.command, press Enter
Double-click to run or right-click and choose Open
Run this to produce a macOS ISO file from Install macOS nnnnn.app. You can then install macOS as a guest system in your VMWare.
- In your macOS host, download the operating system installer using App Store, so you have something like
/Applications/Install macOS Monterey.app - Save the macos-create-iso.command file for example in
~/Desktop - Open the file in a text editor and adjust the name of your operating system that gets assigned to the
MACOSNAMEvariable - In Terminal,
cdto the folder where you saved the file and typechmod gou+x macos-create-iso.command, press Enter - Double-click to run or right-click and choose Open. Wait until it finishes, you should get something like
~/Desktop/Monterey.iso - Run VMWare Fusion, choose File > New and drag the ISO into Install from disc or image, proceed