From 4a7cdc06d6f7fa0f8432311ce3b0937bdc0040e9 Mon Sep 17 00:00:00 2001 From: atomicbeecz Date: Sun, 31 May 2020 21:45:03 +0200 Subject: [PATCH] Update README.md (#60) * Update README.md on ubuntu 18.04 got following errors when tried to spin up VM: ./kvm-install-vm: line 470: osinfo-query: command not found ERR: Unknown OS variant 'ubuntu18.04'. Please update your osinfo-db. See https://libosinfo.org/download for more information. * Update README.md updated packages names for ubuntu/debian based distros + added small troubleshooting hint * Update README.md * Update README.md small fix Co-authored-by: Tomas Bezdek --- README.md | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3c1c9db..7d11311 100644 --- a/README.md +++ b/README.md @@ -8,26 +8,43 @@ Tested on the latest Fedora. ### Prerequisites -You need to have the KVM hypervisor installed, along with a few other packages: +You need to have the KVM hypervisor installed, along with a few other packages (naming of packages can differ on other distributions): - genisoimage or mkisofs - virt-install - libguestfs-tools-c - qemu-img - libvirt-client +- libosinfo To install the dependencies, run: +- Fedora example: + +``` +sudo dnf -y install genisoimage virt-install libguestfs-tools-c qemu-img libvirt-client wget libosinfo +``` + +- Ubuntu example: + ``` -sudo dnf -y install genisoimage virt-install libguestfs-tools-c qemu-img libvirt-client wget +sudo apt install genisoimage virtinst libguestfs-tools qemu-utils libvirt-clients wget libosinfo-bin ``` If you want to resolve guests by their hostnames, install the `libvirt-nss` package: +- Fedora example: + ``` sudo dnf -y install libvirt-nss ``` +- Ubuntu example: + +``` +sudo apt install libnss-libvirt +``` + Then, add `libvirt` and `libvirt_guest` to list of **hosts** databases in `/etc/nsswitch.conf`. See [here](https://libvirt.org/nss.html) for more information. @@ -227,3 +244,19 @@ things like: - anything else you would do with a VM ...then this wrapper could be useful for you. + +### Troubleshooting + +If you will encounter something similar: + +``` +ERR: Unknown OS variant 'fedora31'. Please update your osinfo-db. See https://libosinfo.org/download for more information. +``` + +Then you need to update the DB in libosinfo. +Check the url and select the latest date ( https://releases.pagure.org/libosinfo/ ) + +``` +wget -O "/tmp/osinfo-db.tar.xz" https://releases.pagure.org/libosinfo/osinfo-db-20200515.tar.xz +sudo osinfo-db-import --local "/tmp/osinfo-db.tar.xz" +```