There are many emulated display devices available in qemu. This blog post introduces them, explains the differences between them, and the use cases they are good for.
TL;DR version is activatedrecommendationssection at the end of the article.
vga standard
- qemu:
-vga default
o- VGA device
- virtual Library:
<model type='vga'/>
- &Cheques; compatible con vga
- &Checks; vgabios support
- &Checks; UEFI support (QemuVideoDxe)
- &Checks; linux driver (bochs-drm.ko)
This is the default display device (on x86). It provides full VGA compatibility and support for a simple linear framebuffer (using the bochs dispi interface). It's the best option in terms of compatibility, pretty much any guest should be able to display a working screen on this device. Performance or usability may be better with other devices, see discussion below.
The device has 16 MB of video memory by default. This can be changed using the vgamem_mb property,-VGA device,vgamem_mb=32
for example, it will double the amount of video memory. The size must be a power of two, the valid range is 1 MB to 256 MB.
The Linux driver supports paging, so it's a good idea to have space for 3-4 framebuffers. The driver can leave the frame buffers in vram instead of swapping them out. FullHD (1920x1080), for example, needs a little more than 8MB for a single framebuffer, so 32 or 64MB would be a good choice for this.
The UEFI settings allow you to choose the screen resolution that OVMF will use to initialize the screen at startup. Press ESC on tianocore home screen to enter setup and go to "Device Manager" → "OVMF Platform Configuration".
bochs display device
- qemu:
-device bochs-display
- virtual Library:
<model type='bochs'/>
- &Cruz; no compatible con VGA
- &Checks; vgabios support
- &Checks; UEFI support (QemuVideoDxe)
- &Checks; linux driver (bochs-drm.ko)
This device supports a simple linear framebuffer. It also uses bochs dispi interface for mode setting, so linear frame buffer setting is fully compatible with standard VGA device.
The bochs display does not support VGA. Virtual hardware does not support text mode, flat video modes, memory windows at 0x0000, and other legacy VGA features.
The main advantage over standard VGA is that this device is much simpler. The size and complexity of the code required to emulate this device is an order of magnitude less, resulting in a reduced attack surface. Another cool feature is that you can put this device in a PCI Express slot.
For UEFI guests, it is safe to use the bochs display device instead of the standard VGA device. The firmware will set a linear framebuffer like the GOP anyway and will never use any legacy VGA features.
For BIOS guests, this device can also be used depending on whether they rely on direct VGA hardware access or not. There is a vgabios that supports rendering text in a linear framebuffer, so software that uses vgabios services to generate text will still work. Linux bootloaders generally fall into this category. Linux text mode console (vgacon) uses direct hardware access and doesn't work. The framebuffer console (fbcon running on vesafb or bochs-drm) works.
virtio vga
- qemu:
-vga virtio
o-virtio-vga device
- virtual Library:
<model type='virtio'/>
(em x86). - &Cheques; compatible con vga
- &Checks; vgabios support
- &Checks; UEFI support (QemuVideoDxe)
- &Checks; linux driver (virtio-gpu.ko)
This is a modern virtio-based display device designed for virtual machines. It comes with VGA compatibility mode. You need a guest driver to make full use of this device. If your guest OS doesn't have a driver, it should still display a working display thanks to VGA compatibility mode, but the device won't provide any advantage over standard VGA.
This device has hardware assisted opengl acceleration support (optional). This can be activated using thevirgl=a
property, which in turn needs opengl support enabled (gl=on
) on the qemu screen.
This device has multi-head support, it can be activated using themax_outputs=2
property.
This device does not have dedicated video memory (except for VGA support); GPU data will be stored in main memory. Therefore, this device does not have configuration options for the size of the video memory.
Aquí es donde se lleva a cabo la mayor parte del desarrollo, es probable que se agregue soporte para funciones nuevas y emocionantes a este dispositivo.
virtio gpu
- qemu:
-virtio-gpu-pci device
- virtual Library:
<model type='virtio'/>
(In the arm). - &Cruz; no compatible con VGA
- ⨯ no vgabios support
- &Checks; UEFI (VirtuoGpuDxe) support
- &Checks; linux driver (virtio-gpu.ko)
This device does not have VGA compatibility mode, but is identical to thevirtio vgadevice. UEFI firmware can handle this, and if your guests also have drivers, you can use them instead of virtio-vga. This will reduce the attack surface (no support for complex VGA emulation) and reduce memory consumption by 8MB (no pci memory bar for VGA support). This device can be placed in a PCI Express slot.
vhost-user virtio gpu
There is a vhost user variant for virtio vga and virtio gpu. This allows running the virtio-gpu emulation in a separate process. This is good from a security point of view, especially if you want to use virgl's 3D acceleration, and it also helps with opengl performance.
Run the gpu emulation process (seecontrib/vhost-user-gpu/in the qemu source tree):
./vhost-usuario-gpu --virgl -s vgpu.sock
Run qemu:
qemu \ -chardev socket,id=vgpu,path=vgpu.sock \ -device vhost-user-vga,chardev=vgpu \ [ ... ]
Libvirt support is ongoing.
qxl vga
- qemu:
-vga qxl
o-qxl-vga device
. - virtual Library:
<model type='qxl' parent='yes'/>
. - &Cheques; compatible con vga
- &Checks; vgabios support
- &Checks; UEFI support (QemuVideoDxe)
- &Checks; linux driver (qxl.ko)
- &Checks; windows driver
This is a slightly dated display device designed for virtual machines. It comes with VGA compatibility mode. You need a guest driver to make full use of this device. If your guest OS doesn't have a driver, it should still display a working display thanks to VGA compatibility mode, but the device won't provide any advantage over standard VGA.
This device supports 2D acceleration. This becomes increasingly pointless as modern display devices no longer have dedicated support for 2D acceleration and use the 3D engine for everything. The same thing happens on the software side, modern desktops render with opengl or vulkan instead of using 2d acceleration.
Spice and qxl support 2d acceleration downloading to the spice client (usually virt-viewer these days). This is quite complex, and with 2D acceleration declining, it also becomes increasingly pointless. You may choose a simpler device for security reasons.
This device has multi-head support, it can be activated using themax_outputs=2
property. The Linux driver will use this, the Windows driver expects various devices (see below).
The amount of video memory for this device can be set using the ram_size_mb and vram_size_mb properties for the two pci memory sticks. The default is 64 MB for both, which should be sufficient for typical use cases. When you use 4K display resolution or multi-head support, you need to allocate more video memory. When you use small resolutions like 1024x768, you can allocate less video memory to reduce memory consumption.
qxl
- qemu:
-qxl device
. - virtual Library:
<model type='qxl' primary='no'/>
.
This device does not have VGA compatibility mode, but is identical to theqxl vgadevice. Providing multihead support for Windows guests is pretty much the only use case for this device. The Windows guest driver expects one qxl device per secondary monitor (in addition to one qxl-vga device for the primary monitor).
gray vga
- qemu:
-vga pale
o-dispositivo cirrus-vga
. - virtual Library:
<model type='circus'/>
. - &Cheques; compatible con vga
- &Checks; vgabios support
- &Checks; UEFI support (QemuVideoDxe)
- &Checks; linux driver (circus.ko)
It emulates a Cirrus SVGA device that was modern in the 1990s, more than 20 years ago. mostly mine2014 blog postis still correct; the device is primarily useful for guests who are of a similar age and ship with a driver for cirrus vga devices.
However, two things have changed: since qemu version 2.2, cirrus is no longer the default vga device. Also, the cirrus driver in the Linux kernel has been completely rewritten. In kernel 5.2 and later, the cirrus driver uses a shadow framebuffer and converts formats on the fly to hide some of the userspace (Xorg/wayland) cirrus quirks, so things work a little better now. However, this does not solve everything, especially the available screen resolutions are still limited by the small amount of video memory.
y vga
- qemu:
-device ati-vga
. - &Cheques; compatible con vga
- &Checks; vgabios support
- ⨯ no UEFI support
Emulates two ATI SVGA devices, the model property can be used to choose the variant.model=rage128p
select the "Rage 128 Pro" andmodel=rv100
select the "Radeon RV100".
The devices are newer (late 90's/early 2000's) and more modern than cirrus VGA. However, the use case is very similar: for guests of similar age submitting drivers for these devices.
This device was recently added to qemu, development is still ongoing. The fundamentals are working (mode setting, hardware cursor). The most important 2D acceleration operations are also implemented. 3D acceleration is not yet implemented.
Linux has drm and fbdev drivers for these devices. The drm drivers don't work because the emulation is still incomplete (which we hope will change in the future). The fbdev drivers are working. Modern Linux distributions prefer drm drivers. So you'll probably have to build your own kernel if you want to use this device.
ramfb
- qemu:
-ramfb device
. - &Cruz; no compatible con VGA
- &Checks; vgabios support
- &Checks; UEFI support (QemuRamfbDxe)
Very simple display device. It uses a framebuffer stored in the guest's memory. The firmware boots it and allows you to use it as a boot screen (grub boot menu, efifb, ...) without the need for complex legacy VGA emulation.Details can be found here.
without display device
- qemu:
-vga none -nographic
.
No need to use a display device. If you don't need one, you can run your guests with a serial console.
embedded devices
There are plenty of other display devices. They are typically SoC-specific and used via onboard board emulation. Just mention them here for completeness. You can't select the display device for onboard cards, the qemu emulation just matches the physical hardware here.
recommendations
For the desktop use case (assuming screen performance is important and/or you need multi-head support), in order of preference:
- virtio vgaovirtio gpu, if your guest has drivers
- qxl vga, if your guest has drivers
- bochs display device, al usar UEFI
- vga standard
For the server use case (assuming the GUI is rarely used or not used at all), in order of preference:
- console series, if you can work without a GUI
- bochs display device, al usar UEFI
- vga standard
On arm systems, displays with a pci memory stick will not work, greatly reducing your options. Stay with:
- virtio gpu, if your guest has drivers
- ramfb
FAQs
How to enable KVM in QEMU? ›
Enabling KVM
To start QEMU in KVM mode, append -accel kvm to the additional start options. To check if KVM is enabled for a running VM, enter the #QEMU monitor and type info kvm . Note: The argument accel=kvm of the -machine option is equivalent to the -enable-kvm or the -accel kvm option.
QEMU 2.4 contained the initial virtio-gpu with no acceleration support. QEMU 2.5 contains 3D support only with the GTK3 frontend with GL enabled.
What is Virtio-GPU? ›[1] virtio-gpu is a paravirtualized 3d accelerated graphics driver, similar to non-graphics virtio drivers (see virtio driver information and virtio Windows guest drivers). For Linux guests, virtio-gpu is fairly mature, having been available since Linux kernel version 4.4 and QEMU version 2.6.
Does QEMU have a GUI? ›Qemu-gui allows record executions and replay it. Execution is a scenario of work system inside qemu. Execution includes all user and network interaction, interrupts, timers and other. You can replay one scenario many times and make analysis if you need.
What is the difference between KVM and QEMU? ›So to conclude: QEMU is a type 2 hypervisor that runs within user space and performs virtual hardware emulation, whereas KVM is a type 1 hypervisor that runs in kernel space, that allows a user space program access to the hardware virtualization features of various processors.
Does QEMU support GPU passthrough? ›The Open Virtual Machine Firmware (OVMF) is a project to enable UEFI support for virtual machines. Starting with Linux 3.9 and recent versions of QEMU, it is now possible to passthrough a graphics card, offering the virtual machine native graphics performance which is useful for graphic-intensive tasks.
Is QEMU faster than virtual box? ›VirtualBox is faster and has a better UI than QEMU. It's also a good choice only for x86 and x64 architectures. Lastly, VirtualBox doesn't require advanced knowledge or experience.
How can I make QEMU run faster? ›- 1 Enable KVM.
- 2 Add big memory.
- 3 Enable SMP.
- 4 Add extra disk space.
- 5 Create network environment.
- 6 Enable virtio block and network device.
- 7 Enable VTd to for NIC/Block device.
QEMU disk image utility for Windows. It is used for converting, creating, and consistency checking of various virtual disk formats. It is compatible with Hyper-V, KVM, VMware, VirtualBox, and Xen virtualization solutions.
Is Vulkan GPU or CPU? ›OpenGL and Vulkan are both rendering APIs. In both cases, the GPU executes shaders, while the CPU executes everything else.
What is the difference between virtio and SR IOV? ›
Comparing Virtio and SR-IOV
Virtio adopts a software-only approach. SR-IOV requires software written in a certain way and specialized hardware, which means an increase in cost, even with a simple device. Generally, using virtio is quick and easy.
Vulkan is a new-generation graphics and compute API for high-efficiency, cross-platform access to GPUs. As the industry's only open standard modern GPU API, Vulkan is unique in enabling developers to write applications that are portable to multiple diverse platforms.
How do I access QEMU monitor? ›- Start QEMU. Run the following command from the platform project directory: $ make start-target. ...
- Enter the monitor. In the target console, press CTRL+A C to access the QEMU Monitor. ...
- Quit the Monitor. When you are done using the Monitor, type q or quit to exit the QEMU Monitor.
Admins looking for an alternative tool for emulating hardware should consider QEMU, which supports x86, PowerPC, ARM and SPARC architectures. QEMU is an open source emulator and virtualization tool that specializes in emulating different CPU architectures.
What is QEMU system GUI? ›QEMU full system emulation binaries (user interface and audio support) This package provides local graphical user interface (currently GTK) and audio backends for full system emulation (qemu-system-*) packages.
Why QEMU is needed with KVM? ›It can interoperate with Kernel-based Virtual Machine (KVM) to run virtual machines at near-native speed. QEMU can also do emulation for user-level processes, allowing applications compiled for one architecture to run on another.
Can QEMU run without KVM? ›KVM is a part of the Linux kernel that supports virtual machines. QEMU is an emulator that works at user-level and frequently uses KVM to get reasonable performance (though it can also work without it).
Can QEMU work without KVM? ›Qemu without KVM is incredibly slow. User Mode Linux has not been ported to arm! It only works with x86 at the moment. Based on the documentation it sounds like it could be easy to port and a near-native performance user-mode virtual machine on Android would be really great.
Do you need 2 graphics cards for GPU passthrough? ›You can't. When you pass through the GPU, or anything really, to a VM it removes access to that device on the host to give full control to the guest. You'll need to add a second GPU for the host.
How do I pass a graphics card to a VM? ›- Power off the VM.
- Open the vCenter web interface.
- Select the ESXi host and select Settings.
- Locate the Hardware menu, choose PCI Devices and select Edit.
- Select all Nvidia GPUs and click OK.
- Reboot the ESXi host.
How do I use GPU passthrough? ›
...
To assign a GPU to a virtual machine, follow the steps in these procedures:
- Enable the I/O Memory Management Unit (IOMMU) on the host machine.
- Detach the GPU from the host.
- Attach the GPU to the guest.
- Install GPU drivers on the guest.
- Configure Xorg on the guest.
Qemu is a machine emulator that can run operating systems and programs for one machine on a different machine.
Which virtualization is faster? ›Paravirtualization is faster in operation as compared to full virtualization.
Is QEMU a Docker? ›qemu-docker
This repository contains a Docker container for running x86_64 virtual machines using QEMU. It uses high-performance QEMU options (KVM, and TAP network driver).
QEMU can emulate both 32-bit and 64-bit Arm CPUs.
Can you run Windows 10 in QEMU? ›Initial setup
Open up the Virtual Machine Manager and click on the upper left button to open the New VM window. The first thing you have to do is to select how you would like to install the operating system. In this case, we are using a Windows 10 ISO image. Click forward and choose the Windows 10 ISO you downloaded.
Procedure. Install qemu-system-arm (on Ubuntu, "sudo apt-get qemu-system-arm") to allow the emulation of devices with arm processors like the Pi. Create an emulation project directory, "~/Projects/rpitest" to hold the emulation files. Clone the qemu-rpi-kernel repo to another directory using git.
Is KVM better than Hyper-V? ›KVM is very fast & very stable & low cost. The tooling around Hyper-V is more advanced than around KVM, Speed wise, setting up and managing the virtual machines appear easier in KVM than in Hyper-V especially for remote servers on slow connections.
Is QEMU using KVM? ›Unlike native QEMU, which uses emulation, KVM is a special operating mode of QEMU that uses CPU extensions (HVM) for virtualization via a kernel module. Using KVM, one can run multiple virtual machines running unmodified GNU/Linux, Windows, or any other operating system.
Is QEMU a Type-2 hypervisor? ›QEMU, short for Quick Emulator – is a type-2 hypervisor that emulates a machine's processor through dynamic binary translation. Despite QEMU having the ability to run on its own and emulate all virtual machine resources, all emulation is performed in-software. This makes it very slow.
Is Vulkan faster than DirectX? ›
Vulkan is faster than DirectX
In one-for-one matchups, Vulkan simply outperforms DirectX. I tested four games that support Vulkan and DirectX to measure the differences in performance. Note that a lot of games use one or the other, and some games use both for different things.
With a simpler, thinner driver and efficient CPU multi-threading capabilities, Vulkan has less latency and overhead than alternatives, such as OpenGL or older versions of Direct3D. If you use Vulkan, NVIDIA GPUs are a no-brainer.
Can Intel run Vulkan? ›PC games and applications often require a graphics card that is compatible with specific Application Programming Interfaces (APIs), such as OpenGL*, DirectX*, OpenCL*, or Vulkan*. Intel Graphics supports a wide range of APIs.
Does SR-IOV improve performance? ›It is compliant with the PCI-SIG SR-IOV specification and provides an easy and cost-effective way to integrate SR-IOV support into PCIe devices. In summary, the key benefits of using SR-IOV to achieve virtualization include: Enabling efficient sharing of PCIe devices, optimizing performance and capacity.
Why do we need SR-IOV? ›SR-IOV enables network traffic to bypass the software switch layer of the Hyper-V virtualization stack. Because the VF is assigned to a child partition, the network traffic flows directly between the VF and child partition.
What is DPDK and SR-IOV? ›The DPDK uses the SR-IOV feature for hardware-based I/O sharing in IOV mode. Therefore, it is possible to partition SR-IOV capability on Ethernet controller NIC resources logically and expose them to a virtual machine as a separate PCI function called a “Virtual Function”.
Is Vulkan written in C or C++? ›The Vulkan API provides a list of functions, what arguments to pass in, and the return type. The API is written in the C programming language, and should be compatible with a vast majority of languages.
Does Vulkan reduce CPU usage? ›The biggest advantage that Vulkan brings is reduced CPU load in the drivers and application rendering logic. This is achieved through the streamlining of the API interface and the ability to multi-thread the application.
Why is Vulkan so good? ›Vulkan has the added benefit of being a very thin API. The API itself defines many functions, but each individual function typically does very little work compared to higher level APIs like OpenGL or OpenCL, where each function performs a lot of work under the hood.
What is QEMU monitor? ›QEMU monitor. The QEMU monitor is used to give complex commands to the QEMU emulator. You can use it to: Remove or insert removable media images (such as CD-ROM or floppies). Freeze/unfreeze the Virtual Machine (VM) and save or restore its state from a disk file.
What is QEMU device? ›
QEMU provides virtual hardware devices to the guest system, allowing it to interact with the external world, just like if it were running on real hardware.
How do I change QEMU settings? ›- Access the platform project directory or the software development (SDK) directory. Command. ...
- Start the QEMU configuration tool. $ make config-target. ...
- Change the configuration to suit your environment and hardware. Enter the corresponding value and press ENTER to change the value of an option.
- Save the changes.
QEMU uses the virtualization architecture available on modern PC processors to manage translation between the emulated systems memory addresses and the host system memory Page 11 7 addresses [12].
Is QEMU single threaded? ›Overview. QEMU's system emulation mode could always emulate multiple vCPUs but it scheduled them in a single thread and executed each one in tern in a round-robin fashion.
Can QEMU emulate Windows? ›Windows can run fine under QEMU and KVM, but since installing it with QEMU or libvirt directly is not very straightforward, most people prefer using other hypervisors which have a fancy GUI.
Does KVM have a GUI? ›Issue the virt-manager command on the KVM host to launch the virtual machine manager GUI. The Virtual Machine Manager application user interface gets launched.
What is VNC in QEMU? ›The VNC server capability provides access to the graphical console of the guest VM across the network. This has a number of security considerations depending on the deployment scenarios.
What is SMP in QEMU? ›-smp <NUMBER> - Specify the number of cores the guest is permitted to use. The number can be higher than the available cores on the host system.
How do I enable KVM virtualization? ›- Shut down all running VMs and unload the kvm_probe module: sudo modprobe -r kvm_intel.
- Activate the nesting feature: sudo modprobe kvm_intel nested=1.
- Nested virtualization is enabled until the host is rebooted.
- To determine whether the svm or vmx CPU extensions are present, run this command: # grep -E 'svm|vmx' /proc/cpuinfo. This command generates output if the CPU is capable of hardware-virtualization. ...
- To list the loaded kernel modules and verify that the kvm modules are loaded, run this command: # lsmod | grep kvm.
How does QEMU use KVM? ›
QEMU can make use of KVM when running a target architecture that is the same as the host architecture. For instance, when running qemu-system-x86 on an x86 compatible processor, you can take advantage of the KVM acceleration - giving you benefit for your host and your guest system.
How do I know if QEMU is using KVM? ›if you have access to the QEMU monitor (Ctrl-Alt-2, use Ctrl-Alt-1 to get back to the VM display), enter the "info kvm" command and it should respond with "KVM support: enabled"
Is KVM virtualization good? ›Excellent performance: Apps run faster on KVM compared with other hypervisors. The open source advantage: Access the source code and get the flexibility to integrate with anything. Existing features of the Linux operating system: Security features.
Is KVM full virtualization? ›Kernel-based Virtual Machine (KVM) is a full virtualization solution for Linux®. In the KVM architecture, each guest (virtual machine) is implemented as a regular Linux process. After you install KVM, you can run multiple guests, with each of them running a different operating system image.
Why is KVM better than VMware? ›KVM clearly wins over VMware on the basis of cost. KVM is open source, so it doesn't incur any additional cost to the user. It's also distributed in a variety of ways, often as part of an open-source OS. VMware charges a license fee to use its products, including ESXi.
Why KVM is required? ›To sum up, a KVM is a device that allows one to quickly and easily switch between multiple PCs or servers from a single console (keyboard, monitor, mouse setup) for greater efficiency, management, and both cost and space saving.
Is QEMU faster than VirtualBox? ›VirtualBox is faster and has a better UI than QEMU. It's also a good choice only for x86 and x64 architectures. Lastly, VirtualBox doesn't require advanced knowledge or experience.
How do I enable QEMU monitor? ›- Start QEMU. Run the following command from the platform project directory: $ make start-target. ...
- Enter the monitor. In the target console, press CTRL+A C to access the QEMU Monitor. ...
- Quit the Monitor. When you are done using the Monitor, type q or quit to exit the QEMU Monitor.
A Gnome user interface for KVM. Karesansui is an open-source virtualization management application. It's smart graphical user interface lowers your management cost, and brings a total management/audit solution for both physical and virtual servers.