{"id":47821888,"url":"https://github.com/unraid/libvirt","last_synced_at":"2026-04-03T19:12:24.259Z","repository":{"id":277574561,"uuid":"627189949","full_name":"unraid/libvirt","owner":"unraid","description":"Libvirt Bindings for Unraid, Forked from @vmngr/libvirt","archived":false,"fork":false,"pushed_at":"2026-04-01T19:42:27.000Z","size":480,"stargazers_count":7,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-02T07:24:50.476Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unraid.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-13T00:57:32.000Z","updated_at":"2026-03-31T06:41:52.000Z","dependencies_parsed_at":"2025-03-01T00:24:41.925Z","dependency_job_id":"0a9ad7a7-bd43-40cd-83b7-3b6a2fd20706","html_url":"https://github.com/unraid/libvirt","commit_stats":null,"previous_names":["unraid/libvirt"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/unraid/libvirt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unraid%2Flibvirt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unraid%2Flibvirt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unraid%2Flibvirt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unraid%2Flibvirt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unraid","download_url":"https://codeload.github.com/unraid/libvirt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unraid%2Flibvirt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31372199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-03T19:12:20.371Z","updated_at":"2026-04-03T19:12:24.249Z","avatar_url":"https://github.com/unraid.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Cover image][cover]\n\n# Unraid / libvirt bindings\n\n![Alpha badge][alphabadge]\n![CI badge][cibadge]\n![Tests badge][testsbadge]\n![Codecov badge][codecovbadge]\n![License badge][licensebadge]\n![Contributors badge][contribadge]\n![Issues badge][issuesbadge]\n![PR badge][prbadge]\n![NPM Version][npmbadge]\n![Last Update][lastcommitbadge]\n\nLibvirt bindings for Node.js®.\n\n## Example Usage\n\n```typescript\nimport libvirt, {\n  DomainBuilder,\n  domainDescToXml,\n  domainDescFromXml,\n} from \"@unraid/libvirt\";\n\nconst uri = process.env.LIBVIRT_URI || \"qemu:///system\";\nconst hypervisor = new libvirt.Hypervisor({ uri });\n\n(async () =\u003e {\n  await hypervisor.connectOpen();\n\n  // parse xml template\n  const template = await domainDescFromXml(\"\u003cdomain\u003e...\u003c/domain\u003e\");\n\n  // build new domain description\n  const domain = new DomainBuilder()\n    .fromTemplate(template)\n\n    .setName(\"test1\")\n    .setUUID(\"148d0864-2354-4c27-b82c-731bdd3f320c\")\n\n    .addDisk({\n      type: \"file\",\n      device: \"disk\",\n      driver: { name: \"qemu\", type: \"qcow2\" },\n      source: { file: \"/home/leon/test1.img\" },\n      target: { dev: \"vda\", bus: \"virtio\" },\n    })\n\n    .addInterface({\n      type: \"network\",\n      source: { network: \"default\" },\n      mac: { address: \"52:54:00:8e:c6:5f\" },\n      model: { type: \"virtio\" },\n    })\n\n    .build();\n\n  // define and boot domain\n  const xml = domainDescToXml(domain);\n  await hypervisor.domainCreateXML(xml);\n\n  // list active domains\n  const activeDomains = await hypervisor.connectListAllDomains(\n    libvirt.ConnectListAllDomainsFlags.ACTIVE\n  );\n\n  // log active domain names\n  const activeDomainNames = await Promise.all(\n    activeDomains.map((domain) =\u003e hypervisor.domainGetName(domain))\n  );\n  console.log(activeDomainNames);\n\n  await hypervisor.connectClose();\n})();\n```\n\n## Install\n\n### Debian / Ubuntu\n\n```bash\nsudo apt install build-essential libvirt-dev qemu-system\nnpm i @unraid/libvirt\n```\n\n### MacOS\n\nInstall Homebrew and Xcode first if not already installed.\n\n```bash\nbrew install libvirt qemu\nnpm i @unraid/libvirt\n```\n\n## Development\n\nThis project uses pnpm as the package manager. Make sure you have it installed:\n\n```bash\nnpm install -g pnpm\n```\n\n### Building\n\n```bash\npnpm install\npnpm build\n```\n\n### Testing\n\nThe project uses Vitest for testing. You can run tests using:\n\n```bash\n# Run tests\npnpm test\n\n# Run tests with coverage\npnpm test:coverage\n\n# Run tests with UI\npnpm test:ui\n```\n\n### Examples\n\nThe project includes several example scripts that demonstrate different features:\n\n```bash\n# List all domains\npnpm examples/list\n\n# Start a domain\npnpm examples/start\n\n# Shutdown a domain\npnpm examples/shutdown\n\n# Create a domain using the builder pattern\npnpm examples/builder\n```\n\n## Contribute\n\nAny contribution is welcome! To check whether your contribution conforms to our style guide, run the following tasks:\n\n```bash\n# Install dependencies\npnpm install\n\n# Run linting\npnpm lint\n\n# Run tests\npnpm test\n```\n\n---\n\nMIT License\n\nCopyright (c) 2019 Leon Rinkel \u003cleon@rinkel.me\u003e and vmngr/libvirt contributers\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n[cover]: cover.png \"Cover image\"\n[alphabadge]: https://img.shields.io/badge/-alpha-green \"Alpha badge\"\n[licensebadge]: https://img.shields.io/github/license/unraid/libvirt \"License badge\"\n[cibadge]: https://github.com/unraid/libvirt/workflows/CI/badge.svg \"CI badge\"\n[testsbadge]: https://img.shields.io/github/actions/workflow/status/unraid/libvirt/integration-test.yml?label=tests \"Tests badge\"\n[codecovbadge]: https://codecov.io/gh/unraid/libvirt/branch/main/graph/badge.svg \"Codecov badge\"\n[contribadge]: https://img.shields.io/github/contributors/unraid/libvirt \"Contributors badge\"\n[issuesbadge]: https://img.shields.io/github/issues/unraid/libvirt \"Issues badge\"\n[prbadge]: https://img.shields.io/github/issues-pr/unraid/libvirt \"PR badge\"\n[npmbadge]: https://img.shields.io/npm/v/@unraid/libvirt \"NPM Version badge\"\n[lastcommitbadge]: https://img.shields.io/github/last-commit/unraid/libvirt \"Last Commit badge\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funraid%2Flibvirt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funraid%2Flibvirt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funraid%2Flibvirt/lists"}