Skip to content

additionalDisks: support custom mountPoint and optional mounting#5198

Open
ekalinin wants to merge 1 commit into
lima-vm:masterfrom
ekalinin:feat-4065-disk-mountpoint
Open

additionalDisks: support custom mountPoint and optional mounting#5198
ekalinin wants to merge 1 commit into
lima-vm:masterfrom
ekalinin:feat-4065-disk-mountpoint

Conversation

@ekalinin

@ekalinin ekalinin commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Additional disks were always mounted at the hardcoded path /mnt/lima-<name>, with no way to change that location or to attach a disk without Lima mounting it. Issue #4065 asks for both: a custom mount point and an attach-only mode so the guest can manage the disk itself (a flexibility Colima can benefit from).

Add two optional, backwards-compatible fields to each additionalDisks entry:

  • mountPoint: absolute guest path to mount at (default /mnt/lima-<name>)
  • mount: whether Lima auto-mounts the disk (default true; false attaches the disk without mounting it)

A separate mount boolean is used rather than overloading an empty mountPoint, per the discussion in #4065. nil for either field preserves the current behavior. Values are passed to the guest via LIMA_CIDATA_DISK_<i>_MOUNT / _MOUNTPOINT and honored by 05-lima-disks.sh (non-swap disks only). mountPoint is validated to be an absolute guest path (path.IsAbs, not the host-dependent filepath.IsAbs) and not a critical system path.

Fixes #4065

Additional disks were always mounted at the hardcoded path
/mnt/lima-<name>, with no way to change that location or to attach a disk
without Lima mounting it. Issue lima-vm#4065 asks for both: a custom mount point
and an attach-only mode so the guest can manage the disk itself (a
flexibility Colima can benefit from).

Add two optional, backwards-compatible fields to each additionalDisks
entry:
- mountPoint: absolute guest path to mount at (default /mnt/lima-<name>)
- mount: whether Lima auto-mounts the disk (default true; false attaches
  the disk without mounting it)

A separate `mount` boolean is used rather than overloading an empty
mountPoint, per the discussion in lima-vm#4065. nil for either field preserves
the current behavior. Values are passed to the guest via
LIMA_CIDATA_DISK_<i>_MOUNT / _MOUNTPOINT and honored by 05-lima-disks.sh
(non-swap disks only). mountPoint is validated to be an absolute guest
path (path.IsAbs, not the host-dependent filepath.IsAbs) and not a
critical system path.

Fixes lima-vm#4065

Signed-off-by: Eugene Kalinin <e.v.kalinin@gmail.com>
@ekalinin
ekalinin force-pushed the feat-4065-disk-mountpoint branch from 6f86982 to 8e928f8 Compare July 7, 2026 11:15
@AkihiroSuda AkihiroSuda added this to the v2.2.0 milestone Jul 9, 2026
@AkihiroSuda
AkihiroSuda requested a review from a team July 14, 2026 09:13
AkihiroSuda
AkihiroSuda previously approved these changes Jul 14, 2026

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda modified the milestones: v2.2.0, v2.3.0 Jul 15, 2026
@AkihiroSuda
AkihiroSuda changed the base branch from master to release/0.20 July 18, 2026 22:36
@AkihiroSuda
AkihiroSuda changed the base branch from release/0.20 to master July 18, 2026 22:36
@AkihiroSuda
AkihiroSuda dismissed their stale review July 18, 2026 22:36

The base branch was changed.

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.

additionalDisks: support for optional and customizable mount point

2 participants