unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Eric Brown <ecbrown@ericcbrown.com>
Cc: 48739-done@debbugs.gnu.org
Subject: bug#48739: QEMU SSH hostfwd example from manual doesn't work anymore
Date: Sun, 30 May 2021 23:39:49 -0400	[thread overview]
Message-ID: <87v96zh8qi.fsf@gmail.com> (raw)
In-Reply-To: <86bl8r7v8z.fsf@hurd.ericcbrown.com> (Eric Brown's message of "Sun, 30 May 2021 22:43:40 +0100")

Hello Eric,

[...]

> Hello Maxim,
>
> Just today I ssh'd into childhurd with -p 10022 like the manual
> suggests.
>
> Also, I ssh'd into Debian GNU/Hurd in qemu with 5555 like the Hurd documentation
> suggests. I ended up using (also to get Spice):
>
> qemu-system-x86_64 -m 3072 -smp 1 -enable-kvm -nic \
> user,model=rtl8139,hostfwd=tcp::5555-:22 -net user -boot menu=on,order=d \
> -drive cache=writeback,file=hurd.img -device \
> virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x5 \
> -chardev spicevmc,name=vdagent,id=vdagent -device \
> virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0
>
> You may have a different issue, just want to give some feedback.
>
> Best regards,
> Eric

Thanks a lot for sharing this; I tried your above snippet with the
Debian Hurd img file, and it worked!  Out of curiosity, how do you use
Spice with the above?  It'd need a Spice-enabled viewer such as
virt-manager right?  How do you point virt-manager to the VM instance
spawned with QEMU?

So it's not a QEMU bug.  I'm also
running a childhurd VM and it indeed works there.  The command the
childhurd service uses is:

--8<---------------cut here---------------start------------->8---
qemu-system-i386 -m 512 --device rtl8139,netdev=net0 --netdev user,id=net0,hostfwd=tcp:127.0.0.1:11004-:1004,hostfwd=tcp:127.0.0.1:10022-:2222,hostfwd=tcp:127.0.0.1:15900-:5900 --snapshot --hda /gnu/store/84881fwqhwl37n7gbh8lhg3i01sxrp2p-disk-image --no-reboot --enable-kvm
--8<---------------cut here---------------end--------------->8---

Stealing its --device and --netdev options applied to my case:

--8<---------------cut here---------------start------------->8---
/gnu/store/kkwyzm7b6mg42sm5cljlqrca9f5hqmyn-run-vm.sh --device rtl8139,netdev=net0 --netdev user,id=net0,hostfwd=tcp:127.0.0.1:3333-:22
--8<---------------cut here---------------end--------------->8---

And try to connect to SSH, I can see messages like:

--8<---------------cut here---------------start------------->8---
qemu-system-x86_64: Slirp: Failed to send packet, ret: -1
--8<---------------cut here---------------end--------------->8---

So at this point I'm guessing my minimal OS declaration is too minimal
and missing a networking component.  It's this:

--8<---------------cut here---------------start------------->8---
(use-modules (gnu services ssh)
             (gnu system)
             (gnu tests))

(simple-operating-system
   (service openssh-service-type
            (openssh-configuration
             (permit-root-login #t)
             (allow-empty-passwords? #t)
             (log-level 'debug))))
--8<---------------cut here---------------end--------------->8---


Adding the DHCP client service like so:

--8<---------------cut here---------------start------------->8---
(use-modules (gnu services networking)
             (gnu services ssh)
             (gnu system)
             (gnu tests))

(simple-operating-system
 (service dhcp-client-service-type)
 (service openssh-service-type
          (openssh-configuration
           (permit-root-login #t)
           (allow-empty-passwords? #t)
           (log-level 'debug))))
--8<---------------cut here---------------end--------------->8---

I've added a note to document this and spare others the trouble of going
down this hole with commit b9ac7d9aaaa5849cc3c2acd4b1b41acdd545e66b.

Thanks a lot for helping me see the solution!

Closing.

Maxim




  reply	other threads:[~2021-05-31  3:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-30  6:36 bug#48739: QEMU SSH hostfwd example from manual doesn't work anymore Maxim Cournoyer
2021-05-30 21:43 ` Eric Brown
2021-05-31  3:39   ` Maxim Cournoyer [this message]
2021-06-07  2:06     ` Eric Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v96zh8qi.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=48739-done@debbugs.gnu.org \
    --cc=ecbrown@ericcbrown.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).