Skip to content

Commit 3ac55df

Browse files
committed
docs: Update mount docs
Add the missing *Mount During Start* section to describe how to mount a directory when starting a cluster. This section describes the new virtiofs mounts introduced in minikube 1.37.0. Rename the *9p Mounts* section to *Mount Command* to make it more clear. This is an alternative for the *Mount During Start* if the user need to mount more than one directory or mount or unmount directories after the cluster was started. Remove the Kubernetes manifest example as it is not specific to mount command. Rename the *Driver Mount* section to *Driver Automatic Mounts* to make it more clear, and remove drivers that do not support this feature. Add *Driver Specific Mounts* for special mount options supported by specific drivers, currently only HyperKit. Reformat text tables to make the source easier to work with. Issues: - Missing `--mount-string` support on Windows and other drivers I'm not sure what works and/or tested and we have too many drivers[1] - Add section for using mounts in Kubernetes manifests? [1] https://minikube.sigs.k8s.io/docs/drivers/
1 parent ee4372f commit 3ac55df

File tree

1 file changed

+64
-55
lines changed

1 file changed

+64
-55
lines changed

site/content/en/docs/handbook/mount.md

Lines changed: 64 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,79 +8,88 @@ aliases:
88
- /docs/tasks/mount
99
---
1010

11-
## 9P Mounts
11+
## Mount During Start
1212

13-
9P mounts are flexible and work across all hypervisors, but suffers from performance and reliability issues when used with large folders (>600 files). See **Driver Mounts** as an alternative.
13+
To mount a directory from the host into the guest using the `start` subcommand
14+
use the `--mount-string` flag:
1415

15-
To mount a directory from the host into the guest using the `mount` subcommand:
16+
```shell
17+
minikube start --mount-string <host directory>:<guest directory>
18+
```
19+
20+
For example, this would mount your `~/models` directory to appear as
21+
`/mnt/models` within the minikube VM.
1622

1723
```shell
18-
minikube mount <source directory>:<target directory>
24+
minikube start ~/models:/mnt/models
1925
```
2026

21-
For example, this would mount your home directory to appear as /host within the minikube VM:
27+
The directory remains mounted while the cluster is running.
28+
29+
The mount will use the best method supported by the driver:
30+
31+
| Driver | OS | Method | Notes |
32+
|----------------|---------|------------------|------------------------|
33+
| docker | Linux | container volume | |
34+
| podman | Linux | container volume | |
35+
| kvm | Linux | 9p | |
36+
| Vfkit | macOS | virtiofs | Since minikube 1.37.0 |
37+
| Krunkit | macOS | virtiofs | Since minikube 1.37.0 |
38+
| qemu | macOS | 9p | |
39+
40+
The `--mount-string` flag supports only a single mount. If you want to mount
41+
additional directories, or mount and unmount directories after the cluster was
42+
started see [Mount Command](#Mount-command).
43+
44+
## Mount Command
45+
46+
The mount command allows mounting and unmounting directories after the minikube
47+
cluster was started using the *9p* filesystem. The command works with all VM
48+
drivers.
49+
50+
To mount a directory from the host into the guest using the `mount` subcommand:
2251

2352
```shell
24-
minikube mount $HOME:/host
53+
minikube mount <host directory>:<guest> directory>
2554
```
2655

27-
This directory may then be referenced from a Kubernetes manifest, for example:
56+
For example, this would mount your `~/models` directory to appear as
57+
`/mnt/models` within the minikube VM:
2858

2959
```shell
30-
{
31-
"apiVersion": "v1",
32-
"kind": "Pod",
33-
"metadata": {
34-
"name": "ubuntu"
35-
},
36-
"spec": {
37-
"containers": [
38-
{
39-
"name": "ubuntu",
40-
"image": "ubuntu:18.04",
41-
"args": ["bash"],
42-
"stdin": true,
43-
"stdinOnce": true,
44-
"tty": true,
45-
"workingDir": "/host",
46-
"volumeMounts": [
47-
{
48-
"mountPath": "/host",
49-
"name": "host-mount"
50-
}
51-
]
52-
}
53-
],
54-
"volumes": [
55-
{
56-
"name": "host-mount",
57-
"hostPath": {
58-
"path": "/host"
59-
}
60-
}
61-
]
62-
}
63-
}
60+
minikube mount ~/models:/mnt/models
6461
```
6562

66-
## Driver mounts
63+
The directory remains mounted while the mount command is running. To unmount the
64+
directory terminate the mount command with `Control+C`.
65+
66+
*9p* mounts are flexible and work across all hypervisors, but suffers from
67+
performance and reliability issues when used with large folders (>600 files).
68+
See [Driver Automatic Mounts](#driver-automatic-mounts) and
69+
[Driver Specific Mounts](#driver-specific-mounts) as alternatives.
70+
71+
## Driver automatic mounts
72+
73+
Some hypervisors, have built-in host folder sharing. Driver mounts are reliable
74+
with good performance, but the paths may differ across operating systems or
75+
hypervisors:
6776

68-
Some hypervisors, have built-in host folder sharing. Driver mounts are reliable with good performance, but the paths are not predictable across operating systems or hypervisors:
77+
| Driver | OS | Host | Guest |
78+
|----------------|---------|--------------|-------------------|
79+
| VirtualBox | Linux | /home | /hosthome |
80+
| VirtualBox | macOS | /Users | /Users |
81+
| VirtualBox | Windows | C://Users | /c/Users |
82+
| VMware Fusion | macOS | /Users | /mnt/hgfs/Users |
6983

70-
| Driver | OS | HostFolder | VM |
71-
| --- | --- | --- | --- |
72-
| VirtualBox | Linux | /home | /hosthome |
73-
| VirtualBox | macOS | /Users | /Users |
74-
| VirtualBox | Windows | C://Users | /c/Users |
75-
| VMware Fusion | macOS | /Users | /mnt/hgfs/Users |
76-
| KVM | Linux | Unsupported | |
77-
| HyperKit | macOS | Supported | |
84+
Built-in mounts can be disabled by passing the `--disable-driver-mounts` flag to
85+
`minikube start`.
7886

79-
These mounts can be disabled by passing `--disable-driver-mounts` to `minikube start`.
87+
## Driver Specific Mounts
8088

81-
HyperKit mounts can use the following flags:
82-
`--nfs-share=[]`: Local folders to share with Guest via NFS mounts
83-
`--nfs-shares-root='/nfsshares'`: Where to root the NFS Shares, defaults to /nfsshares
89+
HyperKit driver can also use the following start flags:
90+
- `--nfs-share=[]`: Local folders to share with Guest via NFS mounts
91+
- `--nfs-shares-root='/nfsshares'`: Where to mount the NFS Shares, defaults to
92+
`/nfsshares`
8493

8594
## File Sync
8695

0 commit comments

Comments
 (0)