Local Libvirt
@evrardjp/local-libvirtv2026.05.19.2
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.
02Models
@evrardjp/local-libvirt/vmv2026.05.19.1local_libvirt_vm.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| uri | string | Libvirt 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
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn dumpxml(name: string)
Get raw XML definition of a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn define(xml: string)
Define a VM from XML (create or update persistent config); idempotent — reuses existing UUID
| Argument | Type | Description |
|---|---|---|
| xml | string | Libvirt domain XML |
fn start(name: string)
Start a VM by name; no-op if already running
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn stop(name: string)
Gracefully shut down a VM (ACPI shutdown signal)
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn forceStop(name: string)
Force stop a VM (like pulling the power cord)
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn restart(name: string)
Reboot a running VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn reset(name: string)
Hard reset a VM (no ACPI, immediate reset)
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn suspend(name: string)
Suspend (pause) a running VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn resume(name: string)
Resume a suspended (paused) VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn autostart(name: string, enabled: boolean)
Enable or disable autostart for a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| enabled | boolean | true to enable, false to disable |
fn undefine(name: string, removeStorage: boolean, snapshotsMetadata: boolean)
Undefine a VM (remove its persistent configuration)
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| removeStorage | boolean | Also remove all associated storage volumes |
| snapshotsMetadata | boolean | Also remove snapshot metadata |
fn rename(name: string, newName: string)
Rename a VM (must be shut off)
| Argument | Type | Description |
|---|---|---|
| name | string | Current VM name |
| newName | string | New VM name |
fn save(name: string, file: string)
Save VM state to a file (like hibernate)
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| file | string | Absolute path on this host to save state to |
fn restore(file: string)
Restore a VM from a saved state file
| Argument | Type | Description |
|---|---|---|
| file | string | Absolute path on this host to restore from |
fn setVcpus(name: string, count: number, config: boolean, live: boolean)
Change the number of virtual CPUs
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| count | number | Number of vCPUs |
| config | boolean | Apply to persistent config (next boot) |
| live | boolean | Apply to running VM (hotplug) |
fn setMemory(name: string, sizeMB: number, maximum: boolean, config: boolean, live: boolean)
Change memory allocation (in MiB)
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| sizeMB | number | Memory in MiB |
| maximum | boolean | Set maximum memory instead of current |
| config | boolean | Apply to persistent config |
| live | boolean | Apply to running VM |
fn attachDisk(name: string, source: string, target: string, driver: enum, cache?: enum, persistent: boolean)
Attach a disk device to a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| source | string | Disk source path (image file or block device) |
| target | string | Target device name (e.g. vdb, sdb) |
| driver | enum | Disk driver/format |
| cache? | enum | Cache mode |
| persistent | boolean | Make change persistent across reboots |
fn detachDisk(name: string, target: string, persistent: boolean)
Detach a disk device from a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| target | string | Target device name to detach (e.g. vdb) |
| persistent | boolean | Make change persistent |
fn attachInterface(name: string, type: enum, source: string, model: string, persistent: boolean)
Attach a network interface to a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| type | enum | Interface type |
| source | string | Source bridge/network name (e.g. br0, default) |
| model | string | NIC model (virtio, e1000, rtl8139) |
| persistent | boolean | Make change persistent |
fn detachInterface(name: string, type: enum, mac: string, persistent: boolean)
Detach a network interface from a VM by MAC address
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| type | enum | Interface type |
| mac | string | MAC address of the interface to detach |
| persistent | boolean | Make change persistent |
fn changeMedia(name: string, target: string, source?: string)
Change CD/DVD media for a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| target | string | Target device (e.g. hda, sda) |
| source? | string | New ISO path (omit to eject) |
fn blockList(name: string)
List all block devices for a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn interfaceList(name: string)
List all network interfaces for a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn interfaceAddresses(name: string, source: enum)
Get IP addresses of a VM's interfaces
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| source | enum | Address source: lease (DHCP), agent (guest-agent), arp |
fn blockStats(name: string, device?: string)
Get block device I/O statistics for a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| device? | string | Specific block device (e.g. vda). Omit for all. |
fn interfaceStats(name: string, interface: string)
Get network interface statistics for a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| interface | string | Interface device name (e.g. vnet0) |
fn memoryStats(name: string)
Get memory statistics for a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn cpuStats(name: string)
Get CPU statistics for a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn domstats(name: string)
Get comprehensive statistics for a VM (state, CPU, balloon, vCPU, net, block)
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn snapshotList(name: string)
List all snapshots for a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
fn snapshotCreate(name: string, snapshotName: string, description?: string, quiesce: boolean, diskOnly: boolean)
Create a snapshot of a VM
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| snapshotName | string | Name for the snapshot |
| description? | string | Snapshot description |
| quiesce | boolean | Quiesce guest filesystem (requires guest agent) |
| diskOnly | boolean | Disk-only snapshot (no memory) |
fn snapshotInfo(name: string, snapshotName: string)
Get info about a specific snapshot
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| snapshotName | string | Snapshot name |
fn snapshotRevert(name: string, snapshotName: string, running: boolean, paused: boolean)
Revert a VM to a snapshot
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| snapshotName | string | Snapshot name to revert to |
| running | boolean | Start VM after revert |
| paused | boolean | Leave VM paused after revert |
fn snapshotDelete(name: string, snapshotName: string, children: boolean)
Delete a snapshot
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| snapshotName | string | Snapshot name to delete |
| children | boolean | Also delete child snapshots |
fn snapshotDumpxml(name: string, snapshotName: string)
Get raw XML of a snapshot
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| snapshotName | string | Snapshot name |
fn guestInfo(name: string, types?: string)
Query guest information via QEMU guest agent (hostname, OS, IPs, filesystems, etc.)
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| types? | string | Comma-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)
| Argument | Type | Description |
|---|---|---|
| name | string | VM name |
| username | string | Username inside the guest |
| password | string | New password |
| encrypted | boolean | Password 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
| Argument | Type | Description |
|---|---|---|
| uri | string | Libvirt connection URI |
fn list()
List all virtual networks
fn get(name: string)
Get detailed info for a virtual network including XML config
| Argument | Type | Description |
|---|---|---|
| name | string | Network name |
fn dumpxml(name: string)
Get raw XML definition of a network
| Argument | Type | Description |
|---|---|---|
| name | string | Network name |
fn start(name: string)
Start (activate) a virtual network; no-op if already active
| Argument | Type | Description |
|---|---|---|
| name | string | Network name |
fn stop(name: string)
Stop (deactivate) a virtual network
| Argument | Type | Description |
|---|---|---|
| name | string | Network name |
fn define(xml: string)
Define a virtual network from XML (does not start it)
| Argument | Type | Description |
|---|---|---|
| xml | string | Full libvirt network XML definition |
fn undefine(name: string)
Undefine a virtual network (remove persistent config)
| Argument | Type | Description |
|---|---|---|
| name | string | Network name |
fn autostart(name: string, enabled: boolean)
Enable or disable autostart for a virtual network
| Argument | Type | Description |
|---|---|---|
| name | string | Network name |
| enabled | boolean | true to enable, false to disable |
fn dhcpLeases(name: string)
List DHCP leases for a virtual network
| Argument | Type | Description |
|---|---|---|
| name | string | Network 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
| Argument | Type | Description |
|---|---|---|
| uri | string | Libvirt 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.)
| Argument | Type | Description |
|---|---|---|
| cap? | string | Filter 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
| Argument | Type | Description |
|---|---|---|
| uri | string | Libvirt connection URI |
fn poolList()
List all storage pools
fn poolGet(name: string)
Get detailed info for a storage pool including XML
| Argument | Type | Description |
|---|---|---|
| name | string | Pool name |
fn poolStart(name: string)
Start (activate) a storage pool
| Argument | Type | Description |
|---|---|---|
| name | string | Pool name |
fn poolStop(name: string)
Stop (deactivate) a storage pool
| Argument | Type | Description |
|---|---|---|
| name | string | Pool name |
fn poolDefine(name: string, type: enum, target?: string, sourceHost?: string, sourcePath?: string, sourceFormat?: string)
Define a storage pool from parameters
| Argument | Type | Description |
|---|---|---|
| name | string | Pool name |
| type | enum | Pool type |
| target? | string | Target path (e.g. /var/lib/libvirt/images) |
| sourceHost? | string | Source host for network pools |
| sourcePath? | string | Source path/name |
| sourceFormat? | string | Source format (e.g. nfs, cifs, auto) |
fn poolUndefine(name: string)
Undefine a storage pool (remove persistent config)
| Argument | Type | Description |
|---|---|---|
| name | string | Pool name |
fn poolAutostart(name: string, enabled: boolean)
Enable or disable autostart for a storage pool
| Argument | Type | Description |
|---|---|---|
| name | string | Pool name |
| enabled | boolean | true to enable, false to disable |
fn poolRefresh(name: string)
Refresh a storage pool to discover new volumes
| Argument | Type | Description |
|---|---|---|
| name | string | Pool name |
fn volList(pool: string)
List all volumes in a storage pool
| Argument | Type | Description |
|---|---|---|
| pool | string | Pool name |
fn volGet(name: string, pool: string)
Get detailed info for a storage volume including XML
| Argument | Type | Description |
|---|---|---|
| name | string | Volume name |
| pool | string | Pool name |
fn volCreate(pool: string, name: string, capacity: string, format: enum, allocation?: string)
Create a new storage volume
| Argument | Type | Description |
|---|---|---|
| pool | string | Pool name |
| name | string | Volume name |
| capacity | string | Capacity with unit (e.g. 10G, 500M, 1T) |
| format | enum | Volume format |
| allocation? | string | Initial allocation with unit (for thin provisioning, e.g. 0) |
fn volDelete(name: string, pool: string)
Delete a storage volume
| Argument | Type | Description |
|---|---|---|
| name | string | Volume name |
| pool | string | Pool name |
fn volResize(name: string, pool: string, capacity: string, shrink: boolean)
Resize a storage volume
| Argument | Type | Description |
|---|---|---|
| name | string | Volume name |
| pool | string | Pool name |
| capacity | string | New capacity with unit (e.g. 20G) |
| shrink | boolean | Allow shrinking (data loss risk) |
fn volClone(name: string, pool: string, newName: string)
Clone a storage volume
| Argument | Type | Description |
|---|---|---|
| name | string | Source volume name |
| pool | string | Pool name |
| newName | string | New 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