Re: any primer on running bhyve guests sharing disk with host ?

From: Craig Rodrigues <rodrigc_at_FreeBSD.org>
Date: Sat, 3 Jan 2015 10:43:49 -0800
On Sat, Jan 3, 2015 at 8:15 AM, Luigi Rizzo <rizzo_at_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
Received on Sat Jan 03 2015 - 17:43:51 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:54 UTC