Closed zengbo closed 2 years ago
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
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 .