unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] doc: Add information related to network connectivity with qemu.
@ 2016-09-28 16:49 David Craven
  2016-09-29 10:24 ` Ludovic Courtès
  2016-09-29 10:43 ` ng0
  0 siblings, 2 replies; 6+ messages in thread
From: David Craven @ 2016-09-28 16:49 UTC (permalink / raw)
  To: guix-devel

* doc/guix.text: Add it.
---
 doc/guix.texi | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 785d6fb..5173ca7 100644
--- 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
 
+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 default.
+To get network access from within the vm add the @code{(dhcp-client-service)}
+to your system definition and start the vm using
+@command{$(guix system vm config.scm) -net user}.  An important caveat of using
+@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 check for
+network connectivity, I'll leave this as an exercise for the reader.
+
+@subsubsection Connecting through ssh
+
+To enable ssh inside a vm you need to add a ssh server like @code{(dropbear-service)}
+or @code{(lsh-service)} to your vm. The @code{(lsh-service}) doesn't currently
+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=tcp::10022-:22}. To connect
+to the vm you can run
+@command{ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 10022}.
+The @command{-p} tells @command{ssh} the port you want to connect to.
+@command{-o UserKnownHostsFile=/dev/null} prevents @command{ssh} from complaining
+every time you modify your @command{config.scm} file and the
+@command{-o StrictHostKeyChecking=no} prevents you from having to allow a
+connection to an unknown host every time you connect.
+
+@subsubsection Using virt-viewer with spice
+
+The default qemu graphical client isn't very nice.  As an alternative you can
+use the @command{remote-viewer} from the @command{virt-viewer} package. To
+connect pass the @command{-spice port=5930,disable-ticketing} flag to
+@command{qemu}. See previous section for further information on how to do this.
+
+Spice also allows you to do some nice stuff like share your clipboard with your
+vm.  To enable that you'll have to in addition pass the following flags to
+@command{qemu}: @command{-device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x5}
+@command{-chardev spicevmc,name=vdagent,id=vdagent}
+@command{-device virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0}.
+You'll also need to add the @code{(spice-vdagent-service)}.
+
 @node Defining Services
 @subsection Defining Services
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] doc: Add information related to network connectivity with qemu.
  2016-09-28 16:49 [PATCH] doc: Add information related to network connectivity with qemu David Craven
@ 2016-09-29 10:24 ` Ludovic Courtès
  2016-09-29 10:43 ` ng0
  1 sibling, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2016-09-29 10:24 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

Hello!

David Craven <david@craven.ch> 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
>  
> +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 default.
> +To get network access from within the vm add the @code{(dhcp-client-service)}
> +to your system definition and start the vm using

s/vm/VM/

> +@command{$(guix system vm config.scm) -net user}.  An important caveat of using

I tend to use backquotes instead of $(…) 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 check for
> +network connectivity, I'll leave this as an exercise for the reader.
> +
> +@subsubsection Connecting through ssh

“Connecting Through SSH”

> +To enable ssh inside a vm you need to add a ssh server like @code{(dropbear-service)}
> +or @code{(lsh-service)} to your vm. The @code{(lsh-service}) doesn't currently
> +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=tcp::10022-:22}. To connect
> +to the vm you can run
> +@command{ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 10022}.
> +The @command{-p} tells @command{ssh} the port you want to connect to.
> +@command{-o UserKnownHostsFile=/dev/null} prevents @command{ssh} from complaining
> +every time you modify your @command{config.scm} file and the
> +@command{-o StrictHostKeyChecking=no} prevents you from having to allow 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=tcp::10022-:22
  @end example

Also, might be worth adding “(@pxref{Networking Services})” at the end
of the first sentence above.

> +@subsubsection Using virt-viewer with spice

“Using @command{virt-viewer} with Spice”

> +The default qemu graphical client isn't very nice.  As an alternative you can

s/qemu/QEMU/

Also maybe replace “isn’t very nice” by “is limited in such and such
way”, or “lacks the ability to do foo and bar”.  (I’m 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=5930,disable-ticketing} flag to
> +@command{qemu}. See previous section for further information on how to do this.
> +
> +Spice also allows you to do some nice stuff like share your clipboard with your
> +vm.  To enable that you'll have to in addition pass the following flags to
> +@command{qemu}: @command{-device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x5}
> +@command{-chardev spicevmc,name=vdagent,id=vdagent}
> +@command{-device virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0}.
> +You'll also need to add the @code{(spice-vdagent-service)}.

(@pxref{Miscellaneous Services, Spice service})

It’s a great addition, thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] doc: Add information related to network connectivity with qemu.
  2016-09-28 16:49 [PATCH] doc: Add information related to network connectivity with qemu David Craven
  2016-09-29 10:24 ` Ludovic Courtès
@ 2016-09-29 10:43 ` ng0
  2016-09-29 10:49   ` David Craven
  1 sibling, 1 reply; 6+ messages in thread
From: ng0 @ 2016-09-29 10:43 UTC (permalink / raw)
  To: David Craven, guix-devel

Hi,

thanks for the patch. Though it does not solve my problem it adds
documentation.

David Craven <david@craven.ch> writes:

> * doc/guix.text: Add it.
> ---
>  doc/guix.texi | 39 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 785d6fb..5173ca7 100644
> --- 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
>  
> +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 default.
> +To get network access from within the vm add the @code{(dhcp-client-service)}
> +to your system definition and start the vm using
> +@command{$(guix system vm config.scm) -net user}.  An important caveat of using
> +@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 check for
> +network connectivity, I'll leave this as an exercise for the reader.

I find this bad for documentation.. "I'll leave this as an exercise for
the reader" leaves the reader with question, when they might've started
to read this documentation section because they had a specific question
about this. Maybe point to other documentations, links, etc?

> +@subsubsection Connecting through ssh
> +
> +To enable ssh inside a vm you need to add a ssh server like @code{(dropbear-service)}
> +or @code{(lsh-service)} to your vm. The @code{(lsh-service}) doesn't currently
> +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=tcp::10022-:22}. To connect
> +to the vm you can run
> +@command{ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 10022}.
> +The @command{-p} tells @command{ssh} the port you want to connect to.
> +@command{-o UserKnownHostsFile=/dev/null} prevents @command{ssh} from complaining
> +every time you modify your @command{config.scm} file and the
> +@command{-o StrictHostKeyChecking=no} prevents you from having to allow a
> +connection to an unknown host every time you connect.
> +
> +@subsubsection Using virt-viewer with spice
> +
> +The default qemu graphical client isn't very nice.  As an alternative you can
> +use the @command{remote-viewer} from the @command{virt-viewer} package. To
> +connect pass the @command{-spice port=5930,disable-ticketing} flag to
> +@command{qemu}. See previous section for further information on how to do this.
> +
> +Spice also allows you to do some nice stuff like share your clipboard with your
> +vm.  To enable that you'll have to in addition pass the following flags to
> +@command{qemu}: @command{-device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x5}
> +@command{-chardev spicevmc,name=vdagent,id=vdagent}
> +@command{-device virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0}.
> +You'll also need to add the @code{(spice-vdagent-service)}.
> +
>  @node Defining Services
>  @subsection Defining Services
>  
> -- 
> 2.9.0
>
>

-- 
              ng0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] doc: Add information related to network connectivity with qemu.
  2016-09-29 10:43 ` ng0
@ 2016-09-29 10:49   ` David Craven
  2016-09-29 10:54     ` ng0
  0 siblings, 1 reply; 6+ messages in thread
From: David Craven @ 2016-09-29 10:49 UTC (permalink / raw)
  To: ng0; +Cc: guix-devel

I could add a few examples, but it depends what's available.

wget https://google.com or curl https://google.com would be two obvious ones

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] doc: Add information related to network connectivity with qemu.
  2016-09-29 10:49   ` David Craven
@ 2016-09-29 10:54     ` ng0
  2016-09-29 11:09       ` David Craven
  0 siblings, 1 reply; 6+ messages in thread
From: ng0 @ 2016-09-29 10:54 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven <david@craven.ch> writes:

> I could add a few examples, but it depends what's available.
>
> wget https://google.com or curl https://google.com would be two obvious ones
>

or/and: guix download http://gnu.org/index.html
-- 
              ng0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] doc: Add information related to network connectivity with qemu.
  2016-09-29 10:54     ` ng0
@ 2016-09-29 11:09       ` David Craven
  0 siblings, 0 replies; 6+ messages in thread
From: David Craven @ 2016-09-29 11:09 UTC (permalink / raw)
  To: ng0; +Cc: guix-devel

> Though it does not solve my problem

Can you please explain your problem again?

So in a different thread you said you can't connect to the internet
from within your vm.

Did you receive an ip address from the dhcp-client-service? Does the
ip address look like the one on the host? Same subnet mask etc.?

wget https://google.com doesn't work then I gather? What's the error
message? Is it related to certificates or dns? Does wget
http://your-router-ip work?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-29 11:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-28 16:49 [PATCH] doc: Add information related to network connectivity with qemu David Craven
2016-09-29 10:24 ` Ludovic Courtès
2016-09-29 10:43 ` ng0
2016-09-29 10:49   ` David Craven
2016-09-29 10:54     ` ng0
2016-09-29 11:09       ` David Craven

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).