coconut-svsm / svsm

COCONUT-SVSM
MIT License
122 stars 42 forks source link

guest os not in Boot Option, when use script/launch_guest.sh #482

Open tkyzp opened 1 month ago

tkyzp commented 1 month ago
FSOpen: Open 'EFI' Success
FSOpen: Open 'ubuntu' Success
FSOpen: Open 'BOOTX64.CSV' Success
FSOpen: Open '\EFI\ubuntu\BOOTX64.CSV' Success
EmuVariablesUpdatedCallback
FSOpen: Open 'NvVars' Success
Saved NV Variables to NvVars file
EmuVariablesUpdatedCallback
FSOpen: Open 'NvVars' Success
Saved NV Variables to NvVars file
EmuVariablesUpdatedCallback
FSOpen: Open 'NvVars' Success
Saved NV Variables to NvVars file
Reset System
DXE ResetSystem2: ResetType Cold, Call Depth = 1.
# shutdown here

It seems like must reboot to enter system, but qemu can not reboot here. This is my log err.log. Guest image is Ubuntu 22.04. I followed the steps to set it up, and I checked versions of host kernel, qemu, ovmf, guest kernel.

$ sudo dmesg|grep -i sev
[    0.000000] Command line: BOOT_IMAGE=/@/boot/vmlinuz-6.8.0-coco-0929+ root=UUID=4642eed2-3ad8-4f43-8905-d9b7460db2fe ro rootflags=subvol=@ mem_encrypt=on kvm_amd.sev=1 quiet crashkernel=512M-:192M
[    0.000000] SEV-SNP: RMP table physical range [0x0000000088400000 - 0x00000000a89fffff]
[    0.019213] Kernel command line: BOOT_IMAGE=/@/boot/vmlinuz-6.8.0-coco-0929+ root=UUID=4642eed2-3ad8-4f43-8905-d9b7460db2fe ro rootflags=subvol=@ mem_encrypt=on kvm_amd.sev=1 quiet crashkernel=512M-:192M
[    6.275390] ccp 0000:47:00.1: sev enabled
[    6.339093] ccp 0000:47:00.1: SEV firmware update successful
[    6.354122] ccp 0000:47:00.1: SEV firmware updated from 1.52.4 to 1.55.16
[    7.097685] Final command line is: elfcorehdr=0x60000000 BOOT_IMAGE=/@/boot/vmlinuz-6.8.0-coco-0929+ root=UUID=4642eed2-3ad8-4f43-8905-d9b7460db2fe ro rootflags=subvol=@ mem_encrypt=on kvm_amd.sev=1 quiet reset_devices systemd.unit=kdump-tools-dump.service nr_cpus=1 irqpoll usbcore.nousb
[    8.239587] ccp 0000:47:00.1: SEV API:1.55 build:16
[    8.239596] ccp 0000:47:00.1: SEV-SNP API:1.55 build:16
[    8.258481] kvm_amd: SEV enabled (ASIDs 256 - 509)
[    8.258483] kvm_amd: SEV-ES enabled (ASIDs 1 - 255)
[    8.258484] kvm_amd: SEV-SNP enabled (ASIDs 1 - 255)

can someone help with this?

tkyzp commented 1 month ago

I check the log again, and find that my system not in Boot Options .

[Bds]=============Begin Load Options Dumping ...=============
  Driver Options:
  SysPrep Options:
  Boot Options:
    Boot0001: UEFI QEMU QEMU HARDDISK        0x0001
    Boot0000: UiApp          0x0109
    Boot0002: EFI Internal Shell         0x0001
  PlatformRecovery Options:
    PlatformRecovery0000: Default PlatformRecovery       0x0001
[Bds]=============End Load Options Dumping=============

I use script/launch_guest.sh . How can I solve this problem.

tkyzp commented 1 month ago

Finally I solve it! The reason is that I use OVMF_CODE.fd and OVMF_VAR.fd instead of OVMF.fd, when creating the virtual machine. But coconut-svsm use OVMF.fd. So load options is missing.