Tips to Create Ubuntu 20.04 VM on Proxmox with GPU Passthrough

I have an old PC with AMD FX 8350 processor running Proxmox VE 6.2.4. Then I run multiple operating systems on it. macOS Catalina and Ubuntu 20.04 are installed on the Proxmox VE. By doing this, now I can run two OS’es simultaneously. Surprisingly, the performance of the virtual machine is very good. Thanks to the GPU Passthrough feature in Proxmox. In this tutorial, I will show you how to create Ubuntu 20.04 VM with GPU Passthrough enable.

The Performance

Let’s talk about performance. Usually, the Ubuntu virtual machine lacks 3D performance. But if you run the virtual machine on Proxmox, and you enable the GPU Passthrough feature, then the 3D performance is not an issue anymore. Below, is the result of the Unigine Heaven benchmark from my Ubuntu 20.04 virtual machine. As you can see, I can get average FPS on Heaven Benchmark with Ultra settings at 99 FPS. That is awesome.

Heaven Benchmark on Ubuntu 20.04 with GPU Passthrough

Create Ubuntu 20.04 VM on Proxmox with PCI Passthrough

In order to use the GPU/PCI Passthrough on the virtual machine, we need to make sure a few things. Please follow these steps to create a new virtual machine that supports PCI passthrough on Ubuntu 20.04.

Now, boot the virtual machine and install Ubuntu 20.04 as usual. Once finished installing, shut down the Ubuntu VM. We need to configure a few things to enable the PCI or GPU Passthrough. At this point, I assume you already have the GPU Passthrough enabled on your Proxmox. Please follow this guide to enable GPU Passthrough on Proxmox 6.2.

Open the hardware section of your VM. And then click Add >> PCI Device. Select your graphic card from the Device section as shown below.

And make sure you select All Function, Primary GPU, PCI_Express and ROM-Bar as shown below.

Add the USB Passthrough

You can also pass through your mouse and keyboard. From the Hardware section, Add USB and choose your mouse and keyboard from there.

Now start the VM again.

Please note that in some cases, you won’t be able to connect to your VM using the Console menu. So, I would recommend you to connect a monitor directly to your graphic card. This way, you can have direct access to the VM via your keyboard and monitor.

Now enjoy Ubuntu 20.04 virtual machine with GPU Passthrough enabled. The graphic hardware acceleration is very helpful to make Ubuntu VM run smoothly, playing games, run 3D software etc.

Be the first to comment

Leave a Reply