This error message occurs when there is little or no free space directly below the APFS container you are trying to enlarge. For example, below is the diskutil list disk2 output of a disk image where virtually all the free space has been allocated to partitions.
/dev/disk2 (disk image):
#: TYPE NAME SIZE ...
These instructions are for the latest Intel Macs which boot macOS from an APFS volume and EFI boot both Windows and Ubuntu.
Note the following:
If your wireless mouse or keyboard will not work during the installation process, then I assume you have a wired replacement you can temporarily use.
Apple introduced the T2 Security Chip and Secure Boot ...
You could install rEFInd as by default this will automatically identify legacy Windows installations on internal or external disks.
Alternatively you could create a hybrid member on your internal SSD using gdisk and set at least one partition bootable.
This will cause the firmware to initialize the BIOS/CSM/legacy support.
You can pick any partitions as ...
I am currently typing this from the system on the cloned 1 TB SSD, my solution was:
Clone internal 500 GB SSD with Carbon Copy Cloner 5 to the 1 TB SSD (using QNINE NVMe enclosure)
Swap 500 GB internal with 1 TB Sabrent Rocket NVMe
Directly boot into Recovery Mode
Added the missing VM container with the command: diskutil apfs addVolume disk1 APFS VM -role V ...
All the partitions after disk0s2 can be returned to free space. The commands to do so are given below.
sudo diskutil eraseVolume free none disk0s8
sudo diskutil eraseVolume free none disk0s7
sudo diskutil eraseVolume free none disk0s6
sudo diskutil eraseVolume free none disk0s5
sudo diskutil eraseVolume free none disk0s4
sudo diskutil eraseVolume free none ...
Disk Utility and diskutil (which Disk Utility uses behind the scenes) are refusing to increase the size of your APFS container because your recovery partition, "Recovery HD", appears to be in the way (though, for whatever reason, Disk Utility is not making this apparent in its diagrams). This probably became the case due to a direct upgrade from a pre-APFS ...