Skip to content

Commit 9d2ebb6

Browse files
committed
Add --vmwarefusion-no-share option
Add a vmwarefusion driver flag to disable the mounting of the /Users directory. Name it --vmwarefusion-no-share to reflect the pre-existing virtualbox driver option --virtualbox-no-share. Also add a corresponding environment variable FUSION_NO_SHARE. The code is basically identical to the virtualbox driver's implementation. Signed-off-by: Joachim Viide <jviide@iki.fi>
1 parent 43d9df3 commit 9d2ebb6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/drivers/vm-fusion.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Options:
1717
- `--vmwarefusion-cpu-count`: Number of CPUs for the machine (-1 to use the number of CPUs available)
1818
- `--vmwarefusion-disk-size`: Size of disk for host VM (in MB).
1919
- `--vmwarefusion-memory-size`: Size of memory for host VM (in MB).
20+
- `--vmwarefusion-no-share`: Disable the mount of your home directory.
2021

2122
The VMware Fusion driver uses the latest boot2docker image.
2223
See [frapposelli/boot2docker](https://github.com/frapposelli/boot2docker/tree/vmware-64bit)
@@ -29,3 +30,4 @@ Environment variables and default values:
2930
| `--vmwarefusion-cpu-count` | `FUSION_CPU_COUNT` | `1` |
3031
| `--vmwarefusion-disk-size` | `FUSION_DISK_SIZE` | `20000` |
3132
| `--vmwarefusion-memory-size` | `FUSION_MEMORY_SIZE` | `1024` |
33+
| `--vmwarefusion-no-share` | `FUSION_NO_SHARE` | `false` |

drivers/vmwarefusion/fusion.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type Driver struct {
4646
SSHPassword string
4747
ConfigDriveISO string
4848
ConfigDriveURL string
49+
NoShare bool
4950
}
5051

5152
const (
@@ -102,6 +103,11 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag {
102103
Usage: "SSH password",
103104
Value: defaultSSHPass,
104105
},
106+
mcnflag.BoolFlag{
107+
EnvVar: "FUSION_NO_SHARE",
108+
Name: "vmwarefusion-no-share",
109+
Usage: "Disable the mount of your home directory",
110+
},
105111
}
106112
}
107113

@@ -150,6 +156,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
150156
d.SSHUser = flags.String("vmwarefusion-ssh-user")
151157
d.SSHPassword = flags.String("vmwarefusion-ssh-password")
152158
d.SSHPort = 22
159+
d.NoShare = flags.Bool("vmwarefusion-no-share")
153160

154161
// We support a maximum of 16 cpu to be consistent with Virtual Hardware 10
155162
// specs.
@@ -344,7 +351,7 @@ func (d *Driver) Create() error {
344351
// TODO "linux" and "windows"
345352
}
346353

347-
if shareDir != "" {
354+
if shareDir != "" && !d.NoShare {
348355
if _, err := os.Stat(shareDir); err != nil && !os.IsNotExist(err) {
349356
return err
350357
} else if !os.IsNotExist(err) {

0 commit comments

Comments
 (0)