Guest hast not initialized the display (yet)

LG runs great on my GVT-g setup. But one issue remains. After starting the VM the boot process is interrupted by 60s showing Guest hast not initialized the display (yet). This message appears after adding the mdev device. After this delay, the boot process continues normally. It’s not a big issue but to fix it would be nice…

Here the VM configuration:

 <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>win10-2</name>
  <uuid>981b542d-4598-4639-b3af-80775175555c</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit='KiB'>16777216</memory>
  <currentMemory unit='KiB'>16777216</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <os firmware='efi'>
    <type arch='x86_64' machine='pc-q35-8.2'>hvm</type>
    <firmware>
      <feature enabled='no' name='enrolled-keys'/>
      <feature enabled='yes' name='secure-boot'/>
    </firmware>
    <loader readonly='yes' secure='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE_4M.secboot.fd</loader>
    <nvram template='/usr/share/OVMF/OVMF_VARS_4M.fd'>/var/lib/libvirt/qemu/nvram/win10-2_VARS.fd</nvram>
    <boot dev='hd'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv mode='custom'>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
    <vmport state='off'/>
    <smm state='on'/>
  </features>
  <cpu mode='host-passthrough' check='none' migratable='on'>
    <topology sockets='1' dies='1' cores='4' threads='2'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none' discard='unmap'/>
      <source file='/home/gebi/priv/virtualization/VM_image/win10-2.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/home/gebi/priv/virtualization/windows/en-us_windows_10_iot_enterprise_ltsc_2021_x64_dvd_257ad90f.iso'/>
      <target dev='sdb' bus='sata'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/home/gebi/priv/virtualization/windows/virtio-win-0.1.266.iso'/>
      <target dev='sdc' bus='sata'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <controller type='usb' index='0' model='qemu-xhci' ports='15'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='2' port='0x11'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0x12'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x13'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='5' port='0x14'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
    </controller>
    <controller type='pci' index='6' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='6' port='0x15'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
    </controller>
    <controller type='pci' index='7' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='7' port='0x16'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/>
    </controller>
    <controller type='pci' index='8' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='8' port='0x17'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/>
    </controller>
    <controller type='pci' index='9' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='9' port='0x18'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='10' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='10' port='0x19'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/>
    </controller>
    <controller type='pci' index='11' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='11' port='0x1a'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/>
    </controller>
    <controller type='pci' index='12' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='12' port='0x1b'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x3'/>
    </controller>
    <controller type='pci' index='13' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='13' port='0x1c'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x4'/>
    </controller>
    <controller type='pci' index='14' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='14' port='0x1d'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x5'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:81:74:bb'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <input type='mouse' bus='virtio'>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </input>
    <input type='keyboard' bus='virtio'>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </input>
    <input type='keyboard' bus='ps2'/>
    <tpm model='tpm-crb'>
      <backend type='emulator' version='2.0'/>
    </tpm>
    <graphics type='spice' autoport='yes'>
      <listen type='address'/>
      <image compression='off'/>
    </graphics>
    <sound model='ich9'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
    </sound>
    <audio id='1' type='spice'/>
    <video>
      <model type='vga' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='mdev' managed='yes' model='vfio-pci' display='off' ramfb='off'>
      <source>
        <address uuid='12835d75-b349-4bd1-8482-8e035dc4584b'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </hostdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='1'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <watchdog model='itco' action='reset'/>
    <memballoon model='none'/>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='{&quot;driver&quot;:&quot;ivshmem-plain&quot;,&quot;id&quot;:&quot;shmem0&quot;,&quot;memdev&quot;:&quot;looking-glass&quot;}'/>
    <qemu:arg value='-object'/>
    <qemu:arg value='{&quot;qom-type&quot;:&quot;memory-backend-file&quot;,&quot;id&quot;:&quot;looking-glass&quot;,&quot;mem-path&quot;:&quot;/dev/kvmfr0&quot;,&quot;size&quot;:33554432,&quot;share&quot;:true}'/>
  </qemu:commandline>
</domain>

Screenshot from 2024-12-05 23-28-51

Where’s the VBIOS for that mdev device, either captured from the host while running or from SeaBIOS project? (see the comments on this tutorial via this thread). More details are available at the relevant page of the Arch Linux Wiki

You may also need the parameter x-igd-opregion=on for the mdev.

K3n.

this is because the mdev is the primary GPU, and is being initialised as the primary instead of the virtual spice video device by the guest BIOS. There is no solution to this in your scenario.

Thanks for the clarification;-

This is a bit off-topic, but the boot process does work normally when using BIOS firmware. But then I ran into another problem: the LG host on Win10 is reporting a random UUID. Then, I got a spice error: You have connected SPICE to the wrong guest. Interestingly, sometimes the reported UUID is 00000000-0000-0000-0000-000000000000. Then - and only then - everything works fine and spice connects!
As far as I know, B6 did not check the UUID (I have to check it after a downgrade). By the way, I don’t know how the UUID Looking Glass uses for SPICE is generated. Is there a way to correct the VM config? Or would it be possible to implement a command line option, to ignore the UUID?
Here is a terminal log, when the spice connection works:

00:00:00.000 [I]              main.c:1859 | main                           | Looking Glass (B7-rc1)
00:00:00.000 [I]              main.c:1860 | main                           | Locking Method: Atomic
00:00:00.000 [I]           cpuinfo.c:38   | cpuInfo_log                    | CPU Model: Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
00:00:00.000 [I]           cpuinfo.c:39   | cpuInfo_log                    | CPU: 1 sockets, 8 cores, 8 threads
00:00:00.020 [I]              main.c:1185 | lg_run                         | Using font: /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
00:00:00.020 [I]           ivshmem.c:128  | ivshmemOpenDev                 | KVMFR Device     : /dev/kvmfr0
00:00:00.025 [I]             audio.c:159  | audio_init                     | Using AudioDev: PipeWire
00:00:00.025 [I]                ps.c:245  | purespice_connect              | Connecting to socket 127.0.0.1:5900
00:00:00.034 [I]               rsa.c:178  | rsa_encryptPassword            | Using Nettle
00:00:00.035 [I]                ps.c:268  | purespice_connect              | Connected
00:00:00.035 [I]             agent.c:103  | agent_connect                  | Connected to the spice guest agent
00:00:00.035 [I]      channel_main.c:167  | onMessage_mainName             | Guest name: win10
00:00:00.035 [I]      channel_main.c:183  | onMessage_mainUUID             | Guest UUID: 937cc427-9930-4150-80e8-442a1fc721aa
00:00:00.048 [I]                ps.c:644  | ps_connectChannel              | RECORD channel connected
00:00:00.055 [I]                ps.c:644  | ps_connectChannel              | PLAYBACK channel connected
00:00:00.061 [I]                ps.c:644  | ps_connectChannel              | INPUTS channel connected
00:00:00.061 [I]           channel.c:323  | onMessage_notify               | [notify] keyboard channel is insecure
00:00:00.061 [I]               egl.c:289  | egl_initialize                 | Double buffering is off
00:00:00.061 [I]              main.c:1139 | tryRenderer                    | Using Renderer: EGL
00:00:00.061 [I]           wayland.c:120  | waylandInit                    | Compositor: gnome-shell
00:00:00.061 [I]           wayland.c:130  | waylandInit                    | Selected  : xdg
00:00:00.068 [I]                gl.c:58   | waylandGetEGLDisplay           | Using eglGetPlatformDisplay
00:00:00.102 [I]               egl.c:856  | egl_renderStartup              | Single buffer mode
00:00:00.105 [I]               egl.c:883  | egl_renderStartup              | EGL     : 1.5
00:00:00.105 [I]               egl.c:884  | egl_renderStartup              | Vendor  : Intel
00:00:00.105 [I]               egl.c:885  | egl_renderStartup              | Renderer: Mesa Intel(R) UHD Graphics 630 (CFL GT2)
00:00:00.105 [I]               egl.c:886  | egl_renderStartup              | Version : OpenGL ES 3.2 Mesa 24.0.9-0ubuntu0.2
00:00:00.105 [I]               egl.c:887  | egl_renderStartup              | EGL APIs: OpenGL OpenGL_ES 
00:00:00.105 [I]               egl.c:958  | egl_renderStartup              | Debug messages disabled, enable with egl:debug=true
00:00:00.130 [I]           eglutil.c:35   | swapWithDamageInit             | Using EGL_KHR_swap_buffers_with_damage
00:00:00.134 [I]              main.c:1491 | lg_run                         | ================================================================================
00:00:00.134 [I]              main.c:1492 | lg_run                         | The host application seems to not be running
00:00:00.134 [I]              main.c:1493 | lg_run                         | Waiting for the host application to start...
00:00:00.153 [I]              main.c:1590 | lg_run                         | Guest Information:
00:00:00.153 [I]              main.c:1591 | lg_run                         | Version  : B7-rc1
00:00:00.153 [I]              main.c:1612 | lg_run                         | UUID     : 00000000-0000-0000-0000-000000000000
00:00:00.153 [I]              main.c:1621 | lg_run                         | CPU Model: Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
00:00:00.153 [I]              main.c:1622 | lg_run                         | CPU      : 1 sockets, 4 cores, 8 threads
00:00:00.153 [I]              main.c:1624 | lg_run                         | Using    : D12
00:00:00.154 [I]              main.c:1710 | lg_run                         | OS       : Windows
00:00:00.154 [I]              main.c:1712 | lg_run                         | OS Name  : Windows 10 IoT Enterprise LTSC 2021 (Build: 19044) 
00:00:00.154 [I]              main.c:1734 | lg_run                         | Starting session