From owner-freebsd-virtualization@FreeBSD.ORG Sun Jan 12 03:46:59 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3628FB82; Sun, 12 Jan 2014 03:46:59 +0000 (UTC) Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com [IPv6:2a00:1450:4010:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84FD51FC9; Sun, 12 Jan 2014 03:46:58 +0000 (UTC) Received: by mail-la0-f42.google.com with SMTP id ec20so4296811lab.29 for ; Sat, 11 Jan 2014 19:46:56 -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=5FYfrU6PinRQ42tefRvkGfdIxeZVaf8ana0NOmMbzuM=; b=u4H47hRaoAH7bWU1/DRl1AyLJ+XoYFsonqVhOmeMhBcX2ydlgPWA/1WkKD/XrC3f29 0dTQPb2lSPzKBNd3Lh/zCPKl4v+dTusqwGLOe2CsIPILf4/qLDSC8JDL9f4gz05EYB1o z4k+dt24pUWrsH3xTEKD3MN+n4SHJfz7I4F2ucaOTsdPbNwpYP2GVZ0W+LCtbkK3cQ9O Fzko5gsVYvGihHpmLbddYjj9ZjONei1cKx42kZL8Lsu3G4Sf1nizuj/hAPLThdL3P+Zv qhd+wkIqfxu3GSqIcT2/tjhDtPBlY5TiQtxmFdmjlwpJeqav8CE1I+rhueavwNRkdZ6p kd8Q== MIME-Version: 1.0 X-Received: by 10.112.78.4 with SMTP id x4mr650211lbw.81.1389498416461; Sat, 11 Jan 2014 19:46:56 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.38.43 with HTTP; Sat, 11 Jan 2014 19:46:56 -0800 (PST) In-Reply-To: <52CB384A.7050405@freebsd.org> References: <52CB384A.7050405@freebsd.org> Date: Sat, 11 Jan 2014 19:46:56 -0800 X-Google-Sender-Auth: fIHhiwd5fMRiCPXbyExg6pRfAuE Message-ID: Subject: Re: Remote serial console for BHyve VM? From: Craig Rodrigues To: Peter Grehan Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: Peter Wemm , "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jan 2014 03:46:59 -0000 On Mon, Jan 6, 2014 at 3:12 PM, Peter Grehan wrote: > One way is to use the cloneable null-modem driver, nmdm(4). Others have > used tmux for this, but I'll give a quick overview of the former. > > kldload nmdm.ko before starting VMs, e.g. at boottime or in rc.conf's > kld_list variable. > > Use the '-c' option for bhyveload to point it at one end of an nmdm > instance, and use it in place of "stdio" in the bhyve commandline. > > bhyveload .... -c /dev/nmdm0A ... > bhyve ... -l com1,/dev/nmdm0A ... > > You can then attach to the other end (nmdm*B) with any tool of your > choice - cu, screen, or socat to relay the device to a network connection. > Some experimentation may be required :) > > later, > I did the following: (1) Put the following in /boot/loader.conf to load the nmdm driver on bootup: nmdm_load="YES" (2) I wrote a script with this: #!/bin/sh touch /dev/nmdm0A /usr/sbin/bhyvectl --vm=vm1 --destroy /usr/sbin/bhyveload -m 8G -d disk.img -c /dev/nmdm0A vm1 /usr/sbin/bhyve -c 2 -m 8G -A -H -P -g 0 -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,disk.img -l com1,/dev/nmdm0A vm1 When I ran the script, there was no output, which was a good sign. I then ran this command: cu -l /dev/nmdm0A and had full access to the console of the VM. Thanks!! -- Craig