From cf68a0201d908e8ab9e60cad02b0cf4a96f5b41d Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 23 Jul 2021 12:03:25 +0200 Subject: [PATCH] uncomment most stuff related to hypervisor --- leaves/vhmd.cfg | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/leaves/vhmd.cfg b/leaves/vhmd.cfg index de6b307..3cfc592 100644 --- a/leaves/vhmd.cfg +++ b/leaves/vhmd.cfg @@ -15,29 +15,28 @@ %post # Beginning of %post section -# dnf install -y qemu-kvm libvirt libvirt-daemon-config-network libvirt-daemon-kvm # Install minimal tools dedicated to virtualization. -# dnf install -y virt-install virt-top libguestfs-tools python3-libguestfs guestfs-tools # Complementary tools useful for interacting with virtual machines. +dnf install -y qemu-kvm libvirt libvirt-daemon-config-network libvirt-daemon-kvm # Install minimal tools dedicated to virtualization. +dnf install -y virt-install virt-top libguestfs-tools python3-libguestfs guestfs-tools # Complementary tools useful for interacting with virtual machines. -# usermod -a -G libvirt test ## make user "test" part of the existing libvirt group to allow it to interact with the nested-hypervisor. -# -# # Load kernel modules by adding vfio, vfio_pci, vfio_iommu_type1, vfio_virqfd, kvmgt, vfio-mdev -# echo "vfio" > /etc/modules-load.d/vfio.conf -# echo "vfio-pci" > /etc/modules-load.d/vfio-pci.conf -# echo "vfio_iommu_type1" > /etc/modules-load.d/vfio_iommu_type1.conf -# echo "vfio_virqfd" > /etc/modules-load.d/vfio_virqfd.conf -# -# dracut --add-drivers "vfio vfio-pci vfio_iommu_type1 vfio_virqfd" --force # Instruct dracut to load the vfio drivers: +usermod -a -G libvirt test ## make user "test" part of the existing libvirt group to allow it to interact with the nested-hypervisor. + +Load kernel modules by adding vfio, vfio_pci, vfio_iommu_type1, vfio_virqfd +echo "vfio" > /etc/modules-load.d/vfio.conf +echo "vfio-pci" > /etc/modules-load.d/vfio-pci.conf +echo "vfio_iommu_type1" > /etc/modules-load.d/vfio_iommu_type1.conf +echo "vfio_virqfd" > /etc/modules-load.d/vfio_virqfd.conf -# mkdir /var/lib/libvirt/iso # Create a directory to store iso images -# chown test:test /var/lib/libvirt/iso # Make the user "test" the owner of this directory -# virsh pool-create-as --name iso --type dir --target /var/lib/libvirt/iso # Make libvirt aware of this new directory by creating a so-called `pool` within this directory -# mkdir /var/lib/libvirt/rom # Create a directory to store rom files -# chown test:test /var/lib/libvirt/rom # Make the user "test" its owner -# virsh pool-create-as --name rom --type dir --target /var/lib/libvirt/rom # Make libvirt aware of this new directory by creating a so-called `pool` within this directory -# chown test:test /var/lib/libvirt/images # Make the user "test" the owner of this directory -# -# nmcli con add ifname br0 type bridge con-name br0 # Add a network bridge -# nmcli con add type bridge-slave ifname enp1s0 master br0 -# nmcli con up br0 +dracut --add-drivers "vfio vfio-pci vfio_iommu_type1 vfio_virqfd" --force # Instruct dracut to load the vfio drivers: +mkdir /var/lib/libvirt/iso # Create a directory to store iso images +chown test:test /var/lib/libvirt/iso # Make the user "test" the owner of this directory +virsh pool-create-as --name iso --type dir --target /var/lib/libvirt/iso # Make libvirt aware of this new directory by creating a so-called `pool` within this directory +mkdir /var/lib/libvirt/rom # Create a directory to store rom files +chown test:test /var/lib/libvirt/rom # Make the user "test" its owner +virsh pool-create-as --name rom --type dir --target /var/lib/libvirt/rom # Make libvirt aware of this new directory by creating a so-called `pool` within this directory +chown test:test /var/lib/libvirt/images # Make the user "test" the owner of this directory + +nmcli con add ifname br0 type bridge con-name br0 # Add a network bridge +nmcli con add type bridge-slave ifname enp1s0 master br0 +nmcli con up br0 %end # End of the %post section \ No newline at end of file