eaksel / packer-Debian10

Packer configuration files for Debian 10
MIT License
10 stars 14 forks source link

VirtualBox UEFI starts Shell> after OVF import #4

Open Erriez opened 2 years ago

Erriez commented 2 years ago

@eaksel Thanks for creating this project. I've successfully built a Debian 10.10.0-amd64 VirtualBox VM, but after importing the OVF it starts the UEFI shell:

Screenshot from 2021-08-31 10-52-06

Latest VirtualBox version on Ubuntu 21.04: 6.1.26 r145957.

Shell> fs0:
FS0:\> dir
ls: File Not Found - 'FS0:\'

Do you have a suggestion how to automatically start the OS after power-on? Thanks!

eaksel commented 2 years ago

I'll try looking into it in the next few days. Thanks for reporting the issue.

Erriez commented 2 years ago

@eaksel. I could not find a solution in the meantime. Thanks!

eaksel commented 2 years ago

@Erriez, Found multiple ways of fixing this issue, but the only one that I've been able to make work during the build sequence is copying "/boot/efi/EFI/debian/grubx64.efi" to "/boot/efi/EFI/boot/bootx64.efi" (ref: https://blog.wbcchsyn.net/1574439775.html).

The other solutions are to boot into Debian using this command in the uefi shell: FS0:\EFI\debian\shimx64.efi

And once in Debian run one of these two commands:

Erriez commented 2 years ago

@eaksel Thanks for your investigation! I'll test it.

Erriez commented 2 years ago

Good news it that it works for UEFI builds. However, the change in setup.yml breaks build of debian10.json: https://github.com/eaksel/packer-Debian10/commit/13cc32e3bddb13f52d8d8623f885f409286ce3fe#r56149114

A suggestion is to set an environment variable in debian10_uefi.json to ignore steps Configure automatic UEFI Boot for VirtualBox x in setup.yml.

eaksel commented 2 years ago

Thanks for the feedback, I hadn't checked the bios build.

Added a check to only apply this to UEFI builds.

Based on lines 34-36 of this: https://github.com/openstack/ansible-hardening/blob/master/tasks/main.yml