project-machine / machine

Apache License 2.0
11 stars 7 forks source link

No console output with 9ebadddf962ca080de77ef2fc5da1e06665ee949 #25

Closed hallyn closed 1 year ago

hallyn commented 1 year ago

When I build machine+machined from main, kvm does run, but I don't get a UEFI shell or console output. When I revert 9ebadddf, I do. The difference in the qemu args is:

@@ -6,7 +6,7 @@ q35,accel=kvm,smm=on
 -cpu
 qemu64,+x2apic
 -qmp
-unix:/tmp/msockets-1486516804/qmp.sock,server=on,wait=off
+unix:/tmp/msockets-4193490892/qmp.sock,server=on,wait=off
 -m
 2048m
 -spice
@@ -38,15 +38,15 @@ file=/home/serge/.local/state/machine/ma
 -device
 ide-cd,drive=drive0,serial=livecd,bootindex=0,bus=ide.0,logical_block_size=512,physical_block_size=512
 -chardev
-socket,id=serial0,path=/tmp/msockets-1486516804/console.sock,server=on,wait=off
+socket,id=serial0,path=/tmp/msockets-4193490892/console.sock,server=on,wait=off
 -chardev
-socket,id=monitor0,path=/tmp/msockets-1486516804/monitor.sock,server=on,wait=off
+socket,id=monitor0,path=/tmp/msockets-4193490892/monitor.sock,server=on,wait=off
 -serial
 chardev:serial0
 -monitor
 chardev:monitor0
 -drive
-if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE_4M.secboot.fd
+if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.secboot.fd
 -drive
 if=pflash,format=raw,file=/home/serge/.local/state/machine/machines/livecd/trust/uefi-nvram.fd
 -global

It appears to be using the _4M ovmf code with main, and not otherwise.

raharper commented 1 year ago

Thanks for checking. There are two issues here:

1) machine or qcli needs to know what code to pair with the vars you are supplying. My initial look into detecting this did not release a way that we can detect what kind of vars file is being supplied (did was a smaller vars or the _4M version).

2) the supplier of the uefi vars to machine should provide both code and vars; they should always be a pair; we have no reason to believe a Vars generated from bootkit on Ubuntu will work with a code from say Fedora (even if they are of the same size).

hallyn commented 1 year ago

the supplier of the uefi vars to machine should provide both code and vars; they should always be a pair; we have no reason to believe a Vars generated from bootkit on Ubuntu will work with a code from say Fedora (even if they are of the same size).

How should this be done? https://github.com/project-machine/machine/blob/main/pkg/api/vm.go#L70 has uefi-vars, but I did not see a uefi-code option in the vm definition yaml.