<p>I'm using Minikube for working with Kubernetes on my local machine, and would like to run a command on the VM just after startup (preferably before the Pods start). I can run it manually with <code>minikube ssh</code>, but that's a bit of a pain to do after every restart, and is difficult to wrap in a script.</p>

<p>Is there an easy way to do this?</p>

<p>The command in my case is this, so that paths on the VM match paths on my host machine:</p>

<pre><code>sudo mount --bind /hosthome/&lt;user&gt; /home/&lt;user&gt;
</code></pre>

<p>Maybe flags which can you pass to <code>minikube start</code> would be useful in your case:</p>

<pre><code>  --mount                          This will start the mount daemon and automatically mount files into minikube
  --mount-string string            The argument to pass the minikube mount command on start (default "/home/user:/minikube-host")
</code></pre>

<p>Edit:
Maybe you could write script for starting your minikube like: </p>

<pre><code>minikube start &amp;&amp; ssh -t -i ~/.minikube/machines/minikube/id_rsa docker@$(minikube ip) "sudo mount --bind /hosthome/&lt;user&gt; /home/&lt;user&gt;"
</code></pre>

<p>that will start minikube and issue bind command using SSH after start</p>
