From a3aac909ddaa2b10bac0f7cbf931d678efe902f1 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Thu, 13 Aug 2026 03:04:02 -0400 Subject: [PATCH] [ADD] qemu desktop: say how to REACH the remote desktop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The VM announced "Remote desktop: RDP 3389" without saying how to get there. Its address is on libvirt's private network, which is not routed from outside its host: the port alone helps nobody. It now prints the tunnel to set up, address already filled in -- "ssh -L 3390::3389 @", then an RDP client on localhost:3390. Likewise in VNC for Arch, on 5902. This is the only workable route when the libvirt host is itself a VM with no graphical interface: the SPICE console is on "listen=none" and assumes virt-viewer ON that host. --- FR --- La VM annonçait « Bureau distant : RDP 3389 » sans dire par où passer. Son adresse est sur le réseau privé de libvirt, qui n'est pas routé depuis l'extérieur de son hôte : le port seul n'aide personne. Elle imprime maintenant le tunnel à monter, adresse déjà remplie — « ssh -L 3390::3389 @ », puis un client RDP sur localhost:3390. Idem en VNC pour Arch, sur 5902. C'est le seul chemin praticable quand l'hôte libvirt est lui-même une VM sans interface graphique : la console SPICE est en « listen=none » et suppose virt-viewer SUR cet hôte. Assisted-by: Claude Opus 5 --- script/todo/todo.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/script/todo/todo.py b/script/todo/todo.py index 949ab41..50f0202 100755 --- a/script/todo/todo.py +++ b/script/todo/todo.py @@ -4664,6 +4664,22 @@ class TODO: f'echo " {t("openSUSE mirror:")} $zm"; break; fi; done; ' ) + @staticmethod + def _qemu_tunnel_hint(port, kind): + """Deux lignes imprimees DANS la VM : le tunnel a monter depuis le + poste de travail, avec l'adresse deja remplie. + + Un port annonce sans chemin pour y arriver n'aide personne : le reseau + libvirt n'est pas route depuis l'exterieur de son hote.""" + local = port + 1 + return ( + "ip=$(hostname -I 2>/dev/null | awk '{print $1}'); " + f'echo " {t("From your workstation:")} ' + f'ssh -L {local}:$ip:{port} @"; ' + f'echo " {t("then point your client at")} ' + f'localhost:{local} ({kind})"; ' + ) + def _qemu_desktop_remote_cmd(self, flavour="gnome", app_store="deb"): """Bloc shell installant le bureau choisi + son accès distant, quelle que soit la distribution. Même aiguillage que l'installation ERPLibre, @@ -4716,9 +4732,18 @@ class TODO: "if command -v xrdp >/dev/null 2>&1; then " "sudo systemctl enable --now xrdp >/dev/null 2>&1 || true; " f'echo " {t("Remote desktop:")} RDP 3389"; ' - "elif command -v vncserver >/dev/null 2>&1; then " + # L'IP est sur le reseau PRIVE de libvirt : annoncer le port sans + # dire comment l'atteindre ne sert a rien. La VM connait sa propre + # adresse ; seul le nom de l'hote libvirt manque, et c'est le + # lecteur qui l'a. La console SPICE, elle, est en « listen=none » + # et suppose virt-viewer SUR l'hote — inutilisable quand cet hote + # est lui-meme une VM sans interface graphique. + + self._qemu_tunnel_hint(3389, "RDP") + + "elif command -v vncserver >/dev/null 2>&1; then " f'echo " {t("Remote desktop:")} VNC 5901 ' - '(vncpasswd puis vncserver :1)"; fi; ' + '(vncpasswd puis vncserver :1)"; ' + + self._qemu_tunnel_hint(5901, "VNC") + + "fi; " ) # mise ne publie de binaire que pour ces architectures : 46 assets à la