Changes between Version 14 and Version 15 of qemu
- Timestamp:
- 09/19/2022 02:31:19 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TabularUnified qemu
v14 v15 272 272 273 273 === 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 onthe 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:274 Qemu 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: 275 275 {{{ 276 276 -blockdev driver=file,node-name=img1,filename=/path/to/image.qcow2 … … 300 300 301 301 === Virtio GPU === 302 TODO 302 There 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 306 The 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 {{{ 308 mkdir build && 309 cd build && 310 311 meson --prefix=/usr -Dvideo=true .. && 312 ninja 313 # as root 314 ninja install 315 }}} 316 The `-Dvideo=true` switch enables video acceleration. Then rebuild qemu. virgl should be enabled automatically. 317 318 On the guest kernel, two switches need to be enabled: 319 {{{ 320 Device Drivers --->TODO 321 303 322 304 323 [wiki:Virtualization Up][[br]]