From owner-freebsd-current@FreeBSD.ORG Sat Jan 3 18:43:51 2015 Return-Path: Delivered-To: freebsd-current@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 B9A206AB; Sat, 3 Jan 2015 18:43:51 +0000 (UTC) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com [IPv6:2a00:1450:4010:c04::22f]) (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 39DF83721; Sat, 3 Jan 2015 18:43:51 +0000 (UTC) Received: by mail-lb0-f175.google.com with SMTP id z11so8100276lbi.6; Sat, 03 Jan 2015 10:43:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=GiSyidbPxy/Gs9nCPycQJZnYyJBBNDn99d5LnFySRYw=; b=QE0c20mJHkAeSSgiD8A7E0uvwCAN1q7ISc8J9MprNj9ZmBq0d0JdRMHJ0Oci8zqDI/ 15NU9dt9IgkIZU0KPCgBDaal2dWKKT17F7+rmTVSbZ1Caleu1fz0WpB0jA67vPCsTww2 uFMeaPj4/s4WvZ9W61XEz7BOrxO8siT5DMPFsk+sbYaiIKUS5wEkk6Mm+INiTaV9Nhmu 7+M4MYqlq1lG9RDZphJ0ubb3q1QSN7sxYT9q1zej4QIOmOFQptNzoMtwhSMmobhrHTku P6MhI3ajeR2iohW+lvcv/zjHQLb6cmJBvET5Vc2AFDwsjadMNMKjid0m/+ak6oT9tZsE Z0dA== MIME-Version: 1.0 X-Received: by 10.152.23.38 with SMTP id j6mr83342002laf.81.1420310629275; Sat, 03 Jan 2015 10:43:49 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.141.5 with HTTP; Sat, 3 Jan 2015 10:43:49 -0800 (PST) In-Reply-To: <20150103161511.GA94237@onelab2.iet.unipi.it> References: <20150103161511.GA94237@onelab2.iet.unipi.it> Date: Sat, 3 Jan 2015 10:43:49 -0800 X-Google-Sender-Auth: Mp0-d1I9PQYL90X99d22bDvx4-s Message-ID: Subject: Re: any primer on running bhyve guests sharing disk with host ? From: Craig Rodrigues To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-current Current , Neel Natu X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 18:43:51 -0000 On Sat, Jan 3, 2015 at 8:15 AM, Luigi Rizzo wrote: > Hi, > in order to do some kernel testing, I would like to run bhyve guests > using (through NFS, probably) the host's file system. > diskless(8) is probably one way to go, i was wondering if > someone has instructions for that. > Specifically: > - how to "bhyveload" a kernel (rather than the full disk image); > as an alternative, given a kernel, something to build an image > that can be passed to bhyveload > > - how to pass the necessary config (rootpath) to the client > without having to rely on a specialized dhcp server > > I used to be familiar with diskless configs, so i can probably sort > out the server side myself. > I don't think there is a way to do exactly what you want. I would recommend doing the following: (1) Enable bvmdebug in your kernel config: https://wiki.freebsd.org/BHyVe/gdb This allows you to do kgdb remote debugging into a bhyve VM. (2) Build your disk image with makefs. You can use this script as an example: https://github.com/freebsd/freebsd-ci/tree/master/scripts/build/build-ufs-image.sh If you still want the bhyve image to use the host's root file system, you can start with the information here: https://www.freebsd.org/doc/handbook/network-diskless.html since you won't be using PXE, you will need to populate these variables in loader.conf in your disk image: http://svnweb.freebsd.org/base/head/sys/nfs/nfs_diskless.c?revision=273174&view=markup#l146 -- Craig