Edit Bootloader Configuration
If your arch is ready to go, it's time to dive into bootloader configuration. To fine-tune your bootloader settings, let’s customize them based on your CPU type:
AMD CPU | Intel CPU |
---|---|
amd_iommu=on | intel_iommu=on |
video=efifb:off | iommu=pt |
iommu=pt |
Each of these parameters plays a crucial role in enabling virtualization and improving your system's performance for virtual machines.
Decoding the Parameters
Let’s break down what each of these parameters does:
-
amd_iommu=on
(AMD) /intel_iommu=on
(Intel): Activates IOMMU support for better hardware isolation and sharing, crucial for virtualization. -
video=efifb:off
: Disables the EFI framebuffer driver, which can interfere with GPU passthrough. -
iommu=pt
: Sets the IOMMU to pass-through mode, ensuring efficient and direct hardware access for VMs.
By adding these parameters to your bootloader configuration, you set the stage for effective virtualization, enhancing your ability to run virtual machines and perform related tasks.
1.2 Configuring GRUB
If you’re using the GRUB bootloader, follow these steps to configure it:
-
Open the GRUB configuration file at
/etc/default/grub
:sudo vim /etc/default/grub
-
Locate the line beginning with
GRUB_CMDLINE_LINUX_DEFAULT
. Add your parameters to this line. -
Save your changes and regenerate the GRUB configuration with:
sudo grub-mkconfig -o /boot/grub/grub.cfg
-
Reboot your system to apply the new GRUB configuration.
Your GRUB bootloader should now include the necessary parameters for an optimized virtualization setup.
GRUB Configuration Examples
For AMD CPUs:
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt video=efifb:off"
For Intel CPUs:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt"
1.3 Configuring bootctl
If you’re using bootctl
as your bootloader, here’s how to configure it:
-
Edit your configuration file located at
/boot/loader/entries/your_config.conf
:sudo vim /boot/loader/entries/your_config.conf
-
Find the line starting with
options
and modify it. For instance, if you have an AMD CPU, change it to:options root=<root> quiet rw amd_iommu=on iommu=pt video=efifb:off
-
Save your changes.
-
Reboot your system to activate the new configuration.
Your bootloader configuration should now look something like this:
For AMD CPUs:
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=<root> quiet rw amd_iommu=on iommu=pt video=efifb:off
For Intel CPUs:
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=<root> quiet rw intel_iommu=on iommu=pt
With these configurations in place, your bootloader is now primed to support virtualization.
What's Next
For the next step, we’re going to enable the GPU needed to empower virtualization. This includes modifying the mkinitcpio.conf
file, identifying the IOMMU GPU IDs, configuring the vfio.conf
file, and regenerating the mkinitcpio
image with the new configuration. Finally, you’ll need to verify that the GPU is using the vfio-pci
driver by checking the Kernel driver in use
.