From nobody Sun May 25 11:14:05 2025 X-Original-To: virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4b4xBj3rvhz5xRGx for ; Sun, 25 May 2025 11:15:09 +0000 (UTC) (envelope-from bogorodskiy@gmail.com) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b4xBg72z4z3J1x for ; Sun, 25 May 2025 11:15:07 +0000 (UTC) (envelope-from bogorodskiy@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=fXDirJVu; spf=pass (mx1.freebsd.org: domain of bogorodskiy@gmail.com designates 2a00:1450:4864:20::631 as permitted sender) smtp.mailfrom=bogorodskiy@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-ad5a11c2942so269321166b.3 for ; Sun, 25 May 2025 04:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748171705; x=1748776505; darn=freebsd.org; h=content-disposition:mime-version:message-id:subject:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=UFzDiA73F4CU7QfqtO3RaU4xd0x3T1diPrVtt4SrNN0=; b=fXDirJVuKPgvM2O78oN7GuLhTtiOIxAro8e8JNa72Hvt70xpcp8yYXqBuFe3vCxUr8 vxiQb2EYA5lgw8COQAKqvnZxgb5bfv1OlXkKiQq3OGSOKsIdESE6GrBf+5aLNCBYwpcd tf2MyPi0ZoXkRvsajsGLM3SUh2r0+O9+Pz2o4GkNoEsSH0kDCOJeGgC+xws0IYhf1a3b c6R3o8bWI1wRmG+WcJXIPJqjcry9Qvy/qwjcaCGe8fWYWnCS14NvrSF8NFOuCRJ6X7Ek G54s3DdeyY89mi8TLy34kEwdyzV+AF1bvTd7fkOugKWCifCO+Ze6+EBks2jcCE9pXMgo J/QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748171705; x=1748776505; h=content-disposition:mime-version:message-id:subject:to:from:date :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UFzDiA73F4CU7QfqtO3RaU4xd0x3T1diPrVtt4SrNN0=; b=E9BaYAFvotQ6h/naZ3rHBINwXwDAP46pdfQUz/jCN1LakgiTWgmu+6nSwKJDrimGha VHKUIIpNc5yXvat+mUgMGm3TYSMLEXjZ/elKroHawwOJxkHMt8ETfu0N9twLZHvayG25 wddMppZ1bf1i311cqLcfRCkYvCaj1dXhnFDcrcLMwqwGfAAogsUklm4UYBEcZC12VSVI q8XIV2f2nHSvK2IVBfsDYSKr2+GHxuaSjhDsYLUuylK2mKXuXOmIuZYIBSJxBTsG7RQS KNWAw/xQWb6Ie9Bc3H5H1+Xcn6MEK/gkM8s/87Sfsfx4JdUga4kJexaCM839NXk4Tt8W 6TZQ== X-Gm-Message-State: AOJu0YxTKV0uCsWB9wAybtRTtnKhGD+OdSYD7na9h75Z7/psj5W9p3iT Wa7sAM4J5xknzwBGfHXfTJUHOIRO0JPEouF7oAq/HjKW4ywZWkhCeqpQxPJBmsEdAkE= X-Gm-Gg: ASbGncsFVhUfCDwRfM7f1mwU6vuAqa8C2dLPTj/IifZ2iYXZYdSATpXg+QUT3Z5Td+z h7FgqRSYK1Pm9sgmg1mJRYvWdtjdtyhXJzhi247yuEUAGmzISQKUVZcSSrUaOwCg3X81T/rwN8E s00/g4qTdXB+FpCzbj3f9bJQVFMO5VEdU0I6MVjh8Rb37fLetp9ZjpplVEY683Ld91sBT7Oalrw 5wINxe0lI8V5R7RnoPuLkmloMqt5yUGPJ5HoGSOuG2LIlE5geUcSS66aHFr4SHqPq6G0smDIyg6 FJLQsRSTt0/pFL8ZdD7cty9qmFqkjtdShwsCz0EXo9K11NJbhfpsuNF/hGjrKSAprBR5/NcQwZB dfpOKiA== X-Google-Smtp-Source: AGHT+IHYytiLN/VLOrLBVmBJnkAp9ZS+weSQO70CF7gdeIpYBJ5LNBWDs6abqPLrguJhbNZSgZymJQ== X-Received: by 2002:a17:907:2d26:b0:ad4:d9c9:c758 with SMTP id a640c23a62f3a-ad85b04fe48mr467458566b.11.1748171705341; Sun, 25 May 2025 04:15:05 -0700 (PDT) Received: from tulp (80-115-115-199.cable.dynamic.v4.ziggo.nl. [80.115.115.199]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad52d080539sm1531907866b.66.2025.05.25.04.15.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 May 2025 04:15:04 -0700 (PDT) Date: Sun, 25 May 2025 13:14:05 +0200 From: Roman Bogorodskiy To: virtualization@freebsd.org Subject: bhyve: bootindex= not working? Message-ID: List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 4b4xBg72z4z3J1x X-Spamd-Bar: ++ X-Spamd-Result: default: False [2.05 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_SPAM_SHORT(0.83)[0.828]; NEURAL_SPAM_LONG(0.82)[0.817]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[novel@freebsd.org,bogorodskiy@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_NONE(0.00)[]; FROM_NEQ_ENVFROM(0.00)[novel@freebsd.org,bogorodskiy@gmail.com]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; PREVIOUSLY_DELIVERED(0.00)[virtualization@freebsd.org]; TO_DOM_EQ_FROM_DOM(0.00)[]; MLMMJ_DEST(0.00)[virtualization@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::631:from] Hi, I'm trying to understand how to use bootindex= configuration for disk devices. I start with a fresh copy of the VARs file: sudo cp /usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd /data/vars/freebsd_VARS.fd Then start a VM: sudo bhyve -c 2 -m 4096 -A -I -u -H -P \ -s 0:0,hostbridge \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,/data/vars/freebsd_VARS.fd,fwcfg=qemu \ -s 2:0,xhci,tablet -s 1:0,lpc \ -s 3:0,ahci,hd:/data/img/freebsd.img,bootindex=1,cd:/data/isos/FreeBSD-14.2-RELEASE-amd64-disc1.iso,bootindex=2 \ -s 5:0,fbuf,tcp=127.0.0.1:5920 -l com1,/dev/nmdm5A \ freebsd With this configuration I expect it to boot from the "hd" device. Instead, it boots into the installer. In the installer I see: # efibootmgr -v Boot to FW : false BootCurrent: 0001 Timeout : 0 seconds BootOrder : 0000, 0001, 0002, 0003 Boot0000* UiApp Fv(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331) +Boot0001* UEFI BHYVE SATA DVD ROM BHYVE-6057-BC56-DB6C PciRoot(0x0)/Pci(0x3,0x0)/Sata(0x1,0xffff,0x0) Boot0002* UEFI BHYVE SATA DISK BHYVE-412B-5D46-BC34 PciRoot(0x0)/Pci(0x3,0x0)/Sata(0x0,0xffff,0x0) Boot0003* EFI Internal Shell Fv(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1) Unreferenced Variables: # I thought maybe it doesn't pay attention to bootindex= when the VARs file is specified, so I tried like this: sudo bhyve -c 2 -m 4096 -A -I -u -H -P \ -s 0:0,hostbridge \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,fwcfg=qemu \ -s 2:0,xhci,tablet -s 1:0,lpc \ -s 3:0,ahci,hd:/data/img/freebsd.img,bootindex=1,cd:/data/isos/FreeBSD-14.2-RELEASE-amd64-disc1.iso,bootindex=2 \ -s 5:0,fbuf,tcp=127.0.0.1:5920 -l com1,/dev/nmdm5A \ freebsd Result is the same. Also, instead of this: -s 3:0,ahci,hd:/data/img/freebsd.img,bootindex=1,cd:/data/isos/FreeBSD-14.2-RELEASE-amd64-disc1.iso,bootindex=2 \ I've tried: -s 3:0,ahci-hd,/data/img/freebsd.img,bootindex=1 -s 4:0,ahci-cd,/data/isos/FreeBSD-14.2-RELEASE-amd64-disc1.iso,bootindex=2 \ No difference. No, going back to the very first command I used. In the installer's shell, I execute: # efibootmgr -o 0002 Boot to FW : false BootCurrent: 0001 Timeout : 0 seconds BootOrder : 0002 Boot0002* UEFI BHYVE SATA DISK BHYVE-412B-5D46-BC34 # And reboot. It boots from the disk now, according to the configuration: root@freebsd:~ # efibootmgr -v Boot to FW : false BootCurrent: 0002 Timeout : 0 seconds BootOrder : 0002, 0000, 0001, 0003 +Boot0002* UEFI BHYVE SATA DISK BHYVE-412B-5D46-BC34 PciRoot(0x0)/Pci(0x3,0x0)/Sata(0x0,0xffff,0x0) Boot0000* UiApp Fv(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331) Boot0001* UEFI BHYVE SATA DVD ROM BHYVE-6057-BC56-DB6C PciRoot(0x0)/Pci(0x3,0x0)/Sata(0x1,0xffff,0x0) Boot0003* EFI Internal Shell Fv(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1) Unreferenced Variables: root@freebsd:~ # Now, if I swap the bootindex= values to force to boot from the CD, it also has no effect, from now on it'll be booting from the disk. All in all, it looks like it stores boot options in the VARS file properly, but completely ignores the bootindex command line configuration. Is it a bug somewhere or am I doing something wrong? I'm running 15.0-CURRENT ~1 month old and edk2-bhyve-g202308_5. Guest is FreeBSD 14.2-RELEASE. Thanks, Roman