qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug 1414466] Re: -net user,hostfwd=... is not working


From: Apteryx
Subject: [Bug 1414466] Re: -net user,hostfwd=... is not working
Date: Sun, 30 May 2021 20:58:22 -0000

Hello, I'm also experiencing such a problem, using qemu-system-x86_64
(hence the retitling of this issue).  More information and output is
available at http://issues.guix.gnu.org/48739, but basically with the
following QEMU command used to run a VM:

/gnu/store/vbjfas8smw260r0qw1d5bbnh5hz08haz-qemu-5.2.0/bin/qemu-system-
x86_64 -kernel /gnu/store/0fylx9z8lzyrbdivqa2jzn574gk8lcjv-linux-
libre-5.12.7/bzImage -initrd /gnu/store
/76ikiyg6arhd40pmq6yyi0vgdszfl08w-system/initrd -append "--
root=/dev/vda1 --system=/gnu/store/76ikiyg6arhd40pmq6yyi0vgdszfl08w-
system --load=/gnu/store/76ikiyg6arhd40pmq6yyi0vgdszfl08w-system/boot
modprobe.blacklist=usbmouse,usbkbd quiet" -enable-kvm -no-reboot -object
rng-random,filename=/dev/urandom,id=guixsd-vm-rng -device virtio-rng-
pci,rng=guixsd-vm-rng -virtfs
local,path="/gnu/store",security_model=none,mount_tag="TAGjoptajej2oynju6yvboauz7pl6uj"
-vga std -drive file=/gnu/store/gj50g71n2b7xa2s9lgcfijprvr4vj66y-qemu-
image,if=virtio,cache=writeback,werror=report,readonly -m 512 -nic
user,hostfwd=tcp::3333-:22

Trying to connect to the VM which has its sshd_config set to:
Port 22
PermitRootLogin yes
PermitEmptyPasswords yes
PasswordAuthentication yes
PubkeyAuthentication yes
X11Forwarding no
AllowAgentForwarding yes
AllowTcpForwarding yes
GatewayPorts no
PidFile /var/run/sshd.pi
ChallengeResponseAuthentication no
UsePAM yes
PrintLastLog yes
LogLevel DEBUG
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 
/etc/ssh/authorized_keys.d/%u
Subsytsem    sftp    internal-sftp

The SSH client would hang with its last debug output being:

debug1: Local version string SSH-2.0-OpenSSH_8.6

Inside the guest, /var/log/secure doesn't show any activity so itd
oesn't seem to be reached.

Ideas?


** Changed in: qemu
       Status: Expired => Confirmed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1414466

Title:
  -net user,hostfwd=... is not working

Status in QEMU:
  Confirmed

Bug description:
  QEMU version: git a46b3aaf6bb038d4f6f192a84df204f10929e75c

   /opt/qemu.git/bin/qemu-system-aarch64 --version
  QEMU emulator version 2.2.50, Copyright (c) 2003-2008 Fabrice Bellard

  Hosts:
  ovs - host machine (Ubuntu 14.04.1, x86_64)
  debian8-arm64 - guest 

  Guest start:
  user@ovs:~$ /opt/qemu.git/bin/qemu-system-aarch64 -machine virt -cpu 
cortex-a57 -nographic -smp 1 -m 512 -kernel vmlinuz-run -initrd initrd-run.img 
-append "root=/dev/sda2 console=ttyAMA0" -global virtio-blk-device.scsi=off 
-device virtio-scsi-device,id=scsi -drive 
file=debian8-arm64.img,id=rootimg,cache=unsafe,if=none -device 
scsi-hd,drive=rootimg -netdev user,id=unet -device 
virtio-net-device,netdev=unet -net user,hostfwd=tcp:127.0.0.1:1122-:22

  root@debian8-arm64:~# netstat -ntplu | grep ssh
  tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN    
  410/sshd        
  tcp6       0      0 :::22                   :::*                    LISTEN    
  410/sshd       

  (no firewall in guest vm)

  user@ovs:~$ netstat -ntplu | grep 1122
  tcp        0      0 127.0.0.1:1122          0.0.0.0:*               LISTEN    
  18722/qemu-system-a

  user@ovs:~$ time ssh user@127.0.0.1 -p 1122
  ssh_exchange_identification: read: Connection reset by peer

  real  1m29.341s
  user  0m0.005s
  sys   0m0.000s

  Inside guest vm sshd works fine:
  root@debian8-arm64:~# ssh user@127.0.0.1 -p 22
  user@127.0.0.1's password: 
  ....
  user@debian8-arm64:~$ exit
  logout
  Connection to 127.0.0.1 closed.

  root@debian8-arm64:~# ssh user@10.0.2.15 -p 22
  user@10.0.2.15's password: 
  ...
  user@debian8-arm64:~$ exit
  logout
  Connection to 10.0.2.15 closed.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1414466/+subscriptions



reply via email to

[Prev in Thread] Current Thread [Next in Thread]