From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBD3FC433EF for ; Fri, 29 Oct 2021 14:47:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0FEDF610E5 for ; Fri, 29 Oct 2021 14:47:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0FEDF610E5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bugs.launchpad.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:47090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgTAZ-00030g-TD for qemu-devel@archiver.kernel.org; Fri, 29 Oct 2021 10:47:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgT9D-0001ew-MY for qemu-devel@nongnu.org; Fri, 29 Oct 2021 10:46:23 -0400 Received: from smtp-relay-services-0.canonical.com ([185.125.188.250]:37210) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgT9A-0008Cf-Bs for qemu-devel@nongnu.org; Fri, 29 Oct 2021 10:46:23 -0400 Received: from loganberry.canonical.com (loganberry.canonical.com [91.189.90.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-relay-services-0.canonical.com (Postfix) with ESMTPSA id 3872A3F8D3 for ; Fri, 29 Oct 2021 14:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=launchpad.net; s=20210803; t=1635518771; bh=u4kwKIIRgXMtWhqYQKAtFaTX2zlezQn8UOz8jmUHiSY=; h=MIME-Version:Content-Type:Date:From:To:Reply-To:References: Message-Id:Subject; b=CtYH9LNhdIwBAvdy6XwZ2AOGo98KPUwsnkryQ3Eun54bfYfpq5/1BL+wkRhLjcntE f1NoAPlF5YBWdXU3cxOodYYYFxB6WG+fMs5+zJei/4zCQx97AWHEumL2JPshy6yzDD CxEw1awsJGFUGp3JhkvCzbeJaCnIDdJZuhVbmdUOXO0VkZenk/CnGo/55WD+HIqN4g MrUlh0m0T0DnvijO2AuNU6qCo/KM7cKLd5iSgl+pEhWgkitvoKDdYTk2RhLarc8g0V cD34MeEKlRFKCZImT9revvUq94bYbRoYxLawjd56suVZGmxMlmk3XNCxtPRiLzM5NH l+0B6NjpRloYg== Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 092BB2E81BF for ; Fri, 29 Oct 2021 14:45:38 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Fri, 29 Oct 2021 14:39:39 -0000 From: Thomas T <1414466@bugs.launchpad.net> To: qemu-devel@nongnu.org X-Launchpad-Notification-Type: bug X-Launchpad-Bug: product=qemu; status=Invalid; importance=Undecided; assignee=None; X-Launchpad-Bug-Tags: hostfwd qemu trusty ubuntu xenial X-Launchpad-Bug-Information-Type: Public X-Launchpad-Bug-Private: no X-Launchpad-Bug-Security-Vulnerability: no X-Launchpad-Bug-Commenters: hochl janitor maxco nagaraju-goruganti pconstantine piotr.orzechowski sergey-e srinirap88 th-huth X-Launchpad-Bug-Reporter: Sergey V. Lobanov (sergey-e) X-Launchpad-Bug-Modifier: Thomas T (hochl) References: <20150125172405.12316.8764.malonedeb@soybean.canonical.com> Message-Id: <163551837907.29842.17252732918725567254.malone@wampee.canonical.com> Subject: [Bug 1414466] Re: -net user,hostfwd=... is not working X-Launchpad-Message-Rationale: Subscriber (QEMU) @qemu-devel-ml X-Launchpad-Message-For: qemu-devel-ml Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="0d8de2bfee2024772b3040d4d19f42f47395ac0d"; Instance="production" X-Launchpad-Hash: 6fbd4eae96aacb34d96351315505903923a6a774 Received-SPF: pass client-ip=185.125.188.250; envelope-from=noreply@launchpad.net; helo=smtp-relay-services-0.canonical.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bug 1414466 <1414466@bugs.launchpad.net> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" I have had the same problem, I tried logging into a buildroot image that was started using the following command line: qemu-system-i386 -drive file=3Doutput/images/disk.img,format=3Draw,index=3D0,media=3Ddisk -vga std = -nic user,ipv6=3Doff,model=3De1000,mac=3D10:10:10:10:10:10,hostfwd=3Dtcp::4000-:= 22 The ssh connection was picked up, but nothing happened. The problem was that the network device was not brought up! I added the following to /etc/network/interfaces auto eth0 iface eth0 inet dhcp And voila, I can use ssh username@localhost -p 4000 to log into the machine using ssh. --=20 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=3D... is not working Status in QEMU: Invalid 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=20 Guest start: user@ovs:~$ /opt/qemu.git/bin/qemu-system-aarch64 -machine virt -cpu cort= ex-a57 -nographic -smp 1 -m 512 -kernel vmlinuz-run -initrd initrd-run.img = -append "root=3D/dev/sda2 console=3DttyAMA0" -global virtio-blk-device.scsi= =3Doff -device virtio-scsi-device,id=3Dscsi -drive file=3Ddebian8-arm64.img= ,id=3Drootimg,cache=3Dunsafe,if=3Dnone -device scsi-hd,drive=3Drootimg -net= dev user,id=3Dunet -device virtio-net-device,netdev=3Dunet -net user,hostfw= d=3Dtcp: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:* LISTE= N 410/sshd =20 tcp6 0 0 :::22 :::* LISTE= N 410/sshd =20 (no firewall in guest vm) user@ovs:~$ netstat -ntplu | grep 1122 tcp 0 0 127.0.0.1:1122 0.0.0.0:* LISTE= N 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:=20 .... 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:=20 ... 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