NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Booting CDs in Qemu



On Fri, 7 Aug 2020 at 12:54, Robert Nestor <rnestor%mac.com@localhost> wrote:
>
> OK, I tried doing this with just the rEFInd CD and it still didn’t boot - just get a blank screen.  Since you did this by copying the rEFInd files over to a bootable NetBSD CD (or did you copy them to an installed NetBSD disk?)  the two CD aren’t configured the same way.  Neither CD has an MSDOS partition/wedge for EFI and I can’t find where the files for UEFI booting are on the NetBSD CD.  My understanding of UEFI is that the boot files must live in an MSDOS/FAT partition, though that doesn’t explain how or why the rEFInd CD boots on real HW via UEFI.

As I said, I couldn't do anything with refind.iso either.

I created a vm with the UEFI selected, installed yesterday's -current
- which, as you know, installs both on BIOS and UEFI. I selected GPT
scheme for the disk, this obviously creates a MS-DOS formatted EFI
slice, where I later placed the requisite files from rEFInd, edited a
bit refind.conf to show the NetBSD menu clearly, rebooted into the
boot management environment and set the bootx64.efi from the refind
directory to be the primary option. So no iso involvement, the files
for the rEFInd tree were copied from the .zip file.

>
> So I’m even more confused now.
>
> -bob
>
> On Aug 7, 2020, at 2:58 AM, Chavdar Ivanov <ci4ic4%gmail.com@localhost> wrote:
>
> > On Fri, 7 Aug 2020 at 02:35, Robert Nestor <rnestor%mac.com@localhost> wrote:
> >>
> >> OK, thanks!   I’m not sure I fully understand what you mean by “moved the relevant file to the top”.  Do you mean you moved the \EFI\boot\bootx64.efi file to \EFI\bootx64.efi?
> >
> > I wrote this too late in the night. I mean I got into the EFI menu
> > setup, Boot Management and moved the last entry - for rEFInd - to the
> > top; the next entry was the one from the disk, which I can still
> > select to boot NetBSD directly.
> >
> >>
> >> There was an old reference I found in my search that seemed to imply this was  a solution, but then I don’t see how the NetBSD CD booted.  Doesn’t it’s bootx64.efi file live in \EFI\boot\bootx64.efi just like it does on the rEFInd CD?
> >
> > Yes.
> >
> > nbsdu# mount -t msdos /dev/dk0 /mnt/efi/
> > nbsdu# find /mnt/efi/ | egrep -v icons/
> > /mnt/efi/
> > /mnt/efi/EFI
> > /mnt/efi/EFI/boot
> > /mnt/efi/EFI/boot/bootia32.efi
> > /mnt/efi/EFI/boot/bootx64.efi
> > /mnt/efi/EFI/refind
> > /mnt/efi/EFI/refind/refind_x64.efi
> > /mnt/efi/EFI/refind/refind.conf
> > /mnt/efi/EFI/refind/icons
> > .......
> > /mnt/efi/NvVars
> >>
> >> -bob
> >>
> >> On Aug 6, 2020, at 7:26 PM, Chavdar Ivanov <ci4ic4%gmail.com@localhost> wrote:
> >>
> >>> On Fri, 7 Aug 2020 at 01:11, Chavdar Ivanov <ci4ic4%gmail.com@localhost> wrote:
> >>>>
> >>>> On Fri, 7 Aug 2020 at 01:05, Robert Nestor <rnestor%mac.com@localhost> wrote:
> >>>>>
> >>>>> Just dawned on me, I’m betting the NetBSD CD is configured to boot either via BIOS or UEFI and Qemu is probably trying BIOS first since that’s its default.
> >>>>
> >>>> No, it definitely says that it is booting in EFI mode. if you
> >>>> interrupt it and drop to the command prompt, you can see the efivars.
> >>>> The graphics is also wsfb and the console looks like the NetBSD
> >>>> console after a UEFI boot; X -configure makes the relevant xorg.conf
> >>>> file (however, modesetting does not work, one has to change it to
> >>>> wsfb; also in my case - over VNC - the mouse driver has to be changed
> >>>> to 'ws', although even this way it works incorrectly).
> >>>>
> >>>> I tried to boot the rEFInd.iso file, I presume the same you've tried -
> >>>> of v. 0.12 - and got the same result as you - just the logo in the
> >>>> middle of the screen.
> >>>>
> >>>> I'll install manually rEFInd in the vm I just spun up to see if it can
> >>>> be recognized.
> >>>
> >>> I was able to install rEFInd manually in the efi partition of that
> >>> NetBSD installation and boot it under OVMF (I rebooted the machine and
> >>> just hit 'escape' in the VNC window, which got me to the EFI setup
> >>> menu, where I located the relevant efi file and moved it to the top).
> >>>
> >>> Chavdar
> >>>
> >>>>
> >>>>>
> >>>>> -bob
> >>>>>
> >>>>> On Aug 6, 2020, at 6:20 PM, Chavdar Ivanov <ci4ic4%gmail.com@localhost> wrote:
> >>>>>
> >>>>>> With:
> >>>>>>
> >>>>>>
> >>>>>> /usr/pkg/bin/qemu-system-x86_64 \
> >>>>>>      -device qemu-xhci \
> >>>>>>      -device usb-tablet \
> >>>>>>      -machine q35 \
> >>>>>>      -bios /usr/pkg/share/ovmf/OVMFX64.fd \
> >>>>>>      -m 4096 \
> >>>>>>      -k en-gb \
> >>>>>>      -smp 2 \
> >>>>>>      -accel nvmm \
> >>>>>>      -vnc :1 \
> >>>>>>      -drive format=raw,file=/dev/zvol/rdsk/pail/testu-new \
> >>>>>>      -net tap,fd=3 3<>/dev/tap1 \
> >>>>>>      -net nic \
> >>>>>>      -cdrom /iso/NetBSD-9.99.69-amd64.iso
> >>>>>>
> >>>>>>
> >>>>>> I was able to boot today's -current in efi mode, no problem.
> >>>>>> Obviously, I access the console over vnc.
> >>>>>>
> >>>>>> Chavdar
> >>>>>>
> >>>>>> On Thu, 6 Aug 2020 at 23:33, Robert Nestor <rnestor%mac.com@localhost> wrote:
> >>>>>>>
> >>>>>>> Something simple I must be missing here.  I downloaded the CD image of rEFInd from:
> >>>>>>>      http://sourceforge.net/projects/refind/files/0.12.0/refind-cd-0.12.0.zip/download
> >>>>>>>
> >>>>>>> Burned it to a CD and tried booting that CD on my PC.  It doesn’t boot using BIOS, but it does boot using UEFI.  So I know the CD is good.  I saved the ISO file that I used to burn the CD.
> >>>>>>>
> >>>>>>> Tried booting the ISO file in qemu with:
> >>>>>>>      qemu-system-x86_64 -boot d -cdrom refind.iso -m 512
> >>>>>>>
> >>>>>>> And got an error that it couldn’t boot with error code 0009.  Ok this appears to mean that qemu tried booting it with a default BIOS boot which the CD isn’t configured for. The recommended solution is to either add the BIOS boot code to the CD or specify a OVMF/UEFI boot file to Qemu.
> >>>>>>>
> >>>>>>> Installed the OVMF package and tried booting again with:
> >>>>>>>      qmeu-system-x86_64 -bios /usr/pkg/share/ovmf/OVMFX64.bin —m 512 \
> >>>>>>>             -boot d -cdrom refind.iso
> >>>>>>>
> >>>>>>> Got the Tianocore splash screen then the UEFI shell.  Entered “exit” at the shell prompt and got a message "Graphics Console Started" and then nothing.  Also tried the OVMFIA32.fd file with identical results.  Adding “-vga std” to the command line didn’t change things either.
> >>>>>>>
> >>>>>>> For grins I added “-accel mvmm” to the command line and got the error:
> >>>>>>>      Failed to execute a VCPU
> >>>>>>>
> >>>>>>> So I have three questions:  First, what am I missing to get this bootable CD to boot up in qemu?  And second, is there a limitation in NVMM that prevents it from running this boot sequence? And finally, if I get the magic sequence that allows the CD to boot with qemu, is there a way of booting without getting the UEFI shell prompt?
> >>>>>>>
> >>>>>>> Thanks
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> ----
> >>>>>
> >>>>
> >>>>
> >>>> --
> >>>> ----
> >>>
> >>>
> >>>
> >>> --
> >>> ----
> >>
> >
> >
> > --
> > ----
>


-- 
----


Home | Main Index | Thread Index | Old Index