From nobody Wed Jul 1 13:11:52 2026 X-Original-To: virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gr0mC3T6nz6kHfc for ; Wed, 01 Jul 2026 13:12:11 +0000 (UTC) (envelope-from polarian@polarian.dev) Received: from mail.polarian.dev (mail.polarian.dev [IPv6:2001:8b0:57a:2385::8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gr0mB0X4Rz45jf for ; Wed, 01 Jul 2026 13:12:09 +0000 (UTC) (envelope-from polarian@polarian.dev) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=polarian.dev header.s=polarian header.b="UZD5t/hl"; dmarc=pass (policy=reject) header.from=polarian.dev; spf=pass (mx1.freebsd.org: domain of polarian@polarian.dev designates 2001:8b0:57a:2385::8 as permitted sender) smtp.mailfrom=polarian@polarian.dev DKIM-Signature: v=1; a=rsa-sha256; c=simple/relaxed; d=polarian.dev; s=polarian; t=1782911518; bh=tmh4TlWn5gjrE2fx+bgahqBUsSj3NMHI+1XOxHOyidk=; h=Date:From:To:Subject:In-Reply-To:References; b=UZD5t/hl9UcUrUGj7WN3OrKkXctXzcbBc5mkzT8tYhy482xCZTxFCdb+ocpuhsjS4 okjxwh7F2VcsrKRRiDH6pxhJYSrChREl/qN0FGeiD4T3jjG/sRP4L6hkWC5ak6MNLK Wsqsfn2LewT2YibeVWCXdmfjqjhivdyW583V2YxE= Date: Wed, 1 Jul 2026 14:11:52 +0100 From: Polarian To: virtualization@freebsd.org Subject: Re: Graceful shutdown of Bhyve VM? Message-ID: <20260701141152.256ee3ad@Hydrogen> In-Reply-To: References: <06b91174-b5d3-4203-9115-75b1e38a805d@ikmail.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; amd64-portbld-freebsd15.0) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-2.42 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.92)[-0.923]; DMARC_POLICY_ALLOW(-0.50)[polarian.dev,reject]; MID_RHS_NOT_FQDN(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:8b0:57a:2385::8]; R_DKIM_ALLOW(-0.20)[polarian.dev:s=polarian]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; ASN(0.00)[asn:20712, ipnet:2001:8b0::/34, country:GB]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[virtualization@freebsd.org]; RCVD_COUNT_ZERO(0.00)[0]; DKIM_TRACE(0.00)[polarian.dev:+] X-Spamd-Bar: -- X-Rspamd-Queue-Id: 4gr0mB0X4Rz45jf Hey, Sorry for replying to a thread a week late, I haven't been monitoring my email much. One of the benefits of jailing bhyve is that I can automate this easily through bringing the jail up and down whenever I want the vm to come up and down. When the jail is brought up, the bhyve script is ran, and the vm boots automatically, and when the jail is brought down TERM is sent to the process gracefully shutting down the VM. The one thing you need to bare in mind is the default jail timeout (the time it gives the jail to stop before SIGKILL) is only a couple of seconds, which if you are using spinning rust, isn't long enough for an OS to gracefully shutdown. I usually set the timeout to 2 minutes, which I feel is a good middle ground, if a VM can't shutdown within 2 mins there's a problem! Hope this helps, -- Polarian Jabber/XMPP: polarian@icebound.dev