summary refs log tree commit diff
path: root/doc/guix.texi
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.si>2021-11-02 20:06:32 +0100
committerLudovic Courtès <ludo@gnu.org>2021-11-12 23:41:44 +0100
commitf634a0baab85454a6feac25e29905f564b276c9e (patch)
tree8de5efefdf9de51504fe2217533f7cb9e3910927 /doc/guix.texi
parent0c21ec1c7915bdc08c68c66eba411cf533d4e503 (diff)
downloadguix-f634a0baab85454a6feac25e29905f564b276c9e.tar.gz
services: Add qemu-guest-agent service.
* gnu/services/virtualization.scm (<qemu-guest-agent-configuration>): New
record.
(qemu-guest-agent-shepherd-service): New procedure.
(qemu-guest-agent-service-type): New variable.
* doc/guix.texi (Virtualization Services): Document it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc/guix.texi')
-rw-r--r--doc/guix.texi47
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 29a6665540..7e54b5f75e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -30060,6 +30060,53 @@ Return the name of @var{platform}---a string such as @code{"arm"}.
 @end deffn
 
 
+@subsubheading QEMU Guest Agent
+
+@cindex emulation
+
+The QEMU guest agent provides control over the emulated system to the
+host.  The @code{qemu-guest-agent} service runs the agent on Guix
+guests.  To control the agent from the host, open a socket by invoking
+QEMU with the following arguments:
+
+@example
+qemu-system-x86_64 \
+	-chardev socket,path=/tmp/qga.sock,server=on,wait=off,id=qga0 \
+	-device virtio-serial \
+	-device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \
+	...
+@end example
+
+This creates a socket at @file{/tmp/qga.sock} on the host.  Once the
+guest agent is running, you can issue commands with @code{socat}:
+
+@example
+$ guix shell socat -- socat unix-connect:/tmp/qga.sock stdio
+@{"execute": "guest-get-host-name"@}
+@{"return": @{"host-name": "guix"@}@}
+@end example
+
+See @url{https://wiki.qemu.org/Features/GuestAgent,QEMU guest agent
+documentation} for more options and commands.
+
+@defvr {Scheme Variable} qemu-guest-agent-service-type
+Service type for the QEMU guest agent service.
+@end defvr
+
+@deftp {Data Type} qemu-guest-agent-configuration
+Configuration for the @code{qemu-guest-agent} service.
+
+@table @asis
+@item @code{qemu} (default: @code{qemu-minimal})
+The QEMU package to use.
+
+@item @code{device} (default: @code{""})
+File name of the device or socket the agent uses to communicate with the
+host.  If empty, QEMU uses a default file name.
+@end table
+@end deftp
+
+
 @subsubheading The Hurd in a Virtual Machine
 
 @cindex @code{hurd}