You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The virtualization framework supports having multiple automounted volumes with different readonly vs readwrite statuses, as can be seen described in Apple's documentation for VZVirtioFileSystemDeviceConfiguration
But the current support for --vol only allows for one automounted volume. If two are specified, an error is thrown due to reusing the same VZVirtioFileSystemDeviceConfiguration.macOSGuestAutomountTag tag.
I see that there is a method already in macosvm called addAutomountDirectoryShares:readOnly: which does know how to share describe multiple automounted directories, but it forces them all to have the same value for readOnly, and the code is currently unreachable.
Motivating example:
I want to start my VM with two automounted directories, one that is readonly so that the guest VM can't ruin it, and one that has readwrite capabilities so that the guest VM can write some data back to the host.
There I've hacked this together by making macosvm loop over the shares twice:
Loop one: Loop over all shares
if share is an automount share and automounting is available, add it to a list of automount shares and continue
otherwise do normal share specifications
Loop two:
Loop over all discovered automount shares. Batch each directory together into a single VZMultipleDirectoryShare and set that as the share for VZVirtioFileSystemDeviceConfiguration with the VZVirtioFileSystemDeviceConfiguration.macOSGuestAutomountTag tag.
If that seems acceptable I could send a pull request.
The text was updated successfully, but these errors were encountered:
The virtualization framework supports having multiple automounted volumes with different readonly vs readwrite statuses, as can be seen described in Apple's documentation for VZVirtioFileSystemDeviceConfiguration
But the current support for
--vol
only allows for one automounted volume. If two are specified, an error is thrown due to reusing the same VZVirtioFileSystemDeviceConfiguration.macOSGuestAutomountTag tag.I see that there is a method already in macosvm called
addAutomountDirectoryShares:readOnly:
which does know how to share describe multiple automounted directories, but it forces them all to have the same value for readOnly, and the code is currently unreachable.Motivating example:
I want to start my VM with two automounted directories, one that is readonly so that the guest VM can't ruin it, and one that has readwrite capabilities so that the guest VM can write some data back to the host.
Potential implementation:
I've got a working implementation of this in my fork:
aaronclarke:feature/multiple_automount
There I've hacked this together by making macosvm loop over the shares twice:
VZVirtioFileSystemDeviceConfiguration.macOSGuestAutomountTag
tag.If that seems acceptable I could send a pull request.
The text was updated successfully, but these errors were encountered: