Skip to content

Allow shared folder path customization#78

Merged
legal90 merged 5 commits intoParallels:masterfrom
legal90:custom-share-path
Dec 23, 2018
Merged

Allow shared folder path customization#78
legal90 merged 5 commits intoParallels:masterfrom
legal90:custom-share-path

Conversation

@legal90
Copy link
Copy Markdown
Collaborator

@legal90 legal90 commented Dec 19, 2018

This PR adds a new CLI argument --parallels-share-folder, which could be specified multiple times
and allows to customize shared folder paths. The default is still the same: /Users.

New argument supports relative paths and spaces. Usage example:

docker-machine create -d parallels \
    --parallels-share-folder ~/Documents 
    --parallels-share-folder /Library/Application\ Support \
    --parallels-share-folder ./some-relative-path \
    test-vm

The temporary binary built from this branch: docker-machine-driver-parallels-565d105.zip

As an addition - user can also add his own custom shared folders manually, via CLI or GUI. It will be mounted automatically after rebooting the VM with docker-machine restart.

Attention: As it was before with /Users, the mount path on the guest side is the same as the path on your Mac which you passed to the --parallels-share-folder option.
E.q./Users is mounted to the guest path /Users, /Library, if specified, will be mounted to the guest path /Library and so on.
So, do not share such folders as /bin, /etc, /usr, /var and other paths which overlap the existing directory structure of boot2docker Linux VM. That will cause the VM to stop working properly.

P.s. The original implementation was discussed in #77

Adds a new CLI argument "--parallels-share-folder" which could be specified multiple times
and allows to customize shared folder paths. The default is still the same: "/Users".
@legal90 legal90 requested a review from romankulikov December 19, 2018 22:05
mountCmd := "sudo mkdir -p " + mountPoint + " && sudo mount -t prl_fs " + shareName + " " + mountPoint
// Mount the shared folder
log.Infof("Mounting shared folder %q ...", mountPoint, mountPoint)
mountCmd := fmt.Sprintf("sudo mkdir -p %q && sudo mount -t prl_fs %q %q", mountPoint, shareName, mountPoint)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why don't you use "share" option of prl_fs?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hm... I'm not sure. It was always like that, without share mount option. Do you think we should use it? Won't it cause access issues for docker daemon or containers running in the VM?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Well, I don't know. Ok, anyway this is not relevant for the pull request.

Use -t option to list mount points of the specified type
Copy link
Copy Markdown
Collaborator

@romankulikov romankulikov left a comment

Choose a reason for hiding this comment

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

Ok, thanks!

@legal90 legal90 merged commit 00a4aba into Parallels:master Dec 23, 2018
@legal90 legal90 deleted the custom-share-path branch December 23, 2018 15:26
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.

2 participants