Skip to content

Conversation

balcsida
Copy link

This is still in progress, unpolished, vibecoded mess

- Add comprehensive disk image resizing support for RAW, DMG, and sparse image formats
- Implement two resize strategies: in-place expansion and create-larger-image
- Add robust error handling with detailed error messages
- Include disk space validation and backup mechanisms
- Support for both hdiutil and raw file operations
- Add canBeResized property for format compatibility checking
- Add resize method with validation and error handling
- Add displayName properties for better UI representation
- Add resizeDisk method to VBStorageDevice for high-level operations
- Enable size editing for resizable existing disk images
- Add resize confirmation dialog with detailed information
- Show loading indicator during resize operations
- Add informational messages for resizable disk formats
- Handle resize errors with proper user feedback
- Add resize icon indicator for resizable disk images
- Add context menu with resize option for storage devices
- Fix canBeResized method to properly check disk image existence
- Add remove device option to context menu for non-boot devices
- Add displayName property directly to VBManagedDiskImage.Format
- Add canBeResized property directly to VBManagedDiskImage and VBStorageDevice
- Fix method calls in ManagedDiskImageEditor to use proper disk image URL resolution
- Simplify resize indicator checks in StorageConfigurationView
- Fix canBeResized to use pattern matching on backing property
- Resolve 'managedImage' not in scope compilation error
- Remove direct VBDiskResizer call from UI to fix compilation
- Add VBVirtualMachine+DiskResize extension for resize operations
- Hook resize check into VMController.start() method
- Show informational dialog when resize is scheduled
- Handle resize operations automatically when VM starts
balcsida and others added 17 commits September 16, 2025 18:06
- Move checkAndResizeDiskImages to VBVirtualMachine+Metadata.swift
- Remove separate VBVirtualMachine+DiskResize.swift file
- Ensures methods are compiled with VirtualCore target
- Resolves 'no member' compilation error
- Remove unnecessary guard let for non-optional configuration
- Comment out VBDiskResizer call to avoid scope issues
- Add TODO for actual resize implementation
- Log resize requirement for future implementation
- Re-enable VBDiskResizer.resizeDiskImage call in VBVirtualMachine+Metadata.swift
- Fix Timer-based slider confirmation to prevent popup spam
- Add 0.5s delay before showing resize confirmation dialog
- Complete disk resize feature implementation with actual system tools
- Fix temporary file creation in createRawImage function
- Prevent FileHandle error for non-existent temporary files
- Consolidate RAW image resize logic in createLargerImage
- Properly handle file creation before ftruncate operations
- Remove redundant createRawImage helper function call
…ators

- Add expandPartitionsInDiskImage functionality to VBDiskResizer
- Implement hdiutil attach/detach with diskutil resizeVolume for partition expansion
- Add support for RAW, DMG, and Sparse image partition expansion
- Add resizingDisk state to VMState enum with UI progress overlay
- Update VirtualMachineSessionView to show resize progress indicator
- Improve ManagedDiskImageEditor confirmation message
- Add comprehensive logging for resize and partition operations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add resizingDisk case to VirtualMachineControls.swift button state logic
- Add resizingDisk case to VirtualMachineSessionView.swift state display logic
- Ensure all VMState switch statements are exhaustive after adding new state
- Both UI components now properly handle the disk resize progress state

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Skip Apple_APFS_ISC containers when finding resize target
- Prioritize main Apple_APFS containers for partition expansion
- Fixes issue where resize targeted small ISC container instead of main data container

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Detect when recovery partitions prevent main container expansion
- Add specialized resize strategy for layouts with recovery partitions
- Try multiple diskutil methods to handle partition repositioning
- Fixes resize failure when recovery partition blocks container growth

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Acknowledge that recovery partitions may block immediate expansion
- Provide clear logging about expected behavior for fresh macOS VMs
- Focus on successful disk image resize rather than forced partition expansion
- Recovery partitions in VM environments have complex layouts that may limit expansion

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Attempt to delete recovery partition to allow main container expansion
- Recovery partition will be recreated by macOS when needed
- Fallback to boundary-aware resize if deletion fails
- Better handling for established macOS installations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add findRecoveryContainer to extract container reference from diskutil output
- Use correct container identifier (e.g., disk6) instead of partition (disk4s3)
- Add -force flag to deletion command for recovery containers
- Better logging of container detection process

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Detect when recovery partition is protected by System Integrity Protection
- Provide clear user guidance for manual partition adjustment
- Acknowledge successful disk image resize even with partition limitations
- Suggest Recovery Mode approach for full space utilization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@balcsida
Copy link
Author

balcsida commented Sep 17, 2025

Thanks, @gabefair for the review comments!

Current status: Tested this with Tahoe VM, currently works with non-FileVault enabled disks, working on a way to make it work with FileVault enabled disks as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants