diff --git a/cmd/root.go b/cmd/root.go index e4c7f9b..67781d5 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -44,8 +44,8 @@ func init() { rootCmd.AddCommand(cleanCmd) rootCmd.AddCommand(buildCmd) - rootCmd.PersistentFlags().BoolVar(&vmDebugFlag, "vmdebug", false, "Enables the VM debug mode. This will open an accessible VM monitor. You can log in with root user and no password.") - rootCmd.PersistentFlags().BoolVar(&unrestrictedNetworkingFlag, "unrestricted-networking", false, "Enables unrestricted networking. This will allow the VM to connect to the internet.") + rootCmd.PersistentFlags().BoolVar(&vmDebugFlag, "vm-debug", false, "Enables the VM debug mode. This will open an accessible VM monitor. You can log in with root user and no password.") + rootCmd.PersistentFlags().BoolVar(&unrestrictedNetworkingFlag, "vm-unrestricted-networking", false, "Enables unrestricted networking. This will allow the VM to connect to the internet.") rootCmd.PersistentFlags().Uint32Var(&vmMemAllocFlag, "vm-mem-alloc", 512, "Specifies the VM memory allocation in KiB") rootCmd.PersistentFlags().Uint32Var(&vmOSUpTimeoutFlag, "vm-os-up-timeout", 30, "Specifies the VM OS-up timeout in seconds.") rootCmd.PersistentFlags().Uint32Var(&vmSSHSetupTimeoutFlag, "vm-ssh-setup-timeout", 60, "Specifies the VM SSH server setup timeout in seconds. This cannot be lower than the OS-up timeout.") diff --git a/cmd/shell.go b/cmd/shell.go index 214d432..ad20826 100644 --- a/cmd/shell.go +++ b/cmd/shell.go @@ -39,6 +39,10 @@ var shellCmd = &cobra.Command{ forwardPortRules = append(forwardPortRules, fpr) } + if !unrestrictedNetworkingFlag { + slog.Warn("IMPORTANT: By default, Linsk shell starts a VM with restricted networking as it's done with `run` command. This means that you will have no internet access in the shell. If you want to have access to the internet, please add `--vm-unrestricted-networking` flag to your `linsk shell` command.") + } + os.Exit(runVM(passthroughArg, func(ctx context.Context, i *vm.VM, fm *vm.FileManager) int { sc, err := i.DialSSH() if err != nil { diff --git a/vm/vm.go b/vm/vm.go index 7632e44..7151058 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -306,7 +306,7 @@ func (vm *VM) Run() error { go func() { select { case <-time.After(vm.osUpTimeout): - vm.logger.Warn("A VM boot timeout detected, consider running with --vmdebug to investigate") + vm.logger.Warn("A VM boot timeout detected, consider running with --vm-debug to investigate") globalErrFn(fmt.Errorf("vm boot timeout %v", utils.GetLogErrMsg(string(vm.consumeSerialStdout()), "serial log"))) case <-bootReadyCh: vm.logger.Info("The VM is up, setting it up")