Skip to content

Conversation

@balcsida
Copy link

@balcsida balcsida commented Aug 25, 2025

This is still in progress, unpolished, vibecoded mess

Now finished - though the comments above still apply 😅

@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

@giladgd
Copy link

giladgd commented Nov 14, 2025

Any update about this? I've love to be able to resize the disk size of a macOS VM

@balcsida
Copy link
Author

balcsida commented Nov 21, 2025

@giladgd Thanks for pinging me, I'll try to find some time to check on this tomorrow

@@ -1,5 +1,5 @@
CODE_SIGN_IDENTITY = Apple Development
VB_BUNDLE_ID_PREFIX =
VB_BUNDLE_ID_PREFIX = com.yourname.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unnecessary change.

Suggested change
VB_BUNDLE_ID_PREFIX = com.yourname.
VB_BUNDLE_ID_PREFIX =

Comment on lines 2910 to 2947
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_ASSET_PATHS = "\"VirtualBuddy/Preview Content\"";
DEVELOPMENT_TEAM = 8C7439RJLG;
"DEVELOPMENT_TEAM[sdk=macosx*]" = 8C7439RJLG;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VirtualBuddy/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
INFOPLIST_KEY_NSHumanReadableCopyright = "© 2023 Buddy Software LTD";
INFOPLIST_KEY_NSMicrophoneUsageDescription = "Enable audio input for your virtual machines. Without this permission, virtual machines won't be able to record any audio.";
LD_RUNPATH_SEARCH_PATHS = "$(VB_APP_RUNPATH_SEARCH_PATHS)";
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "$(VB_BUNDLE_ID_PREFIX)codes.rambo.VirtualBuddy";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Beta_Debug;
};
F40A1E892C1869680033E47D /* Beta_Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = VirtualBuddyGuest/VirtualBuddyGuest.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_ASSET_PATHS = "\"VirtualBuddyGuest/Preview Content\"";
DEVELOPMENT_TEAM = 8C7439RJLG;
DEVELOPMENT_TEAM = "";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these changes need to be reverted.

Comment on lines 2976 to 2979
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 8C7439RJLG;
DEVELOPMENT_TEAM = "";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These too 😄

Comment on lines 3183 to 3223
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_ASSET_PATHS = "\"VirtualBuddy/Preview Content\"";
DEVELOPMENT_TEAM = 8C7439RJLG;
"DEVELOPMENT_TEAM[sdk=macosx*]" = 8C7439RJLG;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VirtualBuddy/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
INFOPLIST_KEY_NSHumanReadableCopyright = "© 2023 Buddy Software LTD";
INFOPLIST_KEY_NSMicrophoneUsageDescription = "Enable audio input for your virtual machines. Without this permission, virtual machines won't be able to record any audio.";
LD_RUNPATH_SEARCH_PATHS = "$(VB_APP_RUNPATH_SEARCH_PATHS)";
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "$(VB_BUNDLE_ID_PREFIX)codes.rambo.VirtualBuddy";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Beta_Release;
};
F40A1E922C18697B0033E47D /* Beta_Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = VirtualBuddyGuest/VirtualBuddyGuest.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_ASSET_PATHS = "\"VirtualBuddyGuest/Preview Content\"";
DEVELOPMENT_TEAM = 8C7439RJLG;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And these 😅

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You get the picture — all of the build config changes you've made need to be reverted before this could be merged.

Adding the files to the project is fine (although perhaps we should consider converting these to proper folders in a future PR).

@balcsida
Copy link
Author

@giladgd, so sorry, but I barely had time to check this, and unfortunately, I run out of space on my machine to host VMs. I'm looking into some cheap solutions right now, thank you for your patience with me again!

balcsida and others added 16 commits December 6, 2025 15:00
- 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
- 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]>
@balcsida balcsida requested a review from tonyarnold December 12, 2025 13:36
@gabefair
Copy link

gabefair commented Dec 14, 2025

Have you tested resizing LVMs encrypted with LUKS? Consider using silverblue as a test distro.
image

@balcsida balcsida marked this pull request as draft December 17, 2025 13:00
@balcsida
Copy link
Author

@gabefair No, to be honest, I only tested it with macOS, I completely forgot VirtualBuddy supports Linux guests

Skip APFS-specific GPT layout adjustments and partition expansion
for Linux VMs since they use different filesystem types (ext4, etc.)
and the guest OS handles partition resizing at boot.
Pass the VM's guest type (macOS or Linux) when resizing disk images
so the resizer can skip APFS-specific operations for Linux VMs.
Allow callers to specify the guest type when resizing managed disk
images so the appropriate resize strategy is used for each OS type.
Implement LinuxGPTLayoutAdjuster to handle disk resizing for Linux VMs:
- Recognizes Linux partition GUIDs (generic, ARM64, x86-64)
- Extends the largest Linux partition to fill available space
- Updates both primary and backup GPT headers
- Works with LUKS-encrypted partitions (partition extended, guest
  must run cryptsetup resize to use the new space)
Add a systemd-based guest additions package for Linux VMs that
automatically resizes the root partition and filesystem on boot.

Features:
- Automatic partition resize using growpart
- LUKS encrypted disk support (cryptsetup resize)
- Supports ext4, XFS, and Btrfs filesystems
- Works with Fedora, Ubuntu, Debian, Arch, and other systemd distros
- Add LVM detection and resize support (pvresize, lvextend)
- Support LVM on LUKS (Fedora Workstation default layout)
- Update README with LVM documentation and troubleshooting
- Bump version to 1.1.0
@balcsida
Copy link
Author

@gabefair, could you please try it out now, for me it worked well:

linux_resize.mp4

@balcsida
Copy link
Author

balcsida commented Jan 1, 2026

Also, just for fun, if we have guest services for Linux now, here is a little experiment I did:

Screen.Recording.2026-01-02.at.16.15.23-opti.mp4

@balcsida balcsida marked this pull request as ready for review January 3, 2026 15:33
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.

4 participants