====== Virtualisierung (KVM) ====== ===== Programme ===== ^ [[admin:linux:virt-manager|virt-manager]] | GUI zum Verwalten von KVM-basierten VMs | ^ ''virsh'' | CLI-Manager für KVM-VMs | ^ gnome-boxes | Noch eine GUI für KVM-VMs, aber einfacher zu bedienen | ===== virt-install ===== ''virt-install --prompt'' führt einen durch die Erstellung einer VM. ==== Windows ==== virt-install \ --name=guest-name \ --os-type=windows \ --network network=default \ --disk path=path-to-disk,size=disk-size \ --cdrom=path-to-install-disk \ --graphics spice --ram=1024 > All image files are stored in /var/lib/libvirt/images/ by default. Other directory locations for file-based images are possible, but may require SELinux configuration. [Quelle: [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/sect-Virtualization_Host_Configuration_and_Guest_Installation_Guide-Windows_Installations-Installing_Windows_XP_as_a_fully_virtualized_guest.html|Red Hat – using virt-install to create a Windows guest]]] ===== Netzwerk ===== ==== Bridge zum internen Netzwerk ==== # The primary network interface auto eno1 iface eno1 inet manual auto br0 iface br0 inet dhcp bridge_ports eno1 anschließend: ''systemctl restart networking'' ===== Windows-Gast ===== Performance mit virtio-Treibern ist weitaus höher, siehe auch: * [[https://forum.level1techs.com/t/how-fast-is-kvm-host-vs-virtual-machine-performance/110192|How Fast is KVM?]] * [[https://docs.fedoraproject.org/quick-docs/en-US/creating-windows-virtual-machines-using-virtio-drivers.html|Creating Windows VMs with virtio drivers (Fedora Quick Docs)]] ===== Fehlerbehebung ===== ==== Failed to initialize a valid firewall backend ==== Install and start ''ebtables'' and ''dnsmasq''. Restart ''libvirtd'' afterwards. ==== INACCESSIBLE_BOOT_DEVICE after virtio ==== If this error occurs after you set the boot drive to virtio, you should do the following: - ''bcdedit /set "{current}" safeboot minimal'' - change the boot device type to virtio. - boot the VM. It will enter in safe mode. - all boot-start drivers will be enabled and loaded, including the virtio driver. Since there is now a miniport installed to use it, the kernel will make it part of the drivers that are to be loaded on boot and not disable it again. - in the booted VM reset the bcdedit settings to allow the machine to boot into the normal mode:\\ ''bcdedit /deletevalue "{current}" safeboot'' === option 2 === If that doesn't work, add a virtio device, boot, install the virtio drivers, shutdown, remove the virtio disk, change IDE boot disk to virtio.