/linux:linux-virtualizationfrom linux
Operates KVM/libvirt VMs and LXD system containers: lifecycle, snapshots, backups, storage, networking, and host inspection on Linux hosts.
Ships in linux. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Two-family skill. KVM/libvirt (virsh, virt-install) is portable across both
families; LXD system containers are Ubuntu-centric (Canonical/snap) with no
native LXD on RHEL. Body uses Debian/Ubuntu; substitute per this matrix.
Application containers (Docker/Podman) moved out of this skill. For the container engine, running containers, and image cleanup, use the
12-containers-and-orchestrationskills:linux-container-engine(install/configure Docker & Podman),linux-container-deployment(run containers, compose, systemd/Quadlet), andlinux-image-hygiene(prune images/volumes). This skill keeps KVM/libvirt VMs and LXD system containers only.
| Concept | Debian/Ubuntu | RHEL family |
|---|---|---|
| System containers | LXD (snap) | systemd-nspawn (no native LXD); Podman for app containers |
| VMs (KVM) | qemu-kvm, libvirt-daemon-system | qemu-kvm, libvirt |
| Manage VMs | virsh, virt-install | identical |
| VM/container firewall | ufw (known quirks) | firewalld + nftables |
| LXD volume labeling | n/a | SELinux: mount with :z/:Z for host-shared storage |
RHEL-family notes: LXD is Ubuntu-centric and not native on RHEL — on the
RHEL family use systemd-nspawn for system containers and Podman for
application containers (see linux-container-engine). KVM/libvirt is identical
across families. SELinux relabels bind-mounted host storage — append :z
(shared) or :Z (private). See
../../07-security-and-hardening/linux-server-hardening/references/selinux-reference.md
and ../../docs/multi-distro/plan.md.
12-containers-and-orchestration skills (linux-container-engine, linux-container-deployment, linux-image-hygiene).linux-config-management.| Artefact | Source | Required? | If absent |
|---|---|---|---|
| Host family, hypervisor/container layer, target identity, and desired lifecycle outcome | Operator and host inventory | required | Discover read-only; do not act on an ambiguous name. |
| Current guest definition, storage/network attachments, state, and host capacity | libvirt/LXD host | required for mutation | Return a preflight report only. |
| Backup/snapshot policy, downtime window, recovery target, and change authority | Workload owner | required for destructive or disruptive action | Stop before mutation. |
| Artefact | Consumer | Acceptance condition |
|---|---|---|
| Guest diagnosis or lifecycle action | Virtualisation operator | Correct target/layer is identified and host plus guest state match the requested outcome. |
| Snapshot/backup/recovery record | Workload owner | Artifact location, consistency method, retention, restore command, and verification are recorded. |
| Capacity and impact evidence | Infrastructure owner | CPU, memory, storage, network attachments, downtime, and rollback are checked before change. |
references/lxd-reference.mdlinux-container-engine, linux-container-deployment, and linux-image-hygiene in 12-containers-and-orchestration.| Artefact | Acceptance condition |
|---|---|
| Virtualisation evidence | Includes target definition, host capacity, attachments, state/logs, backup or snapshot identity/location, lifecycle result, and workload health. |
Inspection defaults to read-only. Read/execute access to the host is required. Start/stop, snapshot, backup, resize, migration, XML/profile edits, storage/network changes, or deletion require explicit authority. Deletion and overwrite require named target verification and a recoverable backup.
Without host or guest access, review supplied definitions/logs and mark capacity, storage consistency, runtime, and workload health not assessed. Without a verified backup or recovery path, stop before destructive or irreversible work.
| Choice | Action | Failure or risk avoided |
|---|---|---|
| Full OS isolation/legacy kernel workload | Use KVM/libvirt | Container-host coupling. |
| Lightweight system container on supported Ubuntu host | Use LXD | Unneeded VM overhead. |
| Packaged application container | Route to category 12 | Competing lifecycle tools. |
Before changing a production libvirt VM, identify its disks and networks, check host capacity, create an application-consistent backup to independent storage, record restore steps, take a short-lived snapshot, apply the approved change, verify guest and application health, then remove the snapshot only after the retention gate.
This skill is self-contained. Every command below uses standard tools
(lxc, virsh); the body shows Debian/Ubuntu, with RHEL-family substitutions
(SELinux :z/:Z) per the Distro support matrix above. The sk-* scripts
in the Optional fast path section are convenience wrappers — never required.
This skill owns the VM and system-container layer on a host: LXD system containers (Canonical's native, Ubuntu-centric) and KVM/libvirt for full virtual machines.
It does not own:
12-containers-and-orchestration skills: linux-container-engine,
linux-container-deployment, linux-image-hygiene.Informed by the Canonical Ubuntu Server Guide (LXD, KVM chapters).
linux-container-deployment (engine setup: linux-container-engine).linux-site-deployment.linux-firewall-ssl.lxc (the LXD CLI) is the modern, declarative
wrapper. Direct lxc-* (legacy) commands are discouraged.limits.memory, limits.cpu, and limits.disk in
every profile.# List all containers
lxc list
lxc list -f compact # compact format
lxc info <name> # detailed state, IP, resource use
# Launch and basic lifecycle
lxc launch ubuntu:24.04 web01
lxc exec web01 -- bash
lxc stop web01
lxc start web01
lxc delete web01 --force
# Snapshots
lxc snapshot web01 before-upgrade-2026-04-10
lxc info web01 | grep -A10 Snapshots
lxc restore web01 before-upgrade-2026-04-10
lxc delete web01/before-upgrade-2026-04-10 # delete a snapshot
# Full export / backup
lxc export web01 /backups/lxd/web01-$(date +%Y%m%d).tar.gz
lxc import /backups/lxd/web01-20260410.tar.gz
# Resource limits (applied to running container)
lxc config set web01 limits.memory 1GB
lxc config set web01 limits.cpu 2
lxc config device override web01 root size=10GB
# Copy between hosts
lxc remote add remotehost <ip>
lxc copy web01 remotehost:web01-copy
Full LXD reference (lxd init, profiles, storage backends, networks,
cloud-init integration, 6 worked examples) — see
references/lxd-reference.md.
Docker / Podman application containers are no longer covered here. Use the
12-containers-and-orchestrationskills:linux-container-engine,linux-container-deployment, andlinux-image-hygiene.
sudo virsh list --all # all VMs
sudo virsh dominfo <vm>
sudo virsh start <vm>
sudo virsh shutdown <vm> # graceful (via ACPI)
sudo virsh destroy <vm> # hard power-off
sudo virsh snapshot-create-as <vm> snap-before-upgrade
sudo virsh snapshot-list <vm>
sudo virsh snapshot-revert <vm> snap-before-upgrade
echo "=== LXD ==="
lxc list 2>/dev/null || echo "(lxd not installed)"
echo
echo "=== KVM ==="
sudo virsh list --all 2>/dev/null || echo "(libvirt not installed)"
(For Docker/Podman containers on the host, use sk-container-ps from
linux-container-deployment.)
lxc snapshot web-prod before-upgrade-$(date +%Y%m%d-%H%M)
# ... do the risky thing ...
# If it breaks:
lxc restore web-prod before-upgrade-20260410-1530
# When confirmed stable, delete the snapshot:
lxc delete web-prod/before-upgrade-20260410-1530
DEST=/backups/lxd
mkdir -p "$DEST"
lxc export web-prod "$DEST/web-prod-$(date +%Y%m%d).tar.gz"
# Then ship off-host:
rclone copy "$DEST/web-prod-$(date +%Y%m%d).tar.gz" gdrive:lxd-backups/
lxc info web01 | grep -A10 -E 'Status|Log'
lxc info --show-log web01
# Resource limits too tight?
lxc config show web01 | grep -E 'limits\.'
(For "why won't this Docker/Podman container start?" use
linux-container-deployment.)
lxdbr0
by default; if the bridge has no DHCP server, set a static IP in the
profile or container config.uid 1000 inside = uid 1001000 outside). Use
lxc file push/pull to move files without fighting ownership.references/lxd-reference.md — full LXD
reference: init, profiles, storage, networks, 6 worked examples.linux-container-engine,
linux-container-deployment, linux-image-hygiene in
12-containers-and-orchestration.../../07-security-and-hardening/linux-server-hardening/references/selinux-reference.md — SELinux volume labeling (RHEL family)lxc(1), virsh(1).Running sudo install-skills-bin linux-virtualization installs:
| Task | Fast-path script |
|---|
These are optional wrappers. The lxc and virsh commands above are the
source of truth. For Docker/Podman, see sk-container-ps /
sk-container-prune in 12-containers-and-orchestration.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub peterbamuhigire/linux-skills --plugin linux45 skills in this plugin
/cisco-ios-patternsUse when reading or reviewing Cisco IOS/IOS-XE configuration, selecting read-only show commands, or planning and verifying bounded router or switch configuration work. Not for Linux host networking, bulk SSH automation, or config preflight parsing; route those to linux-network-admin, netmiko-ssh-automation, or network-config-validation./linux-access-controlUse when creating, revoking, or auditing Linux users, groups, SSH keys, sudo/wheel access, PAM settings, SELinux user mappings, or file permissions. Use linux-secrets for credential material and linux-server-hardening for broader host policy./linux-archive-integrityUse when creating, signing, encrypting, listing, comparing, or restoring metadata-preserving tar archives on Debian/Ubuntu or RHEL-family hosts. Covers ACLs, xattrs, incrementals, and verification; use linux-rsync-sync for file-tree mirrors.Other plugins' skills for the same job