From owner-freebsd-virtualization@FreeBSD.ORG Wed Feb 25 16:53:06 2015 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B06CDC1B; Wed, 25 Feb 2015 16:53:06 +0000 (UTC) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2a00:14b0:4200:32e0::1ea]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gilb.zs64.net", Issuer "Cryptonomicore CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 75C5B2E9; Wed, 25 Feb 2015 16:53:06 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id 1DE32142F60; Wed, 25 Feb 2015 16:53:02 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Booting a bhyve VM with NFS root? From: Stefan Bethke In-Reply-To: Date: Wed, 25 Feb 2015 17:53:02 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Craig Rodrigues X-Mailer: Apple Mail (2.1878.6) Cc: "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.18-1 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: Wed, 25 Feb 2015 16:53:06 -0000 Am 06.11.2014 um 20:52 schrieb Craig Rodrigues : > Hi, >=20 > Has anyone tried the following: >=20 > (1) Create a disk image, which only has the contents of the /boot > directory > and /etc/fstab. > (2) /etc/fstab should specify the root file system over NFS > (3) Boot the disk image in bhyve. The loader will parse = /etc/fstab, > and it will also load the kernel and boot it. When the kernel > boots > it will mount the root file system over NFS. >=20 > For a real system running with a BIOS, PXE can be used for a lot of = this: > https://www.freebsd.org/doc/handbook/network-diskless.html >=20 > The pxeldr populates some kernel environment variables which are then > used to mount a root file system: >=20 > = https://svnweb.freebsd.org/base/head/sys/nfs/nfs_diskless.c?revision=3D273= 174&view=3Dmarkup#l145 >=20 > Has anyone tried manually specifying these variables > via the "bhyveload -e" arguments, and forcing the VM to mount its root = file > system over NFS? >=20 > This would be handy for very quickly test booting a new buildworld. Here's a quick hack to get the necessary variables in the appropriate = format: https://github.com/stblassitude/boot_root_nfs I think the kernel should learn how to do the necessary mount RPC if the = handle is not set, but I don't think I'm up to implementing that... Stefan --=20 Stefan Bethke Fon +49 151 14070811