Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Jan 2014 15:12:10 -0800
From:      Peter Grehan <grehan@freebsd.org>
To:        Craig Rodrigues <rodrigc@FreeBSD.org>
Cc:        Peter Wemm <peter@wemm.org>, "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org>
Subject:   Re: Remote serial console for BHyve VM?
Message-ID:  <52CB384A.7050405@freebsd.org>
In-Reply-To: <CAG=rPVf-2ZoyUWP7q_S7voUn54nGKbtuWNtQX-KL3sJNMtb6MA@mail.gmail.com>
References:  <CAG=rPVf-2ZoyUWP7q_S7voUn54nGKbtuWNtQX-KL3sJNMtb6MA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Craig,

> I am working with Sean Bruno to set up some BHyve VM's.

  Great !

> If I want to have the VM's start via an rc.d script, and
> have the VM be headless, what is the best way to have
> the VM console still be accessible?
>
> Has anyone done something like use netcat
> to direct the BHyve stdio to a socket?
> That way the serial console could be accessed remotely
> via telnet or ssh.
>
> Is there a better way to do this?

  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,

Peter.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52CB384A.7050405>