guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 1c262bf03b11cee757bbf597d265ad03996c53bf
Author: Fonzie Huang <[email protected]>
AuthorDate: Tue Jul 14 21:33:03 2026 +0800

    doc: Add a more complete Qemu example for new comers.
    
    * doc/guix.texi (Running Guix in a VM): Update Qemu command example.
    
    Signed-off-by: Gabriel Wicki <[email protected]>
---
 doc/guix.texi | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 15f6adfdb0..11138951c6 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -51251,6 +51251,37 @@ name=com.redhat.spice.0
 You'll also need to add the @code{(spice-vdagent-service)} to your
 system definition (@pxref{Miscellaneous Services, Spice service}).
 
+Here is a working example with QEMU @samp{10.0.8}:
+
+@example
+qemu-system-x86_64 -nic user,model=virtio-net-pci -enable-kvm -m 2048 \
+  -device virtio-blk,drive=myhd \
+  -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x5 \
+  -device 
virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0
 \
+  -chardev spicevmc,name=vdagent,id=vdagent \
+  -spice addr=::1,port=5930,disable-ticketing=on \
+  -drive 
if=none,file=guix-system-vm-image-@value{VERSION}.x86_64-linux.qcow2,id=myhd
+@end example
+
+@quotation Note
+Without the @samp{addr=::1} of the @samp{-spice} option, it will listen
+on any IPv4 address (that is @samp{0.0.0.0}) on your host. And one might
+be able to connect to the guix VM from other host on your network.
+@end quotation
+
+@quotation Note
+QEMU will modify the .qcow2 image file while running. Back up the image
+file beforehand if you want to keep it untouched.
+@end quotation
+
+After running the above command, the terminal will stay in a blocking
+state, and to connect to the virtual machine, you can run the following
+command on a different terminal:
+
+@example
+remote-viewer spice://[::1]:5930
+@end example
+
 @node Defining Services
 @section Defining Services
 

Reply via email to