Subject: Re: bug#48053: Starting the hurd-vm service doesn't always succeed

From: Maxim Cournoyer <[email-masked]>
Date: Tue, 27 Apr 2021 01:27:03 -0400

Maxim Cournoyer <[email-masked]> writes:

> Hello!
>
> I'm not sure if that's only on my setup, but starting or restart the
> hurd-vm service seems a bit dodgy here:
>
> $ sudo herd restart hurd-vm
> Service hurd-vm is not running.
> secret service: sending secrets to 11004
> secret service: retrying connection [59 attempts left]
> secret service: connected; waiting for handshake...
> secret service: invalid handshake #<eof>
> Service hurd-vm could not be started.
>
> [...] many tries fail as above
>
> Finally, it worked:
>
> $ sudo herd start hurd-vm
> secret service: sending secrets to 11004
> secret service: retrying connection [59 attempts left]
> secret service: connected; waiting for handshake...
> secret service: sending files from "/etc/childhurd"...
> secret service: done sending files to port 11004
> Service hurd-vm has been started.
>
> Have others experience this?
>
> Maxim

Here's the relevant config in case it matters:

(service hurd-vm-service-type
               (hurd-vm-configuration
                (os (operating-system
                      (inherit %hurd-vm-operating-system)
                      (services
                       (modify-services (operating-system-user-services
                                         %hurd-vm-operating-system)
                         (openssh-service-type
                          config => (openssh-configuration
                                     (inherit config)
                                     (authorized-keys
                                      `(("root" ,(local-file "maxim_nopwd.pub"))))))))))
                (memory-size (* 4 1024))          ;4GiB
                (disk-size (* 20000 (expt 2 20))) ;20GiB
                ;; Extend the default net-options with a port forward
                ;; for the incoming 10.0.1.1 Wireguard IP as well.
                (net-options '("--device" "rtl8139,netdev=net0"
                               "--netdev"
                               (string-append
                                "user,id=net0,"
                                "hostfwd=tcp:127.0.0.1:11004-:1004,"
                                "hostfwd=tcp::10022-:2222,"
                                "hostfwd=tcp:127.0.0.1:15900-:5900")))))

The net-options override is to make QEMU listen for 10022 on all
interfaces, not just the loopback one.  Otherwise I've added my ssh key
and set the memory and disk-size.