From 81b3aade07dae5cb5c6d727a087effb6b76e0517 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 6 Mar 2020 12:22:46 +0100 Subject: [PATCH] pmb.qemu: drop telnet port forwarding (!1886) Now that we try to use the IP assigned by QEMU via DHCP, the debug-shell is no longer working via telnet. This is because the VM does not have any IP assigned when it is running. We would need to start a DHCP client from the initfs to make it work. busybox provides both udhcpc (client) and udhcpd (server) so this is not a big problem. But the question is: Is it worth it? The debug-shell will be only used for debugging, and NetworkManager handles starting a proper DHCP client once the rootfs is mounted. Meanwhile the debug-shell can be also accessed via serial output/input, (available in the pmbootstrap stdout/stdin). So overall it does not seem worth the effort. Let's just recommend using serial instead. --- pmb/qemu/run.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pmb/qemu/run.py b/pmb/qemu/run.py index 7061ca05..aa9e6fb1 100644 --- a/pmb/qemu/run.py +++ b/pmb/qemu/run.py @@ -76,7 +76,6 @@ def command_qemu(args, arch, img_path): logging.debug("Kernel cmdline: " + cmdline) port_ssh = str(args.port) - port_telnet = str(args.port + 1) suffix = "rootfs_" + args.device rootfs = args.work + "/chroot_" + suffix @@ -119,7 +118,6 @@ def command_qemu(args, arch, img_path): command += ["-netdev", "user,id=net0," "hostfwd=tcp::" + port_ssh + "-:22," - "hostfwd=tcp::" + port_telnet + "-:23" ] command += ["-show-cursor"] @@ -246,11 +244,10 @@ def run(args): logging.info("NOTE: Run 'pmbootstrap qemu --image-size 2G' to set" " the rootfs size when you run out of space!") - # SSH/telnet hints - logging.info("Connect to the VM (telnet requires 'pmbootstrap initfs" - " hook_add debug-shell'):") + # SSH/serial hints + logging.info("Connect to the VM:") logging.info("* (ssh) ssh -p {port} {user}@localhost".format(**vars(args))) - logging.info("* (telnet) telnet localhost " + str(args.port + 1)) + logging.info("* (serial) in this console (stdout/stdin)") # Run QEMU and kill it together with pmbootstrap process = None