Skip to main content

Local Libvirt

@evrardjp/local-libvirtv2026.05.19.2· 3d agoMODELS
01README

Local libvirt/virsh management via URI — VMs, networks, storage pools, volumes, snapshots, and host info. Fork of @magistr/libvirt adapted for non-SSH (local or custom URI) connections.

02Models4
@evrardjp/local-libvirt/vmv2026.05.19.1local_libvirt_vm.ts

Global Arguments

ArgumentTypeDescription
uristringLibvirt connection URI
fn list()
List all VMs with state, vCPUs, memory, and autostart
fn get(name: string)
Get detailed VM info including disks, NICs, and graphics
ArgumentTypeDescription
namestringVM name
fn dumpxml(name: string)
Get raw XML definition of a VM
ArgumentTypeDescription
namestringVM name
fn define(xml: string)
Define a VM from XML (create or update persistent config); idempotent — reuses existing UUID
ArgumentTypeDescription
xmlstringLibvirt domain XML
fn start(name: string)
Start a VM by name; no-op if already running
ArgumentTypeDescription
namestringVM name
fn stop(name: string)
Gracefully shut down a VM (ACPI shutdown signal)
ArgumentTypeDescription
namestringVM name
fn forceStop(name: string)
Force stop a VM (like pulling the power cord)
ArgumentTypeDescription
namestringVM name
fn restart(name: string)
Reboot a running VM
ArgumentTypeDescription
namestringVM name
fn reset(name: string)
Hard reset a VM (no ACPI, immediate reset)
ArgumentTypeDescription
namestringVM name
fn suspend(name: string)
Suspend (pause) a running VM
ArgumentTypeDescription
namestringVM name
fn resume(name: string)
Resume a suspended (paused) VM
ArgumentTypeDescription
namestringVM name
fn autostart(name: string, enabled: boolean)
Enable or disable autostart for a VM
ArgumentTypeDescription
namestringVM name
enabledbooleantrue to enable, false to disable
fn undefine(name: string, removeStorage: boolean, snapshotsMetadata: boolean)
Undefine a VM (remove its persistent configuration)
ArgumentTypeDescription
namestringVM name
removeStoragebooleanAlso remove all associated storage volumes
snapshotsMetadatabooleanAlso remove snapshot metadata
fn rename(name: string, newName: string)
Rename a VM (must be shut off)
ArgumentTypeDescription
namestringCurrent VM name
newNamestringNew VM name
fn save(name: string, file: string)
Save VM state to a file (like hibernate)
ArgumentTypeDescription
namestringVM name
filestringAbsolute path on this host to save state to
fn restore(file: string)
Restore a VM from a saved state file
ArgumentTypeDescription
filestringAbsolute path on this host to restore from
fn setVcpus(name: string, count: number, config: boolean, live: boolean)
Change the number of virtual CPUs
ArgumentTypeDescription
namestringVM name
countnumberNumber of vCPUs
configbooleanApply to persistent config (next boot)
livebooleanApply to running VM (hotplug)
fn setMemory(name: string, sizeMB: number, maximum: boolean, config: boolean, live: boolean)
Change memory allocation (in MiB)
ArgumentTypeDescription
namestringVM name
sizeMBnumberMemory in MiB
maximumbooleanSet maximum memory instead of current
configbooleanApply to persistent config
livebooleanApply to running VM
fn attachDisk(name: string, source: string, target: string, driver: enum, cache?: enum, persistent: boolean)
Attach a disk device to a VM
ArgumentTypeDescription
namestringVM name
sourcestringDisk source path (image file or block device)
targetstringTarget device name (e.g. vdb, sdb)
driverenumDisk driver/format
cache?enumCache mode
persistentbooleanMake change persistent across reboots
fn detachDisk(name: string, target: string, persistent: boolean)
Detach a disk device from a VM
ArgumentTypeDescription
namestringVM name
targetstringTarget device name to detach (e.g. vdb)
persistentbooleanMake change persistent
fn attachInterface(name: string, type: enum, source: string, model: string, persistent: boolean)
Attach a network interface to a VM
ArgumentTypeDescription
namestringVM name
typeenumInterface type
sourcestringSource bridge/network name (e.g. br0, default)
modelstringNIC model (virtio, e1000, rtl8139)
persistentbooleanMake change persistent
fn detachInterface(name: string, type: enum, mac: string, persistent: boolean)
Detach a network interface from a VM by MAC address
ArgumentTypeDescription
namestringVM name
typeenumInterface type
macstringMAC address of the interface to detach
persistentbooleanMake change persistent
fn changeMedia(name: string, target: string, source?: string)
Change CD/DVD media for a VM
ArgumentTypeDescription
namestringVM name
targetstringTarget device (e.g. hda, sda)
source?stringNew ISO path (omit to eject)
fn blockList(name: string)
List all block devices for a VM
ArgumentTypeDescription
namestringVM name
fn interfaceList(name: string)
List all network interfaces for a VM
ArgumentTypeDescription
namestringVM name
fn interfaceAddresses(name: string, source: enum)
Get IP addresses of a VM's interfaces
ArgumentTypeDescription
namestringVM name
sourceenumAddress source: lease (DHCP), agent (guest-agent), arp
fn blockStats(name: string, device?: string)
Get block device I/O statistics for a VM
ArgumentTypeDescription
namestringVM name
device?stringSpecific block device (e.g. vda). Omit for all.
fn interfaceStats(name: string, interface: string)
Get network interface statistics for a VM
ArgumentTypeDescription
namestringVM name
interfacestringInterface device name (e.g. vnet0)
fn memoryStats(name: string)
Get memory statistics for a VM
ArgumentTypeDescription
namestringVM name
fn cpuStats(name: string)
Get CPU statistics for a VM
ArgumentTypeDescription
namestringVM name
fn domstats(name: string)
Get comprehensive statistics for a VM (state, CPU, balloon, vCPU, net, block)
ArgumentTypeDescription
namestringVM name
fn snapshotList(name: string)
List all snapshots for a VM
ArgumentTypeDescription
namestringVM name
fn snapshotCreate(name: string, snapshotName: string, description?: string, quiesce: boolean, diskOnly: boolean)
Create a snapshot of a VM
ArgumentTypeDescription
namestringVM name
snapshotNamestringName for the snapshot
description?stringSnapshot description
quiescebooleanQuiesce guest filesystem (requires guest agent)
diskOnlybooleanDisk-only snapshot (no memory)
fn snapshotInfo(name: string, snapshotName: string)
Get info about a specific snapshot
ArgumentTypeDescription
namestringVM name
snapshotNamestringSnapshot name
fn snapshotRevert(name: string, snapshotName: string, running: boolean, paused: boolean)
Revert a VM to a snapshot
ArgumentTypeDescription
namestringVM name
snapshotNamestringSnapshot name to revert to
runningbooleanStart VM after revert
pausedbooleanLeave VM paused after revert
fn snapshotDelete(name: string, snapshotName: string, children: boolean)
Delete a snapshot
ArgumentTypeDescription
namestringVM name
snapshotNamestringSnapshot name to delete
childrenbooleanAlso delete child snapshots
fn snapshotDumpxml(name: string, snapshotName: string)
Get raw XML of a snapshot
ArgumentTypeDescription
namestringVM name
snapshotNamestringSnapshot name
fn guestInfo(name: string, types?: string)
Query guest information via QEMU guest agent (hostname, OS, IPs, filesystems, etc.)
ArgumentTypeDescription
namestringVM name
types?stringComma-separated types: users, os, timezone, hostname, filesystem, disk, interface (omit for all)
fn setUserPassword(name: string, username: string, password: string, encrypted: boolean)
Set a user password inside the guest (requires guest agent)
ArgumentTypeDescription
namestringVM name
usernamestringUsername inside the guest
passwordstringNew password
encryptedbooleanPassword is already encrypted/hashed

Resources

vm(infinite)— VM list or detail
actionResult(1h)— Result of a VM action
snapshot(infinite)— Snapshot list or detail
stats(1h)— VM statistics (block, interface, memory, CPU)
@evrardjp/local-libvirt/networkv2026.05.19.1local_libvirt_network.ts

Global Arguments

ArgumentTypeDescription
uristringLibvirt connection URI
fn list()
List all virtual networks
fn get(name: string)
Get detailed info for a virtual network including XML config
ArgumentTypeDescription
namestringNetwork name
fn dumpxml(name: string)
Get raw XML definition of a network
ArgumentTypeDescription
namestringNetwork name
fn start(name: string)
Start (activate) a virtual network; no-op if already active
ArgumentTypeDescription
namestringNetwork name
fn stop(name: string)
Stop (deactivate) a virtual network
ArgumentTypeDescription
namestringNetwork name
fn define(xml: string)
Define a virtual network from XML (does not start it)
ArgumentTypeDescription
xmlstringFull libvirt network XML definition
fn undefine(name: string)
Undefine a virtual network (remove persistent config)
ArgumentTypeDescription
namestringNetwork name
fn autostart(name: string, enabled: boolean)
Enable or disable autostart for a virtual network
ArgumentTypeDescription
namestringNetwork name
enabledbooleantrue to enable, false to disable
fn dhcpLeases(name: string)
List DHCP leases for a virtual network
ArgumentTypeDescription
namestringNetwork name

Resources

network(infinite)— Virtual network list or detail
dhcpLeases(1h)— DHCP leases for a network
actionResult(1h)— Result of a network action
@evrardjp/local-libvirt/hostv2026.05.19.1local_libvirt_host.ts

Global Arguments

ArgumentTypeDescription
uristringLibvirt connection URI
fn info()
Get hypervisor host info (CPU, memory, versions)
fn capabilities()
Get hypervisor capabilities XML
fn sysinfo()
Get host system information (SMBIOS/DMI data)
fn cpuStats()
Get host CPU usage statistics
fn memStats()
Get host memory statistics
fn deviceList(cap?: string)
List node devices (PCI, USB, network, storage controllers, etc.)
ArgumentTypeDescription
cap?stringFilter by capability: system, pci, usb, usb_device, net, scsi_host, scsi, storage, drm

Resources

info(infinite)— Hypervisor host information
stats(1h)— Host statistics (CPU, memory)
devices(infinite)— Node device list
@evrardjp/local-libvirt/storagev2026.05.19.1local_libvirt_storage.ts

Global Arguments

ArgumentTypeDescription
uristringLibvirt connection URI
fn poolList()
List all storage pools
fn poolGet(name: string)
Get detailed info for a storage pool including XML
ArgumentTypeDescription
namestringPool name
fn poolStart(name: string)
Start (activate) a storage pool
ArgumentTypeDescription
namestringPool name
fn poolStop(name: string)
Stop (deactivate) a storage pool
ArgumentTypeDescription
namestringPool name
fn poolDefine(name: string, type: enum, target?: string, sourceHost?: string, sourcePath?: string, sourceFormat?: string)
Define a storage pool from parameters
ArgumentTypeDescription
namestringPool name
typeenumPool type
target?stringTarget path (e.g. /var/lib/libvirt/images)
sourceHost?stringSource host for network pools
sourcePath?stringSource path/name
sourceFormat?stringSource format (e.g. nfs, cifs, auto)
fn poolUndefine(name: string)
Undefine a storage pool (remove persistent config)
ArgumentTypeDescription
namestringPool name
fn poolAutostart(name: string, enabled: boolean)
Enable or disable autostart for a storage pool
ArgumentTypeDescription
namestringPool name
enabledbooleantrue to enable, false to disable
fn poolRefresh(name: string)
Refresh a storage pool to discover new volumes
ArgumentTypeDescription
namestringPool name
fn volList(pool: string)
List all volumes in a storage pool
ArgumentTypeDescription
poolstringPool name
fn volGet(name: string, pool: string)
Get detailed info for a storage volume including XML
ArgumentTypeDescription
namestringVolume name
poolstringPool name
fn volCreate(pool: string, name: string, capacity: string, format: enum, allocation?: string)
Create a new storage volume
ArgumentTypeDescription
poolstringPool name
namestringVolume name
capacitystringCapacity with unit (e.g. 10G, 500M, 1T)
formatenumVolume format
allocation?stringInitial allocation with unit (for thin provisioning, e.g. 0)
fn volDelete(name: string, pool: string)
Delete a storage volume
ArgumentTypeDescription
namestringVolume name
poolstringPool name
fn volResize(name: string, pool: string, capacity: string, shrink: boolean)
Resize a storage volume
ArgumentTypeDescription
namestringVolume name
poolstringPool name
capacitystringNew capacity with unit (e.g. 20G)
shrinkbooleanAllow shrinking (data loss risk)
fn volClone(name: string, pool: string, newName: string)
Clone a storage volume
ArgumentTypeDescription
namestringSource volume name
poolstringPool name
newNamestringNew cloned volume name

Resources

pool(infinite)— Storage pool list or detail
volume(infinite)— Storage volume list or detail
actionResult(1h)— Result of a storage action
03Stats
A
100 / 100
Downloads
4
Archive size
31.3 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
04Platforms
05Labels