From owner-freebsd-current@FreeBSD.ORG Sun Jan 4 21:28:41 2015 Return-Path: Delivered-To: freebsd-current@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 F1DC48FE; Sun, 4 Jan 2015 21:28:40 +0000 (UTC) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id B21BF1308; Sun, 4 Jan 2015 21:28:40 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 6D98F7300B; Sun, 4 Jan 2015 22:33:25 +0100 (CET) Date: Sun, 4 Jan 2015 22:33:25 +0100 From: Luigi Rizzo To: Neel Natu Subject: Re: any primer on running bhyve guests sharing disk with host ? Message-ID: <20150104213325.GB22198@onelab2.iet.unipi.it> References: <20150103161511.GA94237@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: FreeBSD current , Neel Natu , Peter Grehan 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: Sun, 04 Jan 2015 21:28:41 -0000 On Sat, Jan 03, 2015 at 11:00:13AM -0800, Neel Natu wrote: > Hi Luigi, > > 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 > > > > You can use the "-h" option to bhyveload(8) to do this. thank you, i have it up and running now. For the records this is what I am using: sudo bhyveload -m 512 -h /tmp/diskless vm1 and in /tmp/diskless i have the following: boot/ loader.rc: set hint.uart.0.at="isa" set hint.uart.0.port="0x3F8" set hint.uart.0.flags="0x10" set vfs.root.mountfrom=nfs:192.168.1.126:/ boot /boot/kernel.diskless kernel.diskless The 'set' commands in loader.rc are enough to have the serial console detected and the root path. They could be given through -e options to bhyveload so in the end you only need to put a suitable kernel into /some/place/boot/kernel/kernel and call bhyveload -h /some/place -e hint.uart.0.at=isa ... Current issues which I am investigating: - for some reason the guest sends packets with invalid UDP checksums over vtnet0, which can be solved by removing (in if_vtnet.c) TXCSUM from if_capenable. - when using NFS root there seems to be no way to avoid the dhcp phase, which is unfortunate because it adds unnecessary delays to the boot. This can be probably fixed easily because there are already kenv variables (boot.netif.name and friends) for the purpose. cheers luigi