FS#50778 - [qemu] Unable to PXE boot
Attached to Project:
Arch Linux
Opened by Gregory (rollenwiese) - Wednesday, 14 September 2016, 17:44 GMT
Last edited by David Runge (dvzrv) - Monday, 02 May 2022, 15:55 GMT
Opened by Gregory (rollenwiese) - Wednesday, 14 September 2016, 17:44 GMT
Last edited by David Runge (dvzrv) - Monday, 02 May 2022, 15:55 GMT
|
Details
Can anyone reproduce this? Not sure if packaging error or
upstream error
vanilla 4.7.2 kernel qemu 2.7 libvirt 2.2.0 virt-manager 1.4.0 Since the upgrade from qemu 2.6.1 to 2.7 a few days ago. I'm no longer able to PXE boot at all. Everything else appears to function normally. Non PXE booting and everything else is perfect. Obviously have restarted everying etc. Have tried the various network drivers also. This occurs on domains created with 2.6.1 or with 2.7 When I choose PXE boot, the machine moves to a paused state (crashed) immediately after the 'starting PXE rom execution...' message appears. Reverting to qemu 2.6.1 package corrects the issue. The qemu.log snippet follows below. I'm not sure how to troubleshoot this problem to determine if it's a packaging error by the distribution or a problem with qemu/kvm/kernel? --- qemu.log: 2016-09-12 16:36:33.867+0000: starting up libvirt version: 2.2.0, qemu version: 2.7.0, hostname: seneca LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin QEMU_AUDIO_DRV=spice /usr/sbin/qemu-system-x86_64 -name guest=c,debug- threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-6- c/master-key.aes -machine pc-i440fx-2.7,accel=kvm,usb=off,vmport=off -cpu Nehalem -m 2048 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 348009be-26d5-4dc7-b515- e8b45f5117ac -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-6- c/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot menu=on,strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x6.0x7 -device ich9-usb- uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x6 -device ich9-usb- uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x6.0x1 -device ich9- usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x6.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/var/lib/libvirt/images/c.qcow2,format=qcow2,if=none,id=drive- virtio-disk0 -device virtio-blk- pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio- disk0,bootindex=1 -netdev tap,fd=28,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:a0:95:7c,bus=pci.0,addr=0x 3 -chardev pty,id=charserial0 -device isa- serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/domain -6-c/org.qemu.guest_agent.0,server,nowait -device virtserialport,bus=virtio- serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_age nt.0 -chardev spicevmc,id=charchannel1,name=vdagent -device virtserialport,bus=virtio- serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -spice port=5901,addr=127.0.0.1,disable-ticketing,image- compression=off,seamless-migration=on -device qxl- vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vga mem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 -device intel- hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0- codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=2 -chardev spicevmc,id=charredir1,name=usbredir -device usb- redir,chardev=charredir1,id=redir1,bus=usb.0,port=3 -device virtio- balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -msg timestamp=on char device redirected to /dev/pts/0 (label charserial0) main_channel_link: add main channel client red_dispatcher_set_cursor_peer: inputs_connect: inputs channel client create KVM internal error. Suberror: 1 emulation failure EAX=801a8d00 EBX=000000a0 ECX=00002e20 EDX=0009d5e8 ESI=7ffa3c00 EDI=7fef4000 EBP=ffffffff ESP=00007b92 EIP=000006ab EFL=00000087 [--S--PC] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0000 00000000 ffffffff 00c09300 CS =9c4c 0009c4c0 ffffffff 00809b00 SS =0000 00000000 ffffffff 00809300 DS =9cd0 0009cd00 ffffffff 00c09300 FS =0000 00000000 ffffffff 00c09300 GS =0000 00000000 ffffffff 00c09300 LDT=0000 00000000 0000ffff 00008200 TR =0000 00000000 0000ffff 00008b00 GDT= 00000000 00000000 IDT= 00000000 000003ff CR0=00000010 CR2=00000000 CR3=00000000 CR4=00000000 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400 EFER=0000000000000000 Code=00 16 66 9c 66 60 0f a8 0f a0 06 1e 16 0e fa 2e 8e 1e 90 06 <0f> ae 06 d0 1c 0f 01 0e c6 1c 0f 01 06 c0 1c fc 66 b9 38 00 00 00 66 ba 10 02 00 00 66 68 --- /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 26 model name : Intel(R) Core(TM) i7 CPU 950 @ 3.07GHz stepping : 5 microcode : 0x11 cpu MHz : 3066.648 cache size : 8192 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 11 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid dtherm bugs : bogomips : 6135.85 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: |
This task depends upon
Closed by David Runge (dvzrv)
Monday, 02 May 2022, 15:55 GMT
Reason for closing: Upstream
Additional comments about closing: Fixed with qemu >= 2.8
Monday, 02 May 2022, 15:55 GMT
Reason for closing: Upstream
Additional comments about closing: Fixed with qemu >= 2.8
qemu-system-x86_64 -vga std -m 512M -smp cores=1 -enable-kvm -cpu host -drive file=/tmp/disk.img,format=raw,index=0,media=disk,if=virtio -net nic,model=virtio,macaddr=00:aa:bb:cc:dd:ee,vlan=0 -net tap,ifname=vm0,script=no,downscript=no -boot menu=on -boot n
DHCP, DNS, and TFTP server are handled by dnsmasq listening on qemu0 interface. Using built in Qemu ipxe for bios PXEBOOT and aur iPXE for efi PXEBOOT[1]
[1] https://aur.archlinux.org/packages/ipxe-git/
I have a bridge network device setup via systemd (br1). Through virt-manager I've always been able to use my 'br1' device where 'specify shared device' is requested and everything has previously worked fine. Everything actually still does work fine with 2.7, with the exception of a PXE boot.
Have you tried using qemu's built in tftp server? I've successfully booted OpenBSD 6.0 pxeboot and bsd.rd using the built in PXE server. No need to setup bridge with qemu's built in tftp server for network boot.
This command serves tftp files on /tmp/tftp
qemu-system-x86_64 -boot n -net nic,model=virtio,vlan=0 -net user,vlan=0,tftp=/tmp/tftp,bootfile=/pxeboot
If this fails for you, you can blame qemu's built in iPXE rom, but it works for me.
I just wish I could figure out what changed between 2.6.1 and 2.7 that crashes the machine when iPXE attempts to do anything related to my physical network.
Currently I have my tftp server setup on another Arch metal machine acting as a NAS. Other devices (including virtual machines) are directed to it via
'dhcp-boot=pxelinux.0,nas,192.168.9.103' dnsmasq option on my tomato router.
This has worked perfectly for years until now (It still works for physical hosts).
Perhaps then this is an issue with libvirt/qemu interaction. For me, no matter what the network setup (even NAT, host only) as soon as the boot process gets to PXE rom, the VM crashes immediately. No network activity takes place at all. All I see is this:
Booting from ROM...
iPXE (PCI 00:03.0) starting execution
I guess I have some more digging to do.
The above command works perfectly.
As soon as I add -enable-kvm, this triggers the immediate crash mentioned above when attempting the PXE boot.
As long as kvm is not enabled, my normal configuration works fine, but slowly.
The same is true for your command that serves the pxe files from /tmp via tftp protocol. When run with -enable-kvm, I get the immediate crash.
im having a crash with ipxe netboot on 2.7 with a Intel(R) Core(TM) i7 CPU 920 bit not on i7-4710HQ
I did a git bisect on qemu running a command to attempt a pxe boot as a test
good -> boot attempted
bad -> hang
anything else -> skip
Looks like the problems is with the efi-*rom files commit c52125ab9280733b8d265195f6ffe9c76772b0a5 (not sure why these are used for a bios boot though).
```
[peter@station30 qemu]$ git diff c52125ab9280733b8d265195f6ffe9c76772b0a5 c52125ab9280733b8d265195f6ffe9c76772b0a5^1
diff --git a/pc-bios/efi-e1000.rom b/pc-bios/efi-e1000.rom
index 4e61f9b..4bc89a3 100644
Binary files a/pc-bios/efi-e1000.rom and b/pc-bios/efi-e1000.rom differ
diff --git a/pc-bios/efi-e1000e.rom b/pc-bios/efi-e1000e.rom
deleted file mode 100644
index 192a437..0000000
Binary files a/pc-bios/efi-e1000e.rom and /dev/null differ
diff --git a/pc-bios/efi-eepro100.rom b/pc-bios/efi-eepro100.rom
index 66c5226..85b7f9b 100644
Binary files a/pc-bios/efi-eepro100.rom and b/pc-bios/efi-eepro100.rom differ
diff --git a/pc-bios/efi-ne2k_pci.rom b/pc-bios/efi-ne2k_pci.rom
index 8c3e5fd..ebafd84 100644
Binary files a/pc-bios/efi-ne2k_pci.rom and b/pc-bios/efi-ne2k_pci.rom differ
diff --git a/pc-bios/efi-pcnet.rom b/pc-bios/efi-pcnet.rom
index 802e225..6f19723 100644
Binary files a/pc-bios/efi-pcnet.rom and b/pc-bios/efi-pcnet.rom differ
diff --git a/pc-bios/efi-rtl8139.rom b/pc-bios/efi-rtl8139.rom
index 8827181..086551b 100644
Binary files a/pc-bios/efi-rtl8139.rom and b/pc-bios/efi-rtl8139.rom differ
diff --git a/pc-bios/efi-virtio.rom b/pc-bios/efi-virtio.rom
index 2fc0497..140c680 100644
Binary files a/pc-bios/efi-virtio.rom and b/pc-bios/efi-virtio.rom differ
diff --git a/pc-bios/efi-vmxnet3.rom b/pc-bios/efi-vmxnet3.rom
deleted file mode 100644
index 3d42635..0000000
Binary files a/pc-bios/efi-vmxnet3.rom and /dev/null differ
[peter@station30 qemu]$ git bisect bad
c52125ab9280733b8d265195f6ffe9c76772b0a5 is the first bad commit
commit c52125ab9280733b8d265195f6ffe9c76772b0a5
Author: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri Jun 24 14:18:19 2016 +0200
ipxe: update prebuilt binaries
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
:040000 040000 1cbe7b99f5fd330fab98804444b0d06f0c029b00 c3f45812b9f74080e08718c1923050e304ccc768 M pc-bios
[peter@station30 qemu]$ git bisect log
git bisect start
# good: [e8ad4d16808690e9c0d68b140218ca466c9309fc] ide: move headers to include folder
git bisect good e8ad4d16808690e9c0d68b140218ca466c9309fc
# bad: [d9e0dfa2462e32cc5c6c49401ad7bff36453f75c] block: Split bdrv_merge_limits() from bdrv_refresh_limits()
git bisect bad d9e0dfa2462e32cc5c6c49401ad7bff36453f75c
# skip: [1ec20c2a3aa5b90522d15fccf7f052a90f70ddaa] Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
git bisect skip 1ec20c2a3aa5b90522d15fccf7f052a90f70ddaa
# good: [d7f30403576f04f1f3a5fb5a1d18cba8dfa7a6d2] cputlb: don't cpu_abort() if guest tries to execute outside RAM or RAM
git bisect good d7f30403576f04f1f3a5fb5a1d18cba8dfa7a6d2
# good: [13f5e8003e7b67039cb7a19e41b4f7f7ac669cb3] qmp: fix spapr example of query-hotpluggable-cpus
git bisect good 13f5e8003e7b67039cb7a19e41b4f7f7ac669cb3
# good: [3173a1fd549b7fa0f7029b2c6a6b86ba6efa92aa] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160704' into staging
git bisect good 3173a1fd549b7fa0f7029b2c6a6b86ba6efa92aa
# good: [8662d7db392f906c7808014051b278ad1542db93] Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160705' into staging
git bisect good 8662d7db392f906c7808014051b278ad1542db93
# bad: [202204717a7e73971cccebd38c5d8ac4b0bfcef8] nbd: Advertise realistic limits to block layer
git bisect bad 202204717a7e73971cccebd38c5d8ac4b0bfcef8
# bad: [45027808cddf42ce002fb62824204d275d06504d] ipxe: add new roms to BLOBS
git bisect bad 45027808cddf42ce002fb62824204d275d06504d
# good: [1676103dc25e8b7d5bbd2ee7ae0bab08a02c1c88] e1000e: add boot rom
git bisect good 1676103dc25e8b7d5bbd2ee7ae0bab08a02c1c88
# good: [43716de6b3b24f949f8b95a0ae9e2e263dd4f1f0] vmxnet3: add boot rom
git bisect good 43716de6b3b24f949f8b95a0ae9e2e263dd4f1f0
# bad: [c52125ab9280733b8d265195f6ffe9c76772b0a5] ipxe: update prebuilt binaries
git bisect bad c52125ab9280733b8d265195f6ffe9c76772b0a5
# first bad commit: [c52125ab9280733b8d265195f6ffe9c76772b0a5] ipxe: update prebuilt binaries
[peter@station30 qemu]$ git bisect bad
c52125ab9280733b8d265195f6ffe9c76772b0a5 is the first bad commit
commit c52125ab9280733b8d265195f6ffe9c76772b0a5
Author: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri Jun 24 14:18:19 2016 +0200
ipxe: update prebuilt binaries
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
:040000 040000 1cbe7b99f5fd330fab98804444b0d06f0c029b00 c3f45812b9f74080e08718c1923050e304ccc768 M pc-bios
[peter@station30 qemu]$ git bisect log
git bisect start
# good: [e8ad4d16808690e9c0d68b140218ca466c9309fc] ide: move headers to include folder
git bisect good e8ad4d16808690e9c0d68b140218ca466c9309fc
# bad: [d9e0dfa2462e32cc5c6c49401ad7bff36453f75c] block: Split bdrv_merge_limits() from bdrv_refresh_limits()
git bisect bad d9e0dfa2462e32cc5c6c49401ad7bff36453f75c
# skip: [1ec20c2a3aa5b90522d15fccf7f052a90f70ddaa] Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
git bisect skip 1ec20c2a3aa5b90522d15fccf7f052a90f70ddaa
# good: [d7f30403576f04f1f3a5fb5a1d18cba8dfa7a6d2] cputlb: don't cpu_abort() if guest tries to execute outside RAM or RAM
git bisect good d7f30403576f04f1f3a5fb5a1d18cba8dfa7a6d2
# good: [13f5e8003e7b67039cb7a19e41b4f7f7ac669cb3] qmp: fix spapr example of query-hotpluggable-cpus
git bisect good 13f5e8003e7b67039cb7a19e41b4f7f7ac669cb3
# good: [3173a1fd549b7fa0f7029b2c6a6b86ba6efa92aa] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160704' into staging
git bisect good 3173a1fd549b7fa0f7029b2c6a6b86ba6efa92aa
# good: [8662d7db392f906c7808014051b278ad1542db93] Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160705' into staging
git bisect good 8662d7db392f906c7808014051b278ad1542db93
# bad: [202204717a7e73971cccebd38c5d8ac4b0bfcef8] nbd: Advertise realistic limits to block layer
git bisect bad 202204717a7e73971cccebd38c5d8ac4b0bfcef8
# bad: [45027808cddf42ce002fb62824204d275d06504d] ipxe: add new roms to BLOBS
git bisect bad 45027808cddf42ce002fb62824204d275d06504d
# good: [1676103dc25e8b7d5bbd2ee7ae0bab08a02c1c88] e1000e: add boot rom
git bisect good 1676103dc25e8b7d5bbd2ee7ae0bab08a02c1c88
# good: [43716de6b3b24f949f8b95a0ae9e2e263dd4f1f0] vmxnet3: add boot rom
git bisect good 43716de6b3b24f949f8b95a0ae9e2e263dd4f1f0
# bad: [c52125ab9280733b8d265195f6ffe9c76772b0a5] ipxe: update prebuilt binaries
git bisect bad c52125ab9280733b8d265195f6ffe9c76772b0a5
# first bad commit: [c52125ab9280733b8d265195f6ffe9c76772b0a5] ipxe: update prebuilt binaries
```
so I pulled that down
then to get older ipxebuilds to wokr its necessary to fixup parserom.pl and compile with make NO_WERROR=1
in ipxe
diff --git a/src/util/parserom.pl b/src/util/parserom.pl
index 28df606..5a849a5 100755
--- a/src/util/parserom.pl
+++ b/src/util/parserom.pl
@@ -157,7 +157,7 @@ sub process_isa_rom {
# Output Makefile rules for the specified ROM declarations
sub print_make_rules {
- my ( $state, my $image, my $desc, my $vendor, my $device, my $dup ) = @_;
+ my ( $state, $image, $desc, $vendor, $device, $dup ) = @_;
unless ( $state->{'is_header_printed'} ) {
print "# NIC\t\n";
print "# NIC\tfamily\t$state->{family}\n";
in qemu
diff --git a/roms/Makefile b/roms/Makefile
index 88b3709..86e967e 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -126,11 +126,13 @@ efi-rom-%: build-pxe-roms build-efi-roms
build-pxe-roms:
$(MAKE) -C ipxe/src CONFIG=qemu \
CROSS_COMPILE=$(x86_64_cross_prefix) \
+ NO_WERROR=1 \
$(patsubst %,bin/%.rom,$(pxerom_targets))
build-efi-roms: build-pxe-roms
$(MAKE) -C ipxe/src CONFIG=qemu \
CROSS_COMPILE=$(x86_64_cross_prefix) \
+ NO_WERROR=1 \
$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
git checkout 4e03af8ec2d497e725566a91fd5c19dd604c18a6
git bisect start
git bisect good
git bisect bad 0418631918
make clean ;make -j 8 efirom |& tee build.log
sudo cp ../pc-bios/efi-*.rom /usr/share/qemu/
test vm ipxeboot
git bisect good|bad
...
git bisect start
# good: [4e03af8ec2d497e725566a91fd5c19dd604c18a6] [autoboot] Display image information as part of the default control flow
git bisect good 4e03af8ec2d497e725566a91fd5c19dd604c18a6
# bad: [04186319181298083ef28695a8309028b26fe83c] [thunderx] Fix compilation with older versions of gcc
git bisect bad 04186319181298083ef28695a8309028b26fe83c
# good: [7544763626d67b352d4b1440336080d63c0be0b7] [infiniband] Avoid multiple calls to ib_cmrc_shutdown()
git bisect good 7544763626d67b352d4b1440336080d63c0be0b7
# good: [97c3f6e55a941a3caf3a0a36346d2e89f5a7b283] [iscsi] Include DHCP server address in iBFT
git bisect good 97c3f6e55a941a3caf3a0a36346d2e89f5a7b283
# bad: [17c6f322eef5e0a2250a89b140486cf07598d2fa] [arm] Add support for 64-bit ARM (Aarch64)
git bisect bad 17c6f322eef5e0a2250a89b140486cf07598d2fa
# good: [b696a5063e80aa68cb064a8ac0098edd31632555] [image] Skip misleading "format not recognised" error message
git bisect good b696a5063e80aa68cb064a8ac0098edd31632555
# bad: [65b32a0b7000f70a5bb1d33190d40f9b04c93172] [sis190] Fix building with GCC 6
git bisect bad 65b32a0b7000f70a5bb1d33190d40f9b04c93172
# bad: [9f91df422b9ec7f1db493ea2fe333d8e609b58f9] [build] Remove unnecessary dependency on zlib
git bisect bad 9f91df422b9ec7f1db493ea2fe333d8e609b58f9
# good: [fe62f3c8312c3747c1a6c375b502cffa65d60f63] [tg3] Fix _tg3_flag() for 64-bit builds
git bisect good fe62f3c8312c3747c1a6c375b502cffa65d60f63
# bad: [efd5cf9aadcaf36f45db5d1c3059197a8479567c] [efi] Eliminate use of libbfd
git bisect bad efd5cf9aadcaf36f45db5d1c3059197a8479567c
# bad: [71560d185475117b10994d839afe059577e7768c] [librm] Preserve FPU, MMX and SSE state across calls to virt_call()
git bisect bad 71560d185475117b10994d839afe059577e7768c
# first bad commit: [71560d185475117b10994d839afe059577e7768c] [librm] Preserve FPU, MMX and SSE state across calls to virt_call()
git revert 71560d185475117b10994d839afe059577e7768c
make clean ;make -j 8 efirom |& tee build.log
sudo cp ../pc-bios/efi-*.rom /usr/share/qemu/
All is good for me but this probably breaks the reason for the patch.
Upstream bug: https://bugs.launchpad.net/qemu/+bug/1623276/
Peter Pickford specifically thanked by the qemu team for the extremely helpful git bisect!