> For the complete documentation index, see [llms.txt](https://thorstenkramm.gitbook.io/saltstack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thorstenkramm.gitbook.io/saltstack/salt-cloud/kvm-und-libvirt.md).

# KVM und Libvirt

### Provider erstellen

Zuerst wird ein sogenannter Provider benötigt. Über diesen legen Sie fest, wie und ggf. mit welchen Zugangsdaten sich der Salt-Master zum Hypervisor verbindet.

{% code title="/etc/salt/cloud.providers.d/libvirt.conf" %}

```yaml
# Connect to a local libvirt instance       
local-kvm:
  driver: libvirt
  url: qemu:///system
  validate_xml: no
```

{% endcode %}

### Profil(e) erstellen

{% code title="/etc/salt/cloud.profiles.d/libvirt.conf" %}

```yaml
ubuntu:
  # points back at provider configuration
  provider: local-kvm
  ssh_username: hero
  sudo: True
  key_filename: '/dev/null'
  password: none
  base_domain: ubuntu1804
  ip_source: qemu-agent
  script_args: -F
  # script: LinuxMinimal # Use own script
  display_ssh_output: False
  minion:
    master: 192.168.122.1
debian:
  # points back at provider configuration
  provider: local-kvm
  ssh_username: root
  key_filename: '/dev/null'
  password: none
  base_domain: debian9
  ip_source: ip-learning
  script_args: -F
  display_ssh_output: False
  minion:
    master: 192.168.122.1
```

{% endcode %}

{% hint style="info" %}
Die Angabe von `key_filename` wird  ignoriert und es wird stattdessen `~/.ssh/id_rsa` verwendet. Trotzdem muss `key_filename` angegeben werden. Vielleicht wird dieser Bug in einer späteren Version behoben.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://thorstenkramm.gitbook.io/saltstack/salt-cloud/kvm-und-libvirt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
