-
Notifications
You must be signed in to change notification settings - Fork 19
Increasing the virtual machine's disk
Simon B. Støvring edited this page Nov 7, 2024
·
2 revisions
The following guide describes how the size of a virtual image can be increased to obtain more disk space in the virtual machine.
Note that this involves erasing the recovery volume to ensure the container can be resized.
- Run
truncate -s 150g ~/.tart/vms/my-vm/disk.img
to increase the disk size to 150 GB. Replace 150 with the size you'd like to resize to. Truncating to a smaller image size may cause data loss. - Run the virtual machine with
tart run my-vm
. - Obtain the IP address of the virtual machine with
tart ip my-vm
. - SSH into the virtual machine with
ssh runner@{IP_ADDRESS}
. - Run
diskutil repairDisk disk0
on the virtual machine. - Shut down the virtual machine.
- Run the virtual machine in recovery mode with
tart run my-vm —-recovery
.
- Open the Terminal app.
- Run
diskutil list
to identify the identifier of the volume namedApple_APFS_Recovery
. We'll assume the identifier is disk0s3. - Erase the recovery volume with
diskutil eraseVolume free free disk0s3
. - Resize the primary APFS container with
diskutil apfs resizeContainer disk0s2 0
. - Shut down the virtual machine.
The disk space has now been increased.
Tartelet is built with ❤️ by Shape in Denmark. Oh, and we are hiring 🤗