How to share host folders into VM?
zengbo opened this issue · comments
zengbo commented
How to share host folders into VM?
Yifan Gu commented
SSHFS is a good way of doing that. Setup SSH on your Mac, and sshfs
mount it in the client.
See https://help.ubuntu.com/community/SSHFS .
tiehfood commented
With macOS 12 and Xcode 13 beta
Add the following to the code
let directory = VZSharedDirectory(url: URL(fileURLWithPath: "/PATH/TO/FOLDER"), readOnly: false)
let fsdConfig = VZVirtioFileSystemDeviceConfiguration(tag: "myshare")
fsdConfig.share = VZSingleDirectoryShare(directory: directory)
vmCfg.directorySharingDevices = [fsdConfig]
then type in started VM:
mkdir -p /mnt/myshare
mount -t virtiofs myshare /mnt/myshare