MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / newGuestsShellCmd

Function newGuestsShellCmd

internal/cli/guests.go:621–644  ·  view source on GitHub ↗

── guests shell ─────────────────────────────────────────────────────────────

()

Source from the content-addressed store, hash-verified

619// ── guests shell ─────────────────────────────────────────────────────────────
620
621func newGuestsShellCmd() *cobra.Command {
622 return &cobra.Command{
623 Use: "shell <vmid>",
624 Short: "Open an interactive shell inside a guest",
625 Long: `Open an interactive shell inside a running guest.
626
627For LXC containers: SSHes to the Proxmox node and runs 'pct enter <vmid>'
628(NixOS containers are detected automatically and use 'pct exec' instead).
629Requires ssh_user to be configured.
630
631For QEMU VMs: opens a direct SSH connection to the VM's IP address.
632Requires the VM to have an IP address visible to pvetui (e.g. via QEMU guest
633agent) and vm_ssh_user (or ssh_user as fallback) to be configured.
634
635Authentication follows the standard SSH priority: agent > configured keyfile
636> ~/.ssh defaults.`,
637 Example: ` pvetui guests shell 100
638 pvetui --profile prod guests shell 200
639 pvetui --ssh-user root guests shell 100`,
640 Args: cobra.ExactArgs(1),
641 RunE: runGuestsShell,
642 ValidArgsFunction: completeVMIDs,
643 }
644}
645
646func runGuestsShell(cmd *cobra.Command, args []string) error {
647 vmid, err := parseVMID(args[0])

Callers 1

newGuestsCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected