-
Notifications
You must be signed in to change notification settings - Fork 93
Add VirtualBox shared folders creation #258
Conversation
|
@SvenDowideit since these options are for "advanced" users, do you think the help text is sufficient for documenting them? |
|
@tianon ❤️ |
1 similar comment
|
@tianon ❤️ |
virtualbox/machine.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The double-negative tweaks my brain... how about:
.., &cfg.enableShare, "vbox-share", true, "Enable...
and the next line could be:
..., "vbox-share-dir",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair, although can't you use a boolean flag like --no-vbox-share directly (ie, no =true, since that's implied)? Also, we already have --no-dummy="": Example parameter for the dummy driver., so this isn't without precedent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So does that change your mind, or should I go rename some options? 😄
I'm fine either way. That would have the benefit of making them all sort together, so that'd be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, please do not use negative options - they get ugly fast, and are much harder to write about - --no-dummy isn't really something anyone has seen :)
|
oh. this isn't |
c8d2bd7 to
30edfb6
Compare
|
Updated: $ ./boot2docker-linux help 2>&1 | grep vbox
--vbox-share=true: Enable VirtualBox share creation during 'init'
--vbox-share-dir="": Change VirtualBox shared folder created during 'init' from the default autodetection logic
--vbox-share-name="": Change VirtualBox shared folder name created during 'init' from the default of being automatically determined based on the share directory path |
|
testing on OSX by running weirdly, now that I'm using the new master b2d.iso, my vm is getting no nameserver set - need to find out if that's the iso, or some local fluke :( fixed in #545 |
|
yup, |
|
truely horrible UX on windows.
remind me again why its hardcoded at vm boot, rather than setting things up as |
|
I've given you tianon#1 now the help is mildly more helpful, and probably doesn't make the linux version die horribly LGTM once you merge my PR - well, more like 'its a beginning' I'd also load the defined shares into the Machine Config so they print in |
|
@tianon we need something like |
|
I guess the commit/PR title is a bit misleading - I was happy to see that several folders could be passed (which would fulfil my need for mounting both I understand that it would make the current 2-flags-based UI even harder to allow repeated shares though... Maybe allowing repeated |
|
@bjaglin true perhaps a better UX would be which we can then extend as |
|
Ah, I really like that; nice and simple. Although, I'd swap the order and use The only problem left is that the ever-illustrious |
|
Ah, you have to jump through all sorts of hoops. Ok, working on it. |
|
I'd say we should use |
|
|
|
Perhaps we instead check to see if it's a valid directory, and if it isn't, split it and try again? |
|
Oh, yeah. I forgot about |
30edfb6 to
081a853
Compare
|
Updated to use
For example: $ ./boot2docker-linux --vbox-share=/home=Users -v init
...
2014/09/22 12:26:31 executing: VBoxManage sharedfolder add boot2docker-vm --name Users --hostpath /home --automount
... |
can we change to: (the default is lost in the mass of text atm) mmm, this text also implies that I guess you're lucky that |
|
It probably works from the profile file, since that'd just call "set" on each flag defined, right? How's this? |
This includes a new commandline flag to control this behavior, for those who don't want the default (which is currently automount `/Users` for OS X, and automount `C:\Users` for Windows, but will change to automount `homeDir()` at some point in the future). The commandline flag (`--vbox-share=shareDirectory[=shareLabel]`) defines a series of essentially key-value pairs for VirtualBox shared folders in the format `shareDirectory[=shareLabel]`, where `shareLabel` becomes the in-guest mount location (and it defaults to the value of `shareDirectory`). It also supports `--vbox-share=disable` in order to explicitly disable any automatic sharing.
081a853 to
b161571
Compare
|
So that new wording is fine, and can be tweaked even more by subsequent PRs? 😉 |
|
Since the wording was the main gripe here, I'm going to merge now and we can iterate as needed or desired from there. 😉 |
Add VirtualBox shared folders creation
Use 12.04 tag for precise

This includes three new commandline flags to control this behavior, for those who don't want the default (which is currently automount
/Usersfor OS X, and automountC:\Usersfor Windows, but will change to automounthomeDir()at some point in the future):--no-vbox-share=false: Disable VirtualBox share creation during 'init'--vbox-share="": Change VirtualBox shared folder created during 'init' from the default autodetection logic--vbox-share-name="": Change VirtualBox shared folder name created during 'init' from the default of being automatically determined based on the share directory path