Changes between Version 14 and Version 15 of qemu


Ignore:
Timestamp:
09/19/2022 02:31:19 PM (19 months ago)
Author:
pierre
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • qemu

    v14 v15  
    272272
    273273=== Virtio block device ===
    274 Qemu command line options are numerous and redundant. There are often several ways to do the same thing. I'll describe "stacking" block devices, and using this stack as a device on the guest. For more information, have a look at the qemu documentation. Usually, a whole disk on the guest is actually only a file on the host. Suppose a qcow2 image has been created with qemu-img as /path/to/image.qcow2. Then the first level of the stack is given by:
     274Qemu command line options are numerous and redundant. There are often several ways to do the same thing. A way to enable virtio block device is described in the "Meaning of the command line options" paragraph in the book's page. I'll describe "stacking" block devices, and using this stack as a device on the guest. This allows more flexibility in defining what is passed to the guest. For more information, have a look at the qemu documentation. Usually, a whole disk on the guest is actually only a file on the host. Suppose a qcow2 image has been created with qemu-img as /path/to/image.qcow2. Then the first level of the stack is given by:
    275275{{{
    276276-blockdev driver=file,node-name=img1,filename=/path/to/image.qcow2
     
    300300
    301301=== Virtio GPU ===
    302 TODO
     302There are two main ways to obtain graphics acceleration in qemu:
     303- '''GPU pass-through''': this allows the guest to access directly the hardware GPU through MMIO. It provides native performance. But the drawback is that the GPU is reserved for the guest, so if there is only one GPU, the host display is lost. So this configuration is only usable on machine with two GPUs (either two video cards, or a video card and a integrated GP on the CPU). This setting will not be described further here. There are many tutorials on internet.
     304- '''Virtio GPU''': the graphics primitive are converted to GL, and sent directly to the GL engine on the host. This can be used inside a window on the host display.
     305
     306The virtio GPU is only enabled in qemu if it is built against [https://gitlab.freedesktop.org/virgl/virglrenderer/-/releases virglrenderer]. Grab the most recent version, and build it with:
     307{{{
     308mkdir build &&
     309cd    build &&
     310
     311meson --prefix=/usr -Dvideo=true .. &&
     312ninja
     313# as root
     314ninja install
     315}}}
     316The `-Dvideo=true` switch enables video acceleration. Then rebuild qemu. virgl should be enabled automatically.
     317
     318On the guest kernel, two switches need to be enabled:
     319{{{
     320Device Drivers --->TODO
     321
    303322
    304323[wiki:Virtualization Up][[br]]