From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH] start_vm: support SSH access to the machine in qemu
Date: Sun, 20 Nov 2022 16:33:00 +0100 [thread overview]
Message-ID: <20221120153300.23029-1-ubely@ilbers.de> (raw)
Map host port 22222 to guest port 22.
Use command `ssh -l <user> -p 22222 localhost` to connect.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
Sometimes it's useful to have several terminals to check things under
machine that is run under qemu. SSH access is the good way to do it.
testsuite/start_vm.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/testsuite/start_vm.py b/testsuite/start_vm.py
index f761a8bd..dbe70815 100755
--- a/testsuite/start_vm.py
+++ b/testsuite/start_vm.py
@@ -70,6 +70,10 @@ def format_qemu_cmdline(arch, build, distro, out, pid, enforce_pcbios=False):
bios_idx = qemu_disk_args.index('-bios')
del qemu_disk_args[bios_idx : bios_idx+2]
+ # Support SSH access from host via port 22222
+ extra_args.extend(['-device', 'e1000,netdev=net0'])
+ extra_args.extend(['-netdev', 'user,id=net0,hostfwd=tcp::22222-:22'])
+
cmd = ['qemu-system-' + qemu_arch, '-m', '1024M']
if qemu_machine:
--
2.20.1
next reply other threads:[~2022-11-20 15:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-20 15:33 Uladzimir Bely [this message]
2022-11-29 13:23 ` Anton Mikanovich
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221120153300.23029-1-ubely@ilbers.de \
--to=ubely@ilbers.de \
--cc=isar-users@googlegroups.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox