Virtualization is a powerful tool that allows you to run multiple operating systems on a single machine. One popular virtualization software is QEMU, which provides a full system emulation for different architectures. If you have an NVIDIA graphics card and want to enable multi-display 3D acceleration for a QEMU virtual machine (VM) using the virt-manager graphical interface, this article will guide you through the process.
Step 1: Install Dependencies
Before we begin, make sure you have the necessary dependencies installed on your system. Open a terminal and run the following command:
sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients virt-manager
Step 2: Enable IOMMU
IOMMU (Input-Output Memory Management Unit) is a feature that allows the VM to access hardware directly. To enable IOMMU, you need to modify the GRUB configuration file. Open a terminal and run the following command:
sudo nano /etc/default/grub
Find the line that starts with GRUB_CMDLINE_LINUX_DEFAULT and add the following options:
amd_iommu=on iommu=pt
Save the file and exit the editor. Then, update GRUB by running:
sudo update-grub
Finally, reboot your system for the changes to take effect.
Step 3: Configure virt-manager
Launch the virt-manager application by searching for it in your applications menu or running the following command in a terminal:
virt-manager
Click on the "Create a new virtual machine" button to start the VM creation wizard.
- Select the installation method for your VM. You can choose to install from a CD/DVD or an ISO image file.
- Choose the operating system type and version that you want to install.
- Allocate the desired amount of memory and CPU cores to the VM.
- Create a new virtual disk or use an existing one.
- Configure the network settings for the VM.
- Finish the wizard and start the VM.
Step 4: Enable 3D Acceleration
With the VM running, open a terminal and run the following command to edit the VM's XML configuration:
virsh edit your_vm_name
Find the <devices> section and add the following lines:
<video>
<model type='virtio'>
<acceleration accel3d='yes'/>
</model>
</video>
Save the changes and exit the editor.
Step 5: Install NVIDIA Drivers
In order to enable 3D acceleration on an NVIDIA card, you need to install the appropriate drivers. Open a terminal and run the following commands:
sudo apt install nvidia-driver-470
sudo reboot
After the reboot, the NVIDIA drivers should be installed and loaded.
Step 6: Test 3D Acceleration
Launch the VM and check if 3D acceleration is working. Open a terminal within the VM and run the following command:
glxinfo | grep "direct rendering"
If the output shows "direct rendering: Yes," then 3D acceleration is enabled and working properly.
Congratulations! You have successfully enabled multi-display 3D acceleration for your QEMU VM on an NVIDIA card using virt-manager. Enjoy the enhanced graphics performance and productivity.
References
| Reference | Description |
|---|---|
| QEMU | Official QEMU website |
| virt-manager | Official virt-manager website |
| NVIDIA | Official NVIDIA website |