Comment 0 for bug 1908512

Revision history for this message
EOLE team (eole-team) wrote :

Hello.

I can't boot ubuntu-20.04.1-live-server-amd64.iso with VNC graphic
using libvirt, there is an error message:

  graphics initialization failed
  Error setting up gfxboot
  boot:

after a moment, I see some other messages:

  graphics initialization failed
  Error setting up gfxboot
  boot:
  Could not allocate memory.
  boot
  Could not allocate memory.
  boot
  Could not allocate memory.
  boot

To reproduce:

- download ubuntu-20.04.1-live-server-amd64.iso to
  /var/lib/libvirt/images

- create a qcow2 image /var/lib/libvirt/images/disk0.qcow2

- create the following libvirt XML definition file

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
 <name>ubuntu-server-20.04.1</name>
 <title>ubuntu-server-20.04.1</title>
 <vcpu><![CDATA[4]]></vcpu>
 <cputune>
  <shares>205</shares>
 </cputune>
 <memory>2097152</memory>
 <os>
  <type arch='x86_64'>hvm</type>
 </os>
 <devices>
  <emulator><![CDATA[/usr/bin/qemu-system-x86_64]]></emulator>
  <disk type='file' device='disk'>
   <source file='/var/lib/libvirt/images/disk0.qcow2'/>
   <target dev='sda'/>
   <boot order='1'/>
   <driver name='qemu' type='qcow2' cache='none'/>
   <address type='drive' controller='0' bus='0' target='0' unit='0'/>
  </disk>
  <disk type='file' device='cdrom'>
   <source file='/var/lib/libvirt/images/ubuntu-20.04.1-live-server-amd64.iso'/>
   <target dev='hda' bus='ide'/>
   <boot order='2'/>
   <readonly/>
   <driver name='qemu' type='raw' cache='none'/>
  </disk>
  <graphics type='vnc' listen='0.0.0.0' port='5901' keymap='fr'/>
  <input type='tablet' bus='usb'/>
 </devices>
 <features>
  <acpi/>
 </features>
</domain>

- define the domaine with: virsh define ubuntu-server.xml

- start the domain with: virsh start ubuntu-server-20.04.1

- connect to the VNC port 5901

It's working fine when I try the following:

  qemu-system-x86_64 -m 2048 -smp 1 -vnc 0.0.0.0:1 -k fr -name test-boot -monitor pty -boot order=d -drive file=/var/lib/libvirt/images/disk0.qcow2,media=disk -drive file=/var/lib/libvirt/images/ubuntu-20.04.1-live-server-amd64.iso,media=cdrom

The non working qemu command line used by libvirt is:

  /usr/bin/qemu-system-x86_64 -name guest=ubuntu-server-20.04.1,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-7-ubuntu-server-20.04./master-key.aes -machine pc-i440fx-focal,accel=kvm,usb=off,dump-guest-core=off -cpu qemu64 -m 2048 -overcommit mem-lock=off -smp 4,sockets=4,cores=1,threads=1 -uuid 503e911c-f7a5-48ef-8241-36bdbc75b9a3 -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=31,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -no-acpi -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device lsi,id=scsi0,bus=pci.0,addr=0x3 -blockdev {"driver":"file","filename":"/var/lib/libvirt/images/disk0.qcow2","node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage","backing":null} -device scsi-hd,bus=scsi0.0,scsi-id=0,device_id=drive-scsi0-0-0,drive=libvirt-2-format,id=scsi0-0-0,bootindex=1,write-cache=on -blockdev {"driver":"file","filename":"/var/lib/libvirt/images/ubuntu-20.04.1-live-server-amd64.iso","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-1-format","read-only":true,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"} -device ide-cd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=2,write-cache=on -vnc 0.0.0.0:1 -k fr -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on