Open pietrushnic opened 1 month ago
v1.2.19 ISO works fine:
qemu-system-x86_64 \
-drive if=pflash,format=raw,readonly=on,file=Build/OvmfX64/DEBUG_GCC5/FV/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=Build/OvmfX64/DEBUG_GCC5/FV/OVMF_VARS.fd \
-net none \
-nographic \
-chardev file,path=debug.log,id=ovmf-debug -device isa-debugcon,iobase=0x402,chardev=ovmf-debug \
-device qemu-xhci,id=xhci -M q35 -m 2G \
/home/user/dts-base-image-v1.2.19.iso
First, it goes to GRUB, where I modify the kernel boot option:
The boot process takes ~80s (quite long), but finally I get:
Dasharo Tools Suite 1.2.19 DasharoToolsSuite ttyS0
DasharoToolsSuite login: root (automatic login)
____ __ ______ __ _____ _ __
/ __ \____ ______/ /_ ____ __________ /_ __/___ ____ / /____ / ___/__ __(_) /____
/ / / / __ `/ ___/ __ \/ __ `/ ___/ __ \ / / / __ \/ __ \/ / ___/ \__ \/ / / / / __/ _ \
/ /_/ / /_/ (__ ) / / / /_/ / / / /_/ / / / / /_/ / /_/ / (__ ) ___/ / /_/ / / /_/ __/
/_____/\__,_/____/_/ /_/\__,_/_/ \____/ /_/ \____/\____/_/____/ /____/\__,_/_/\__/\___/
DTS version v1.2.19
1) Dasharo HCL report - dump hardware information from this device
2) Install Dasharo firmware
4) Load your DES keys
8) Start SSH server
9) Shell
10) Power off system
11) Reboot system
Enter an option: 9
Entering shell, to leave type exit and press Enter or press LCtrl+D
Sometimes, when waiting too much in GRUB, I hit:
Booting a command list
Kernel panic - not syncing: IO-APIC + timer doesn't work! Boot with apic=debug and send a report. Then try booting with the 'noapic' option.
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.15.36-yocto-standard #1
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS unknown 02/02/2022
Call Trace:
<TASK>
dump_stack_lvl+0x38/0x49
dump_stack+0x10/0x12
panic+0xf4/0x299
setup_IO_APIC+0x811/0x877
? clear_IO_APIC+0x39/0x60
apic_intr_mode_init+0x107/0x10f
x86_late_time_init+0x24/0x35
start_kernel+0x5b5/0x668
x86_64_start_reservations+0x24/0x26
x86_64_start_kernel+0x86/0x8a
secondary_startup_64_no_verify+0xc2/0xcb
</TASK>
---[ end Kernel panic - not syncing: IO-APIC + timer doesn't work! Boot with apic=debug and send a report. Then try booting with the 'noapic' option. ]---
@pietrushnic
Downloaded v2.0.0-rc7
from releases
used bmaptool
bmaptool copy ~/Downloads/dts-base-image-v2.0.0-rc7.wic.gz dts.img
Run with
qemu-system-x86_64 -serial stdio \
-drive file=dts.img,if=virtio \
-device virtio-net,netdev=vmnic \
-netdev user,id=vmnic,hostfwd=tcp::5222-:22,hostfwd=tcp::8000-:8000 \
-m 4G -smp 8 \
-enable-kvm
Result
Dasharo Tools Suite Script 2.0.0-rc7
(c) Dasharo <contact@dasharo.com>
Report issues at: https://github.com/Dasharo/dasharo-issues
*********************************************************
** HARDWARE INFORMATION
*********************************************************
** System Inf.: QEMU Standard PC (i440FX + PIIX, 1996)
** Baseboard Inf.: QEMU
** CPU Inf.: pc-i440fx-8.1
** RAM DIMM 0: Not Specified
*********************************************************
** FIRMWARE INFORMATION
*********************************************************
** BIOS Inf.: SeaBIOS 1.16.3-1.fc39
*********************************************************
** 1) Dasharo HCL report
** 2) Install Dasharo Firmware
** 3) Restore firmware from Dasharo HCL report
** 4) Load your DPP keys
*********************************************************
R to reboot P to poweroff S to enter shell
K to launch SSH server L to enable sending DTS logs V to enable verbose mode
Enter an option:
Same if I use this file with OSFV from open-source-firmware-validation
repository:
HDD_PATH=<path/to/>dts.img ./scripts/ci/qemu-run.sh graphic os
@pietrushnic managed to start DTS in QEMU that's run inside virtual machine.
To get more verbose logs edit boot options:
linux /bzImage root=PARTUUID=076c4a2a-02 rootwait console=ttyS0,115200n8 ignore_loglevel systemd.log_level=debug
That way we can receive some information what's wrong
systemd[1]: Set up TFD_TIMER_CANCEL_ON_SET timerfd.
systemd[1]: Failed to stat /etc/localtime, ignoring: No such file or directory
systemd[1]: /etc/localtime doesn't exist yet, watching /etc instead.
traps: systemd[1] trap invalid opcode ip:7f869d262c60 sp:7ffdf60c61f0 error:0 in libsystemd-core-255.so[7f869d1ce000+ff000]
systemd[1]: Caught <ILL> from PID -1658442656.
systemd[1]: Caught <ILL>, dumped core as pid 82.
systemd[1]: Freezing execution.
I had similar errors when not using -enable-kvm
or emulating wrong CPU.
As -enable-kvm
doesn't work inside your VM I decided to add
-cpu Cascadelake-Server-v1
to your command from How to reproduce
.
There are some warnings from qemu so CPU used could be fine tuned, I choose
first that's compatible with all ABI versions from
https://qemu-project.gitlab.io/qemu/system/qemu-cpu-models.html
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.pcid [bit 17]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.x2apic [bit 21]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.tsc-deadline [bit 24]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.invpcid [bit 10]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx512f [bit 16]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx512dq [bit 17]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx512cd [bit 28]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx512bw [bit 30]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx512vl [bit 31]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:ECX.avx512vnni [bit 11]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EDX.spec-ctrl [bit 26]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EDX.ssbd [bit 31]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.0DH:EAX.xsavec [bit 1]
BdsDxe: loading Boot0002 "EFI Internal Shell" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(7C04A583-9E3E-4F1C-AD65-E05268D0B4D1)
BdsDxe: starting Boot0002 "EFI Internal Shell" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(7C04A583-9E3E-4F1C-AD65-E05268D0B4D1)
Managed to boot into DTS (used just released v2.0.0)
Dasharo Tools Suite Script 2.0.0
(c) Dasharo <contact@dasharo.com>
Report issues at: https://github.com/Dasharo/dasharo-issues
*********************************************************
** HARDWARE INFORMATION
*********************************************************
** System Inf.: QEMU Standard PC (Q35 + ICH9, 2009)
** Baseboard Inf.: QEMU
** CPU Inf.: pc-q35-8.2
** RAM DIMM 0: Not Specified
*********************************************************
** FIRMWARE INFORMATION
*********************************************************
** BIOS Inf.: EDK II unknown
*********************************************************
** 1) Dasharo HCL report
** 2) Install Dasharo Firmware
** 3) Restore firmware from Dasharo HCL report
** 4) Load your DPP keys
*********************************************************
R to reboot P to poweroff S to enter shell
K to launch SSH server L to enable sending DTS logs V to enable verbose mode
Enter an option:
I noticed that DTS is quite slow (e.g. showing interface is laggy).
One way to drastically increase performance is to enable nested hardware virtualization,
that way it's possible to use -enable-kvm
argument in QEMU instead of emualting CPU.
You might need to run qemu with sudo
.
This time there is only one warning
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000001H:ECX.svm [bit 2]
Thanks, I will verify that I already have a code that includes DTS: https://gitlab.com/opensecuritytraining/ost2-vm-image-builder/-/blob/arch4221-support/scripts/ost2.sh?ref_type=heads#L34
Testing it and adjusting it according to what you point to is a matter of testing it. The critical question is how nested virtualization will behave on various OSes that students may use. Also, please note I'm using Packer, not UI, so I have to figure out how to use vboxmanage modifyvm
to enable that, but that is something to figure out.
Component
Dasharo Tools Suite
Device
QEMU Q35 Emulator
Dasharo version
I'm using standard OVMF
Dasharo Tools Suite version
v2.0.0-rc7 (this field seem to be redunant when components is DTS)
Test case ID
No response
Brief summary
System hangs no matter which *.efi file I try to use.
How reproducible
Always
How to reproduce
YMMV in case of path fro OVMF.
Expected behavior
System boots and DTS menu is present.
Actual behavior
or
Screenshots
No response
Additional context
I'm trying to replace Alpine Linux in my workflow for firmware training.
Solutions you've tried
Use i440fx instead of q35. Maybe the issue is in
wic
image format?