From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] doc: Add information related to network connectivity with qemu. Date: Thu, 29 Sep 2016 12:24:54 +0200 Message-ID: <877f9v80ll.fsf@gnu.org> References: <20160928164925.16921-1-david@craven.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpYWU-0006Fr-Ee for guix-devel@gnu.org; Thu, 29 Sep 2016 06:25:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpYWQ-0004AO-DL for guix-devel@gnu.org; Thu, 29 Sep 2016 06:25:02 -0400 In-Reply-To: <20160928164925.16921-1-david@craven.ch> (David Craven's message of "Wed, 28 Sep 2016 18:49:25 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: David Craven Cc: guix-devel@gnu.org Hello! David Craven skribis: > * doc/guix.text: Add it. Could you mention the sections modified/added? See c8b543741f422ecf41e7635c6a1c40b3bd55947a for an example. I only have cosmetic suggestions: > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -11030,6 +11030,45 @@ which may be insufficient for some operations. > The file name of the qcow2 image. > @end table >=20=20 > +The default @command{run-vm.sh} script that is returned by an invokation= of > +@command{guix system vm} does not add a @command{-net user} flag by defa= ult. > +To get network access from within the vm add the @code{(dhcp-client-serv= ice)} > +to your system definition and start the vm using s/vm/VM/ > +@command{$(guix system vm config.scm) -net user}. An important caveat o= f using I tend to use backquotes instead of $(=E2=80=A6) in shell examples, for the= sake of people who do not use Bash or a compatible shell. > +@command{-net user} for networking is that @command{ping} will not work,= because > +it uses the ICMP protocol. You'll have to use a different command to ch= eck for > +network connectivity, I'll leave this as an exercise for the reader. > + > +@subsubsection Connecting through ssh =E2=80=9CConnecting Through SSH=E2=80=9D > +To enable ssh inside a vm you need to add a ssh server like @code{(dropb= ear-service)} > +or @code{(lsh-service)} to your vm. The @code{(lsh-service}) doesn't cur= rently > +boot unsupervised. It requires you to type some characters to initialize= the > +randomness generator. In addition you need to forward the ssh port, 22 by > +default, to the host. You can do this with > +@command{$(guix system vm config.scm) -net user,hostfwd=3Dtcp::10022-:22= }. To connect > +to the vm you can run > +@command{ssh -o UserKnownHostsFile=3D/dev/null -o StrictHostKeyChecking= =3Dno -p 10022}. > +The @command{-p} tells @command{ssh} the port you want to connect to. > +@command{-o UserKnownHostsFile=3D/dev/null} prevents @command{ssh} from = complaining > +every time you modify your @command{config.scm} file and the > +@command{-o StrictHostKeyChecking=3Dno} prevents you from having to allo= w a > +connection to an unknown host every time you connect. s/ssh/SSH/ (when referring to the protocol), and s/vm/VM/, and two-spaces-after-period please. :-) When giving a non-trivial command, it might be worth putting it in @example so that it stands out more clearly: You can do this with: @example `guix system vm config.scm` -net user,hostfwd=3Dtcp::10022-:22 @end example Also, might be worth adding =E2=80=9C(@pxref{Networking Services})=E2=80=9D= at the end of the first sentence above. > +@subsubsection Using virt-viewer with spice =E2=80=9CUsing @command{virt-viewer} with Spice=E2=80=9D > +The default qemu graphical client isn't very nice. As an alternative yo= u can s/qemu/QEMU/ Also maybe replace =E2=80=9Cisn=E2=80=99t very nice=E2=80=9D by =E2=80=9Cis= limited in such and such way=E2=80=9D, or =E2=80=9Clacks the ability to do foo and bar=E2=80=9D. (I= =E2=80=99m actually genuinely interested in knowing what Spice provides compared to the built-in client, having not used it yet. :-)) > +use the @command{remote-viewer} from the @command{virt-viewer} package. = To > +connect pass the @command{-spice port=3D5930,disable-ticketing} flag to > +@command{qemu}. See previous section for further information on how to d= o this. > + > +Spice also allows you to do some nice stuff like share your clipboard wi= th your > +vm. To enable that you'll have to in addition pass the following flags = to > +@command{qemu}: @command{-device virtio-serial-pci,id=3Dvirtio-serial0,m= ax_ports=3D16,bus=3Dpci.0,addr=3D0x5} > +@command{-chardev spicevmc,name=3Dvdagent,id=3Dvdagent} > +@command{-device virtserialport,nr=3D1,bus=3Dvirtio-serial0.0,chardev=3D= vdagent,name=3Dcom.redhat.spice.0}. > +You'll also need to add the @code{(spice-vdagent-service)}. (@pxref{Miscellaneous Services, Spice service}) It=E2=80=99s a great addition, thank you! Ludo=E2=80=99.