Archive
Upgrading from ESXi 6.7 to ESXi 7.0 via SSH and esxcli
Following VMware’s release of ESXi 7.0, I upgraded my ESXi 6.7 server to ESXi 7.0 using SSH and esxcli. For those interested, see below the jump for the details of the process I used.
Building macOS installer disk images for virtual machines with create_macos_vm_install_dmg
A while back, I wrote a couple of scripts which built installers for Mac virtual machines:
However, Apple made some changes to the macOS installer starting in macOS Sierra 10.12.4 which broke the method I was using to build the installers. Recently though, I figured out that I could use Apple’s createinstallmedia tool to help me with building installers for Mac virtual machines again. After a substantial re-write, create_macos_vm_install_dmg is able to create bootable disk images for virtual machines running macOS Sierra, High Sierra and Mojave.
One change from the previous version of the create_macos_vm_install_dmg script is that the resulting installer no longer runs an automated installation. Instead, it will be necessary to follow the prompts to select the language and drive to install the OS onto. For more details, please see below the jump.
Upgrading from ESXi 6.5 to ESXi 6.7 via SSH and esxcli
Following VMware’s release of ESXi 6.7, I upgraded my ESXi 6.5 server to ESXi 6.7 using SSH and esxcli. For those interested, see below the jump for the details of the process I used.
Resizing a macOS VM’s APFS boot drive to use all available disk space
A while back, I wrote a post on how to resize the boot drive of an existing virtual machine. However, that guidance only applies to a boot drive that uses HFS+ for its filesystem.
Now that Apple File System (APFS) is available and the default file system on macOS High Sierra, a different procedure must be used in order to resize the APFS-formatted boot drive of an existing virtual machine. For more details, see below the jump.
Building VMs on ESXi using esxi_macos_vm_creation.sh
As part of my testing workflow, I’ve been using VMs running on a ESXi server running ESXi 6.5. To help me quickly build those VMs, I have been using a script named esxi_macos_vm_creation.sh for building VMs. This script is forked from Tamas Piros’s auto-create script for standing up Linux VMs on free ESXi:
https://github.com/tpiros/auto-create
My fork of the auto-create script is designed to create and configure virtual machines with Apple operating systems as the guest OS, hosted on a VMware ESXi server running on Apple hardware. The script assumes that the virtual machines are built using copied VMDK disk files, where the VMDK files are generated by AutoDMG and vfuse. For more details, see below the jump.
Expanding partition size in an ESXi-hosted macOS VM
As part of working on a project recently, I ran into an unexpected problem with ESXi-hosted Mac VMs. For these VMs, I was creating VMDK files from AutoDMG-generated disk images, using vfuse to convert the disk image into a VM with ESXi-compatible VMDK disk image files.
My workflow looked like this:
1. Create disk image using AutoDMG.
2. Use vfuse to create VMDK files using a command similar to the one shown below:
sudo vfuse -i /path/to/autodmg_created_disk_image_here --esx
3. Upload the VMDK files to a convenient location on my ESXi server
4. Set up a new VM, using copies of uploaded VMDK files for the VM boot disk.
5. Resize the new VM to the desired size using VMware’s vmkfstools utility.
6. Start up the VM.
After logging in, I ran the following command to enable macOS to recognize and use the unallocated space from the VM resizing:
diskutil resizeVolume / R
Normally, this command is able to do a live re-sizing of the boot partition to use all available unallocated space. However, this time the re-sizing process failed and the following error was displayed:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
computername:~ username$ diskutil resizeVolume / R | |
Note: Your partition map does not use the entire space of your whole-disk. You should use "diskutil repairDisk" and then repeat this command. | |
Resizing to full size (fit to fill) | |
Started partitioning on disk0s2 Macintosh HD | |
Verifying the disk | |
Verifying file system | |
Using live mode | |
Performing live verification | |
Checking Journaled HFS Plus volume | |
Checking extents overflow file | |
Checking catalog file | |
Checking multi-linked files | |
Checking catalog hierarchy | |
Checking extended attributes file | |
Checking volume bitmap | |
Checking volume information | |
The volume Macintosh HD appears to be OK | |
File system check exit code is 0 | |
Resizing | |
Error: -5341: MediaKit reports partition (map) too small; if you recently grew your whole-disk, you should run whole-disk repair | |
computername:~ username$ |
How to fix this? For more details, see below the jump.
Creating macOS installer disk images for VMware Fusion and ESXi with create_macos_vm_install_dmg
I’ve had a tool available for a while named create_vmware_osx_install_dmg, but it looks like it has reached the end of the road with macOS 10.12.3. The reason for this is because macOS 10.12.4 has introduced a change that prevents the addition of third-party packages to the OS installer. create_vmware_osx_install_dmg uses the addition of a third-party installer package, so unfortunately this tool cannot be used to generate 10.12.4 or later OS installers.
That said, I still want to be able to create macOS installer disk images for VMware Fusion and ESXi, so I’ve forked create_vmware_osx_install_dmg into a new script named create_macos_vm_install_dmg. create_macos_vm_install_dmg will generate stock OS installer disk images for the following OS versions:
- Mac OS X 10.7.x
- OS X 10.8.x
- OS X 10.9.x
- OS X 10.10.x
- OS X 10.11.x
- OS X 10.12.x
This script does not use a third-party package, so it is able to build a macOS 10.12.4 installer disk image. For more details, see below the jump.
Upgrading from ESXi 6.0 to ESXi 6.5 via SSH and esxcli
In the wake of VMware’s release of ESXi 6.5, I was able to upgrade my ESXi 6.0 Update 2 server to ESXi 6.5 using SSH and esxcli. For those interested in doing likewise, please see below the jump for the details of the process I used.
Session videos and slides now available from MacSysAdmin 2016
The documentation from MacSysAdmin 2016 is now available, with the session slides and videos being accessible from the link below:
http://documentation.macsysadmin.se
The videos of my sessions are available for download from here:
- What’s new in File System: http://docs.macsysadmin.se/2016/video/Day2Session1.mp4
- Going from Physical to Virtual – Creating, hosting and managing OS X VMs with VMware Fusion and ESXi: http://docs.macsysadmin.se/2016/video/Day3Session6.mp4
I also like to thank Tycho Sjögren and Apoio AB again for inviting me to speak at this year’s MacSysAdmin.
Slides from the virtualization session at MacSysAdmin 2016
For those who wanted a copy of my virtualization talk at MacSysAdmin 2016, here are links to the slides in PDF and Keynote format.
Recent Comments