From owner-freebsd-virtualization@FreeBSD.ORG Thu Nov 6 19:52:38 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46CB37C3 for ; Thu, 6 Nov 2014 19:52:38 +0000 (UTC) Received: from mail-lb0-x22d.google.com (mail-lb0-x22d.google.com [IPv6:2a00:1450:4010:c04::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCF0CEDD for ; Thu, 6 Nov 2014 19:52:37 +0000 (UTC) Received: by mail-lb0-f173.google.com with SMTP id n15so1524281lbi.4 for ; Thu, 06 Nov 2014 11:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=rU3XkV+BU69Hsbvtse1Ou3yfFxDHmamS0+VIa88jnPE=; b=RmT+cCVo5vTjnwoiq1c1beI3mKQNuP1/NPjR583D7Vb8HVtjGjDnpm9PImH4Pxy/Fy uj7LUKsrDZcMjaa/40J9flvw7feIhVjRS5Qs3/3RjmIcxVxHknQPZYdV52KKpgeXSd0P E303GUa+yxbce1zoklqMs5rgESz+0We4ce/3OeI7/6ZCHQPBmB6Zvu3OTtLJ/Tn8FHHH T0fAk4Y4MorELwb7Q2N2LB9FaRj3nstHnagjywU8u7k1JFfMGPm10jIw2xVjvJtApgtJ Wxje6uHHrBPw9fZtkKVWHmA2+ePZ5nVwV5SzcggBxVP56eipd6a4JiQYkV51zaX/Ujkg uVrQ== MIME-Version: 1.0 X-Received: by 10.112.16.39 with SMTP id c7mr6932079lbd.19.1415303555205; Thu, 06 Nov 2014 11:52:35 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.130.168 with HTTP; Thu, 6 Nov 2014 11:52:35 -0800 (PST) Date: Thu, 6 Nov 2014 11:52:35 -0800 X-Google-Sender-Auth: fVJ0ABY_2cspi3aFnx3-Zvyzve0 Message-ID: Subject: Booting a bhyve VM with NFS root? From: Craig Rodrigues To: "freebsd-virtualization@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 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: Thu, 06 Nov 2014 19:52:38 -0000 Hi, Has anyone tried the following: (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. 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 The pxeldr populates some kernel environment variables which are then used to mount a root file system: https://svnweb.freebsd.org/base/head/sys/nfs/nfs_diskless.c?revision=273174&view=markup#l145 Has anyone tried manually specifying these variables via the "bhyveload -e" arguments, and forcing the VM to mount its root file system over NFS? This would be handy for very quickly test booting a new buildworld. -- Craig