From owner-freebsd-virtualization@freebsd.org Thu Jan 16 09:04:47 2020 Return-Path: Delivered-To: freebsd-virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C26822F28C for ; Thu, 16 Jan 2020 09:04:47 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 47yyv33DHnz3CWX for ; Thu, 16 Jan 2020 09:04:47 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id 6EB5022F28B; Thu, 16 Jan 2020 09:04:47 +0000 (UTC) Delivered-To: virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E7AD22F28A for ; Thu, 16 Jan 2020 09:04:47 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yyv32JdNz3CWW for ; Thu, 16 Jan 2020 09:04:47 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from mail.j.mat.cc (owncloud.cube.mat.cc [79.143.240.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.mat.cc", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: mat/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 2FC8A1F856 for ; Thu, 16 Jan 2020 09:04:47 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from atuin.in.mat.cc (unknown [IPv6:2a01:678:42:ffff:1de4:2f7a:3a3e:e087]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mat@mat.cc) by mail.j.mat.cc (Postfix) with ESMTPSA id 4A06B942D81 for ; Thu, 16 Jan 2020 09:04:44 +0000 (UTC) Date: Thu, 16 Jan 2020 10:04:42 +0100 From: Mathieu Arnold To: virtualization@freebsd.org Subject: Bhyve and UEFI NVRAM Message-ID: <20200116090442.xgmiwlaiwwyajqgk@atuin.in.mat.cc> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="v47xnaxtgqurptcj" Content-Disposition: inline X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 09:04:47 -0000 --v47xnaxtgqurptcj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I have been trying to install arch linux in bhyve, it works great if I uses the BIOS with grub, but for my purpose, I need to be able to boot using UEFI mode. So, I install the vm using the arch iso, it works just fine, I use the tutorial here https://wiki.archlinux.org/index.php/EFISTUB to boot using UEFI directly, without adding a layer of boot manager, which is basically using: efibootmgr --disk /dev/vda --part 1 --create --label "Arch Linux" --loader = /vmlinuz-linux --unicode 'root=3DPARTUUID=3DXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXX= XXXXX rw initrd=3D\initramfs-linux.img' --verbose to add a boot entry to the NVRAM with the correct "thingies" to get the UEFI firmware to find all it needs. It works correctly because if at that point I reboot the vm, it boots correctly into the arch installation, and as long as I don't stop/start the vm it works. Now, if I stop the vm and start it up again, it does not work anymore because whatever UEFI NVRAM efibootmgr wrote to, it seems it was only non volatile as long as the bhyve process was running, but it was not actually saved anywhere for later use. So, I am wondering, is there some magic bhyve thing that I could not find in the man page that would allow me to map the nvram to a file on the host? Or some other magic that would allow me to change the bhyve nvram from the bhyve command line? Regards, PS: as a side note, I don't use bhyve directly but I use it through sysutils/vm-bhyve, but it should probably not matter. --=20 Mathieu Arnold --v47xnaxtgqurptcj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEOraXidLtEhBkQLpbOkUW81GDzkgFAl4gJylfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNB QjY5Nzg5RDJFRDEyMTA2NDQwQkE1QjNBNDUxNkYzNTE4M0NFNDgACgkQOkUW81GD zkg0JA/+IOAraobp/AHPPLg7+ehJwbzUGmnoB0fOx3n+NJVrfsrk2NvfgV+CqBui nV/MlKtwwAHIOpV0Gb5vxDdxprzPkTXBZZvs58aYTd4PEvP445QDYNfeNWGjSiz+ IYvVEimrHrIrFJJjbOV3aj9XrBQXafiWmhkeYjMH64YaxbnFCp6eNmTno9bi/AaH jxb1ohM82/BN+stvErgPPMA0WHF+crf+ojot3uAl9n6KXIs8XFPORVUftEdwIlnh bWrenVe3WB+vNp1H/zcpZJfws71S+xq+8Kb7QqY7ne18iU1RHjbwle3Khk2U8LGl PmhJJ5Iy1e07BFfNC+/mh5modKf0yfWzhbkGmAJrg/cNwnbGIF4QpmC9aK5/1gZQ TuuNw/3nz1+1q9Ewvb0FeVN26Yl+ukqg9GcM+72vw/ZrD+ewVuhB79pNNblUR0h0 yyOmerwGIb+A//dzmk7KFsq4mkvUawZOOJTBplRd1NV6zhr71GfE0Y/B2q/Zp30a Qgr3CfsIHR0bOTWFogowRwTA+rMrPcpC4JHlw8/bjOxN9i231SuiO42lVPylXrtd zWGI5psQcvauHLmEbNDLhoxXuNvzsPZFoOPN89/rnSFgcGdG985EcVn9PwQfTIWj /QRI0qbpUgCocJMrJF1Lzjop9L+5JDuWqLUm+rw88YjmwpV7/QY= =DCP/ -----END PGP SIGNATURE----- --v47xnaxtgqurptcj--