diff --git a/cmd/shell.go b/cmd/shell.go index 4f9469d..c3dcdff 100644 --- a/cmd/shell.go +++ b/cmd/shell.go @@ -47,6 +47,10 @@ var shellCmd = &cobra.Command{ return 1 } + if trc != nil { + slog.Info("Tap networking is active", "host-ip", trc.Net.HostIP, "vm-ip", trc.Net.GuestIP) + } + defer func() { _ = sc.Close() }() sess, err := sc.NewSession() @@ -127,13 +131,14 @@ var shellCmd = &cobra.Command{ } return 0 - }, forwardPortRules, true, false)) - // TODO: Enable tap option. + }, forwardPortRules, true, enableTapNetFlag)) }, } var forwardPortsFlagStr string +var enableTapNetFlag bool func init() { shellCmd.Flags().StringVar(&forwardPortsFlagStr, "forward-ports", "", "Extra TCP port forwarding rules. Syntax: ':' OR '::'. Multiple rules split by comma are accepted.") + shellCmd.Flags().BoolVar(&enableTapNetFlag, "enable-net-tap", false, "Enables host-VM tap networking.") } diff --git a/cmd/utils.go b/cmd/utils.go index 7cc6667..3c9348e 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -100,7 +100,6 @@ func runVM(passthroughArg string, fn func(context.Context, *vm.VM, *vm.FileManag } tapNameToUse := nettap.NewRandomTapName() - // TODO: Run two instances at the same time and check whether nothing is wrongfully pruned. knownAllocs, err := store.ListNetTapAllocations() if err != nil { slog.Error("Failed to list net tap allocations", "error", err.Error())