-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic implementation of shared folders #28
Basic implementation of shared folders #28
Conversation
Signed-off-by: aoxn <spacex_nice@163.com>
@paulcacheux Thanks. Could you please add more comments? |
I added support for |
Probably could add it to the example for now and use the environment file to illustrate it. I think that normal Edit, just finished testing this out by doing like the following. Added to
Added to sharedDirPath := os.Getenv("SHAREDDIR_PATH")
sharedDirName := os.Getenv("SHAREDDIR_NAME")
...
// permits guests vsock and virtio-fs support to mount directory from host for example:
// mount -t virtiofs SHARED_DIR_NAME SHAREDDIR_PATH
virtiofsSharedDirPathConfig := vz.NewVirtioFileSystemDeviceConfiguration(sharedDirName)
virtiofsSharedDirPathConfig.SetDirectoryShare(vz.NewSingleDirectoryShare(vz.NewSharedDirectory(sharedDirPath, false)))
config.SetDirectorySharingDevicesVirtualMachineConfiguration(
[]vz.DirectorySharingDeviceConfiguration{
virtiofsSharedDirPathConfig,
},
) Thanks for the PR, I'm a fan to say the least. 🙂 |
Another thing that occurred to me is that this brings the macOS requirement up to 12.0.0+ per the Virtualization Framework documentation: Line 16 in 71d0477
Something I don't quite know the answer to is: what happens if there is no checks in place when compiling this on older macOS versions? There's this tool called vmcli that does version checking in the code. There's also some workarounds notated. Is this something that should be accounted for in this codebase? |
Trying to build your branch on macOS 11:
|
This is a great point, maybe we could use a build tag to gate this part of the API ? (per feature or per macOS version) |
Not sure how build tagging would work. In various containers related packages I see stubs put in place for OS's in Go. What would probably work is placing stubs in the Obj-C code so that the function for macOS 12+ is there and anything <12 is a placeholder that might throw a warning to the CLI or something. |
set socket to none block mode
I get a new macOS environment recently. I will check this PR after published current code |
I did more work on top of this PR to add macOS version checks |
@Code-Hex what are your plans with respects to this PR? Anything we can do to help move it forward? |
This makes it possible to share files with the VM. For now it's limited to one shared directory, which should be enough for our initial needs. Code-Hex/vz#28 is not merged yet, so this relies on a Code-Hex/vz fork in my own GitHub namespace which has the shared folder API.
This makes it possible to share files with the VM. For now it's limited to one shared directory, which should be enough for our initial needs. Code-Hex/vz#28 is not merged yet, so this relies on a Code-Hex/vz fork in my own GitHub namespace which has the shared folder API. This fixes crc-org#2
Still watching in anticipation myself. If this needs further testing, I have an M1 and Intel MBP available now. |
This makes it possible to share files with the VM. For now it's limited to one shared directory, which should be enough for our initial needs. Code-Hex/vz#28 is not merged yet, so this relies on a Code-Hex/vz fork in my own GitHub namespace which has the shared folder API. This fixes crc-org#2
This makes it possible to share files with the VM. For now it's limited to one shared directory, which should be enough for our initial needs. Code-Hex/vz#28 is not merged yet, so this relies on a Code-Hex/vz fork in my own GitHub namespace which has the shared folder API. This fixes #2
I'm sorry toooooooo late... 🙇 And Thanks everyone for watching this PR. I've prepared the version strategy between macOS Big Sur and Monterey. and I wrote about this in README. I will merge this PR |
…z into shared-folders
@paulcacheux Thank you for your contribution! |
Hello, I'd like to work on implementing shared folders. This PR is currently a basic PoC but I would be happy to continue working on it if it is of any interest to you.