Skip to content

Instantly share code, notes, and snippets.

@noslin005
Created April 3, 2026 00:05
Show Gist options
  • Select an option

  • Save noslin005/8d6beb1c077250b96395da49cbb841b8 to your computer and use it in GitHub Desktop.

Select an option

Save noslin005/8d6beb1c077250b96395da49cbb841b8 to your computer and use it in GitHub Desktop.
  • Create a backup of current driver
KVER=$(uname -r)

tar --numeric-owner -czpf /tmp/nvidia_driver_files.tar.gz \
    /lib/modules/$KVER/kernel/drivers/video/nvidia* \
    /lib/modules/$KVER/kernel/drivers/video/nvidia/ \
    /usr/lib64/libcuda* \
    /usr/lib64/libnvidia* \
    /usr/lib64/nvidia/ \
    /usr/bin/nvidia-* \
    /usr/sbin/nvidia-* \
    /etc/nvidia/ \
    /etc/modprobe.d/nvidia* \
    /usr/lib/systemd/system/nvidia-* \
    /usr/lib/firmware/nvidia/
  • Extract on Server NFS
tar --numeric-owner -xzpf /tmp/nvidia_driver_files.tar.gz \
    -C /opt/nfs_rhel
  • Update NFS
CHROOT=/opt/nfs_rhel
KVER=$(chroot $CHROOT rpm -q kernel | tail -1 | sed 's/kernel-//')

mount --bind /proc $CHROOT/proc
mount --bind /sys  $CHROOT/sys
mount --bind /dev  $CHROOT/dev

chroot $CHROOT dracut --force --kver $KVER
chroot $CHROOT depmod -a $KVER

umount $CHROOT/proc $CHROOT/sys $CHROOT/dev
  • Blacklist nouveau
cat > /etc/modprobe.d/blacklist-nouveau.conf << 'EOF'
blacklist nouveau
options nouveau modeset=0
EOF
@noslin005
Copy link
Copy Markdown
Author

polkit.addRule(function(action, subject) {
    if (action.id == "org.libvirt.unix.manage" &&
        subject.isInGroup("admins")) {
            return polkit.Result.YES;
    }
});

// Allow admins to manage storage pools and volumes
polkit.addRule(function(action, subject) {
    if ((action.id == "org.libvirt.unix.manage" ||
         action.id == "org.libvirt.api.storage.pool.create" ||
         action.id == "org.libvirt.api.storage.vol.create") &&
        subject.isInGroup("admins")) {
            return polkit.Result.YES;
    }
});

chmod 644 /etc/polkit-1/rules.d/50-libvirt-admins.rules
systemctl restart polkit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment