"use client" import React, { useState } from "react" import Link from "next/link" import { Cpu, ArrowLeft, Copy, Check, Terminal } from "lucide-react" import { Button } from "@/components/ui/button" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion" export default function VMCTCommandsPage() { const [viewMode, setViewMode] = useState<"table" | "accordion">("table") // Group commands by category for better organization const commandGroups = [ { title: "Listing and Information", commands: [ { command: "qm list", description: "List all virtual machines" }, { command: "pct list", description: "List all LXC containers" }, { command: "qm config ", description: "Show VM configuration. Use the correct " }, { command: "pct config ", description: "Show container configuration. Use the correct " }, ], }, { title: "VM Management", commands: [ { command: "qm start ", description: "Start a virtual machine. Use the correct " }, { command: "qm stop ", description: "Force stop a virtual machine. Use the correct " }, { command: "qm shutdown ", description: "Gracefully shutdown a virtual machine" }, { command: "qm reset ", description: "Reset a virtual machine (hard reboot)" }, { command: "qm suspend ", description: "Suspend a virtual machine" }, { command: "qm resume ", description: "Resume a suspended virtual machine" }, { command: "qm destroy ", description: "Delete a VM (irreversible). Use the correct " }, ], }, { title: "Container Management", commands: [ { command: "pct start ", description: "Start a container. Use the correct " }, { command: "pct stop ", description: "Force stop a container. Use the correct " }, { command: "pct shutdown ", description: "Gracefully shutdown a container" }, { command: "pct restart ", description: "Restart a container" }, { command: "pct destroy ", description: "Delete a CT (irreversible). Use the correct " }, ], }, { title: "Container Operations", commands: [ { command: "pct exec -- getent passwd | column -t -s :", description: "Show CT users in table format", }, { command: "pct exec -- ps aux --sort=-%mem | head", description: "Top memory processes in CT", }, { command: "pct enter ", description: "Enter container shell", }, { command: "pct push ", description: "Copy file from host to container", }, { command: "pct pull ", description: "Copy file from container to host", }, ], }, ] return (
Back to Help and Info

VM and CT Management Commands

This section provides commands for managing virtual machines (VMs) and containers (CTs) in Proxmox VE. Learn how to list, start, stop, configure, and perform other operations on your virtualized environments.

{viewMode === "table" ? (
{commandGroups.map((group, index) => (

{group.title}

Command Description Action {group.commands.map((cmd, cmdIndex) => ( {cmd.command} {cmd.description} ))}
))}
) : (
{commandGroups.map((group, index) => (

{group.title}

{group.commands.map((cmd, cmdIndex) => (
{cmd.command}
{cmd.command}

{cmd.description}

))}
))}
)}

Usage Notes

  • Replace <vmid> with the ID of your virtual machine
  • Replace <ctid> with the ID of your container
  • Use qm list or{" "} pct list to find the IDs of your VMs and containers
  • Be careful with destroy commands as they permanently delete the VM or container
) } interface CopyButtonProps { text: string } function CopyButton({ text }: CopyButtonProps) { const [copied, setCopied] = React.useState(false) const copyToClipboard = () => { navigator.clipboard.writeText(text) setCopied(true) setTimeout(() => setCopied(false), 2000) } return ( ) }