Skip to content

Commit ae5f8a4

Browse files
authored
Merge pull request #265 from AkihiroSuda/vmnet-nits
vmnet nits
2 parents dac956c + 25c1581 commit ae5f8a4

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

cmd/limactl/sudoers.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,25 @@ package main
33
import (
44
"errors"
55
"fmt"
6+
"os"
7+
"path/filepath"
68
"runtime"
79

810
"github.com/lima-vm/lima/pkg/networks"
911
"github.com/spf13/cobra"
1012
)
1113

1214
func newSudoersCommand() *cobra.Command {
15+
networksMD := "$PREFIX/share/doc/lima/docs/network.md"
16+
if exe, err := os.Executable(); err == nil {
17+
binDir := filepath.Dir(exe)
18+
prefixDir := filepath.Dir(binDir)
19+
networksMD = filepath.Join(prefixDir, "share/doc/lima/docs/network.md")
20+
}
1321
sudoersCommand := &cobra.Command{
1422
Use: "sudoers [SUDOERSFILE]",
15-
Short: "Generate /etc/sudoers.d/lima file.",
23+
Short: "Generate /etc/sudoers.d/lima file for enabling vmnet.framework support",
24+
Long: fmt.Sprintf("Generate /etc/sudoers.d/lima file for enabling vmnet.framework support.\nSee %s for the usage.", networksMD),
1625
Args: cobra.MaximumNArgs(1),
1726
RunE: sudoersAction,
1827
}
@@ -67,4 +76,4 @@ func verifySudoAccess(args []string) error {
6776
}
6877
fmt.Printf("%q is up-to-date (or sudo doesn't require a password)\n", file)
6978
return nil
70-
}
79+
}

examples/vmnet.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Example to enable vmnet.framework
2+
# This example requires Lima v0.7.0 or later.
3+
# Older versions of Lima were using a different syntax for supporting vmnet.framework.
14
images:
25
# Hint: run `limactl prune` to invalidate the "current" cache
36
- location: "https://cloud-images.ubuntu.com/hirsute/current/hirsute-server-cloudimg-amd64.img"

0 commit comments

Comments
 (0)