diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index fd45b867190d..5bd83debdc03 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -23,6 +23,7 @@ import ( "net" "os" "os/exec" + "os/user" "path/filepath" "runtime" "strconv" @@ -172,6 +173,13 @@ func runStart(cmd *cobra.Command, args []string) { console.OutStyle(console.Happy, "minikube %s on %s (%s)", version.GetVersion(), runtime.GOOS, runtime.GOARCH) validateConfig() + currentUser, err := user.Current() + + // Display warning if minikube is being started with root and vmDriver is not hyperv + if err == nil && currentUser.Name == "root" && viper.GetString(vmDriver) != "hyperv" { + console.OutStyle(console.WarningType, "Please don't run minikube as root or with 'sudo' privileges. It isn't necessary.") + } + oldConfig, err := cfg.Load() if err != nil && !os.IsNotExist(err) { exit.WithCode(exit.Data, "Unable to load config: %v", err)