From owner-freebsd-hackers@freebsd.org Tue Feb 23 20:51:21 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D930AB1CEA for ; Tue, 23 Feb 2016 20:51:21 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x230.google.com (mail-oi0-x230.google.com [IPv6:2607:f8b0:4003:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12E1AC38 for ; Tue, 23 Feb 2016 20:51:21 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x230.google.com with SMTP id j125so88383592oih.0 for ; Tue, 23 Feb 2016 12:51:21 -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=hb+OUiBZl9RDrArJzxHIRdc6knR4zNx0Z0I4CyMUk/8=; b=EeF7MzSLeEZxX8Ozg1l2pl9gvpfVAxPghi5ZoOqx9nwlixcuy12LFgLWZRomyG86kc mm+Xhm8qV/zLLiUUjC62vIfaIq5ITyCLaqO9VCIcrw5/NCqHMzDCveeW66Ci7lnlFLjE A47VqeOaeMYnH0+mz1dMS42IFab6VSmTx8Ug6n6Gr0yMH/FB+UxVX1u2NSKsUupT7EYb 4BgAUF4V1ri6JgvWyRcfacB1GImfRY0ojs3bJk7IkiGJTtNwF/xNF9I/QsGx5bdxFLqf kU5g5gPprFUocg/96sTBOdbL+WqxyMuUa09xOfObfo2w5Gx9avGOrxSIARTZBsaVUUX0 oe6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=hb+OUiBZl9RDrArJzxHIRdc6knR4zNx0Z0I4CyMUk/8=; b=UNE0Di0m3YW0AKXDmoAo6oQJh+hX1XKVLrmZcZY4/NT6nEs+eoCQGm9iiUyb/Q6m75 qZEiIoNYncHmaNIeE2v2tsY2E05OApTRoB0NZT6WuoahyqLRoZvcXosqEbkRCT7Zu6q0 +PvVVt7NOS026htstTizai10SpFN5nVxtwJjCOONr77ygnOW04dey/opUoTRIZk9r6s4 bQCmRuNBpdxsGxaPd7iuFU7qhuNQm0U34OFNgEmVmXBkwiySSYyu41Xzf+J8jipSyjzB KnQr8OQ90UgbnKumudDjCkwyFLd75kl/6KyhDstX5rPd548o/AY61nftkvEEphD4XWzE RQ3w== X-Gm-Message-State: AG10YOTeIHma0JZdblkqf8OI0XofrTmj6iGpZJSbs85I7OrKSYwteF0/Q6gRmmoqEfG/Lem9OFkhLXJ2jwUaFA== MIME-Version: 1.0 X-Received: by 10.202.175.151 with SMTP id y145mr28210815oie.107.1456260680119; Tue, 23 Feb 2016 12:51:20 -0800 (PST) Sender: asomers@gmail.com Received: by 10.202.64.138 with HTTP; Tue, 23 Feb 2016 12:51:20 -0800 (PST) In-Reply-To: References: Date: Tue, 23 Feb 2016 13:51:20 -0700 X-Google-Sender-Auth: QKlGhfUJQG81Inq1OiWHkvmtUdk Message-ID: Subject: Re: Multi-boot dual-boot magic machine. From: Alan Somers To: Zaphod Beeblebrox Cc: FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 20:51:21 -0000 On Tue, Feb 23, 2016 at 1:11 PM, Zaphod Beeblebrox wrote: > So my end goal is this: that I can run win7 with an FreeBSD guest and I can > run FreeBSD with a win7 guest. and that both of these are achieved such > that there is one copy of each operating system on the workstation. > > Now... I have achieved the former --- that is FreeBSD boots both by itself > and under vmware hosted by win7. On the bare metal, this uses the nvidia > binary driver, but on the VM, it would be convenient if this used the > vmware driver. Not _just_ that, but the nvidia binary driver has several > options to drive two monitors where as the vmware instance would only have > one. > > Has anyone given any thought to > > 1. Detectiing system changes in loader > 2. Setting system environment variables from loader > 3. Having filesystem alternatives based on environment variables (a-la > DG-UX0 > > ... or some other way to achieve this? "sysctl kern.vm_guest" will tell you whether you're emulated or running on bare metal. You can use that in /etc/rc.conf to conditionally set anything you want. -Alan