Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The debian-efi example VM throws you into the EFI shell once built. #148

Open
Folaht opened this issue Jul 27, 2023 · 2 comments
Open

The debian-efi example VM throws you into the EFI shell once built. #148

Folaht opened this issue Jul 27, 2023 · 2 comments
Labels

Comments

@Folaht
Copy link

Folaht commented Jul 27, 2023

Overview of the Issue

The boot command is written to get out of the EFI shell
and the end result despite having installed grub,
still throws you into the EFI shell.

Reproduction Steps

packer build efi-debian.pkr.hcl

Plugin and Packer version

1.0.9 & 1.9.1

Simplified Packer Buildfile

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

locals {
	ssh_username     = "debian"
  ssh_password     = "debian"
}

source "qemu" "debian_efi" {
	iso_url          = "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.1.0-amd64-netinst.iso"
	iso_checksum     = "sha256:9f181ae12b25840a508786b1756c6352a0e58484998669288c4eec2ab16b8559"
	communicator     = "ssh"
	ssh_username     = local.ssh_username
	ssh_password     = local.ssh_password
	ssh_timeout      = "30m"
	output_directory = "./out"
	memory           = "1024"
	disk_size        = "6G"
	cpus             = 4
	format           = "qcow2"
	accelerator      = "kvm"
	vm_name          = "debian_efi"
	# headless         = "false" # uncomment to see the boot process in a qemu window
	machine_type     = "q35" # As of now, q35 is required for secure boot to be enabled
	# Refer to the boot_steps attribute for more information on usage https://developer.hashicorp.com/packer/plugins/builders/qemu#boot_steps
	boot_steps     = [
		["<wait12s><down><down><enter>", "Advanced options.."],
		["<wait><down><down><down><down><down><enter>", "automatic install"],
		["<wait1m>", "Wait 1m for preseed prompt"],
    ["<wait>http://{{.HTTPIP}}:{{.HTTPPort}}/preseed.cfg<tab><enter>", "select preseed medium"],
    ["<wait5s><enter>", "select English as language/locale"],
		["<wait><enter>", "select English as language"],
		["<wait><enter>", "set English-US as keyboard layout"],
		["<wait10s>root<enter>", "set root password"],
		["<wait>root<enter>", "confirm root password"],
		["<wait>debian<enter>", "set machine name to debian"],
		["<wait><enter>", "set user to debian"],
		["<wait>debian<enter>", "set password to debian"],
		["<wait>debian<enter>", "confirm password to debian"],
		["<wait6m>", "wait 6m for system to install"],
		["debian<enter>debian<enter>echo \"AllowUsers debian\" | tee -a /etc/ssh/sshd_config<enter>systemctl restart sshd<enter>exit<enter>", "configure sshd to allow root connection"],
	]
	http_directory = "http"
	boot_wait     = "20s"
	cpu_model      = "host"
	qemuargs          = [
		["-vga","virtio"] # if vga is not virtio, output is garbled for some reason
	]
	vtpm              = true
	efi_firmware_code = "/usr/share/edk2/x64/OVMF_CODE.4m.fd"
	efi_firmware_vars = "/usr/share/edk2/x64/OVMF_VARS.4m.fd"
}

build {
	sources = ["source.qemu.debian_efi"]

	provisioner "shell" {
		inline = [ "(echo root | su -c dmesg | grep -qi 'Secure boot enabled') && echo \"Secure Boot is on!\"" ]
	}
}

Operating system and Environment details

$neofetch
██████████████████  ████████   folaht@xxx
██████████████████  ████████   ------------------
██████████████████  ████████   OS: Manjaro Linux x86_64
██████████████████  ████████   Kernel: 6.1.31-2-MANJARO
████████            ████████   Uptime: 14 days, 4 hours, 57 mins
████████  ████████  ████████   Packages: 1560 (pacman)
████████  ████████  ████████   Shell: bash 5.1.16
████████  ████████  ████████   Resolution: 3840x1080
████████  ████████  ████████   DE: Xfce 4.18
████████  ████████  ████████   WM: Xfwm4
████████  ████████  ████████   WM Theme: Matcha-sea
████████  ████████  ████████   Theme: Matcha-sea [GTK2], Adwaita [GTK3]
████████  ████████  ████████   Icons: Papirus-Maia [GTK2], Adwaita [GTK3]
████████  ████████  ████████   Terminal: alacritty
                               CPU: Intel Pentium Silver J5040 (4) @ 3.200GHz
                               GPU: Intel GeminiLake [UHD Graphics 605]
                               Memory: 5625MiB / 35734MiB

Log Fragments and crash.log files

I don't think this is a crash log issue.

@Folaht Folaht added the bug label Jul 27, 2023
@Folaht Folaht changed the title The debia-efi example throws you into the EFI shell. Both during the build as well as after the build. The debian-efi example VM throws you into the EFI shell once built. Jul 27, 2023
@ifurther
Copy link

ifurther commented Jan 14, 2024

Maybe remove the efi_firmware_vars, it will not boot. It only can use above 7.0

@stefangweichinger
Copy link

I think I hit the same issue. Is there a solution already? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants