Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Jan 2015 10:43:49 -0800
From:      Craig Rodrigues <rodrigc@FreeBSD.org>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        freebsd-current Current <freebsd-current@freebsd.org>, Neel Natu <neel@freebsd.org>
Subject:   Re: any primer on running bhyve guests sharing disk with host ?
Message-ID:  <CAG=rPVeix6%2BewNcDPL9YPe_ZciFMjOkOuFbXR2V_-3Y3qrujJw@mail.gmail.com>
In-Reply-To: <20150103161511.GA94237@onelab2.iet.unipi.it>
References:  <20150103161511.GA94237@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 3, 2015 at 8:15 AM, Luigi Rizzo <rizzo@iet.unipi.it> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG=rPVeix6%2BewNcDPL9YPe_ZciFMjOkOuFbXR2V_-3Y3qrujJw>