From nobody Fri Nov 22 20:49:37 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xw6gD5Nlmz5dMXr; Fri, 22 Nov 2024 20:50:16 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xw6gC6Zt0z4X6N; Fri, 22 Nov 2024 20:50:15 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=U9CEgz25; spf=pass (mx1.freebsd.org: domain of marietto2008@gmail.com designates 2607:f8b0:4864:20::62a as permitted sender) smtp.mailfrom=marietto2008@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-21285c1b196so25984725ad.3; Fri, 22 Nov 2024 12:50:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732308614; x=1732913414; darn=freebsd.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Y0Rz76Loymxk49BDVLfA7QTEhqZes1A2e/7+EsTJbI0=; b=U9CEgz256sQ3f6mq4cycgOfezGixSN6qmwe3MPDyzJCPo5oAUGVhrmyrEziczyaBrT 47zSHULU9mIEZ563q3pvHASzN29XAhT0PgHR89MPdj17aeCMgVrf/WUZ1qyqRE//2ZE2 fvxujykuhuYu0UmX1nVFd8/I6v6FUpSpeZLAq6fzYV1UlVeadp5cWaK8KnL735QEN21W sS3GXAXl4bEU6sONQ0DbyNcLuJExcWG8Ej85tgtcaNrnlv7SBDxO3c46PAVYYHadOhbB tZcLnJNvEjtSzJmy35vt09+nr9gVJzfBMR+rUESY8xnZ7h8aTgBpnZkLH5PaDI+DYm8R lVMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732308614; x=1732913414; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Y0Rz76Loymxk49BDVLfA7QTEhqZes1A2e/7+EsTJbI0=; b=fzcO4PYsB/jBSSwgu51y7MJMs9ExaslLQJfln7sbGueQlUG8kOxjBEuxhtPI8wIFd1 /tpxiy9owDyYRiRbuRwQfa1SKFUOwP/L+uVByPyf2Hdt1uObocYGFblX45WhmzoZkmwB dtI+X9nJ1iV+7bVqWGRh7//QGseworF0M2eI2iG7hJVSDtSFuth52BQZFNdJWtYx6vBv B4erXmeRorufEB+HoJnXFoUiCqU6KloaU4gLNw0gKyM21Piy18iCt1zwrNUn8VKDwqzv YoZFqjdx3SVMhVQY9dO0AepFr11lrP6zvTTYxbcy2USXBp26LYENHq4g34p4xiSZf4XG /j+g== X-Forwarded-Encrypted: i=1; AJvYcCW2qR3cuWEv3/fyZLgxDJtt0OFyrM33mfTeUUcTMLYww396TMkg30FvM3SqOqmWbiIwhiBAvkX8Fk7iRhCH6minmB31qP4XrA==@freebsd.org, AJvYcCX1PUF856Kh9mWBZmz7y9Z92ttbRH3EuYwWYSz35MOCAwEkbg9TxqyNAdVzRTvmRqsmboHtw0b/ToeFq+4yIIg=@freebsd.org X-Gm-Message-State: AOJu0YxRqR+MXvPSJfM0ekxcSb+zppyaElNPnW9Ak0iWMAbsm5T3YgI5 dre0rgdm/C7vlHZBthUlWt8wpMl8BKvXFVksCpr3GUoZNhmGUM0+IBJtbXkwTUUFUMQXPvnTzFN FJoYFwbIt+BWOOOwhMDv/wmXyVOSnqc7WET4= X-Gm-Gg: ASbGncuNbZ8MPZGgIi5o9zPzfv+iUQajVDopBzSkyVcrc3JpZwfroMFQXVQsA4HnoiG 8QyUdLXj3QC+dzlRK38Y/ouROshQRbBs= X-Google-Smtp-Source: AGHT+IGvbQuE1vVYCBY4nRjdLVyapQNV3kl2ige2GZooe2potgLBnletS8GDJehWJlqIerHbIjWoiD//HcVRFyBkjXM= X-Received: by 2002:a17:902:ea10:b0:20c:d469:ba95 with SMTP id d9443c01a7336-2129f67ae5dmr46596255ad.16.1732308613854; Fri, 22 Nov 2024 12:50:13 -0800 (PST) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 From: Mario Marietto Date: Fri, 22 Nov 2024 21:49:37 +0100 Message-ID: Subject: ADB server does not ACK if it is launched inside Linux chrooted / jailed / emulated with the Linuxulator To: FreeBSD Mailing List , freebsd-hackers , FreeBSD virtualization Content-Type: multipart/alternative; boundary="00000000000091fd6a0627868760" X-Spamd-Result: default: False [-2.85 / 15.00]; HTTP_TO_IP(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.85)[-0.849]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org,freebsd-hackers@freebsd.org,freebsd-virtualization@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::62a:from]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4Xw6gC6Zt0z4X6N X-Spamd-Bar: -- --00000000000091fd6a0627868760 Content-Type: text/plain; charset="UTF-8" Hello. I'm trying to connect to my mobile phone using adb over wifi using the Linuxulator because I want to install a specific java application that requires Linux to work. I have already used Linux virtualized with bhyve and it worked. But I prefer to save some memory by trying to use the Linuxulator instead of starting a vm,if possible. I've already tried to run the app using java installed natively on FreeBSD,but it fails because it wasn't designed for this. So : [root@noble /]==> adb connect 192.168.1.2:5555 * daemon not running. starting it now on port 5037 * cannot bind 'tcp:5037' ADB server didn't ACK * failed to start daemon * error: cannot connect to daemon that's the error that I get. I'm not sure if I can use some trick or if there is anything that I can do because the Linuxulator does not support that in any way. Instead,if I launch it directly in FreeBSD,it works : [root@marietto /home/marietto]==> adb connect 192.168.1.2:5555 * daemon not running; starting now at tcp:5037 * daemon started successfully connected to 192.168.1.2:5555 The problem is that the java app does not recognizes that the adb server is working : [root@noble /home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0]==> java -jar DeskDockServer_1.3.0.jar Program: DeskDockServer 1.3.0 System: Linux 5.15.0, amd64 JRE: 21.0.5+11-Ubuntu-1ubuntu124.04 AdbLocator: Found ADB in env PATH class com.floriandraschbacher.deskdockserver.Main: Using ADB from /usr/bin/adb ab@3f95b479: Error getting devices: ADB server didn't ACK q$b@31524dfb: Error getting ADB devices: java.io.IOException: java.io.IOException: ADB server didn't ACK but it is working : [root@noble /home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0]==> ps ax PID TTY STAT TIME COMMAND 6089 pts/0 R+ 0:00 ps ax 5979 pts/0 S 0:00 adb -P 5037 fork-server server 5952 pts/0 S 0:00 /bin/zsh According with this thread : https://forums.freebsd.org/threads/make-jail-available-to-bind-only-certain-ports.85609/ I want to create a Jail with a public IP address. But as we have an IPv4 address shortage. I want to only make the jail able to bind to a range of ports (say 700 to 750). I asked in the IRC and one answer was to use pf to NAT ports from/to the jail. this is what I tried to do : nano /etc/pf.conf nat on $ext_if from 127.0.0.0/24 to any -> 192.168.1.2 rdr on $ext_if proto tcp from any to any port 5037:5555 -> 127.0.0.255 root@noble:/home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0# ./adb connect * daemon not running. starting it now on port 5037 * * daemon started successfully * ** daemon still not running error: cannot connect to daemon root@noble:/home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0# ps ax PID TTY STAT TIME COMMAND 8759 pts/2 R+ 0:00 ps ax 8758 pts/2 S 0:00 adb -P 5037 fork-server server 8739 pts/2 S 0:00 /bin/bash but it didn't work : root@noble:/home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0# java -jar DeskDockServer_1.3.0.jar 2024-11-22 17:33:02.348 Program: DeskDockServer 1.3.0 2024-11-22 17:33:02.348 System: Linux 5.15.0, amd64 2024-11-22 17:33:02.348 JRE: 21.0.5+11-Ubuntu-1ubuntu124.04 2024-11-22 17:33:02.469 AdbLocator: Found ADB in env PATH 2024-11-22 17:33:02.469 class com.floriandraschbacher.deskdockserver.Main: Using ADB from /usr/bin/adb 2024-11-22 17:33:02.508 ab@c703a44: Error getting devices: ADB server didn't ACK 2024-11-22 17:33:02.508 q$b@2b7d5ba: Error getting ADB devices: java.io.IOException: java.io.IOException: ADB server didn't ACK127.0.0.255192.168.1.2:5555 -- Mario. --00000000000091fd6a0627868760 Content-Type: text/html; charset="UTF-8"

Hello.

I'm trying to connect to my mobile phone using adb over wifi using the Linuxulator because I want to install a specific java application that requires Linux to work. I have already used Linux virtualized with bhyve and it worked. But I prefer to save some memory by trying to use the Linuxulator instead of starting a vm,if possible. I've already tried to run the app using java installed natively on FreeBSD,but it fails because it wasn't designed for this. So :

[root@noble /]==> adb connect 192.168.1.2:5555

* daemon not running. starting it now on port 5037 *
cannot bind 'tcp:5037'
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon

that's the error that I get. I'm not sure if I can use some trick or if there is anything that I can do because the Linuxulator does not support that in any way. Instead,if I launch it directly in FreeBSD,it works :

[root@marietto /home/marietto]==> adb connect 192.168.1.2:5555

* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to 192.168.1.2:5555

The problem is that the java app does not recognizes that the adb server is working :

[root@noble /home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0]==> java -jar DeskDockServer_1.3.0.jar

Program: DeskDockServer 1.3.0
System: Linux 5.15.0, amd64
JRE: 21.0.5+11-Ubuntu-1ubuntu124.04
AdbLocator: Found ADB in env PATH
class com.floriandraschbacher.deskdockserver.Main: 
Using ADB from /usr/bin/adb
ab@3f95b479: Error getting devices: 
ADB server didn't ACK
q$b@31524dfb: Error getting ADB devices: 
java.io.IOException: java.io.IOException: 
ADB server didn't ACK

but it is working :

[root@noble /home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0]==> ps ax
      
  PID TTY      STAT   TIME COMMAND
 6089 pts/0    R+     0:00 ps ax
 5979 pts/0    S      0:00 adb -P 5037 fork-server server
 5952 pts/0    S      0:00 /bin/zsh

According with this thread :

https://forums.freebsd.org/threads/make-jail-available-to-bind-only-certain-ports.85609/

I want to create a Jail with a public IP address. But as we have an IPv4 address shortage. I want to only make the jail able to bind to a range of ports (say 700 to 750). I asked in the IRC and one answer was to use pf to NAT ports from/to the jail.

this is what I tried to do :

nano /etc/pf.conf

nat on $ext_if from 127.0.0.0/24 to any -> 192.168.1.2
rdr on $ext_if proto tcp from any to any port 5037:5555 -> 127.0.0.255

root@noble:/home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0# ./adb connect 

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
** daemon still not running
error: cannot connect to daemon

root@noble:/home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0# ps ax

  PID TTY      STAT   TIME COMMAND
 8759 pts/2    R+     0:00 ps ax
 8758 pts/2    S      0:00 adb -P 5037 fork-server server
 8739 pts/2    S      0:00 /bin/bash

but it didn't work :

root@noble:/home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0# java -jar DeskDockServer_1.3.0.jar 

2024-11-22 17:33:02.348   Program: DeskDockServer 1.3.0
2024-11-22 17:33:02.348   System: Linux 5.15.0, amd64
2024-11-22 17:33:02.348   JRE: 21.0.5+11-Ubuntu-1ubuntu124.04
2024-11-22 17:33:02.469   AdbLocator: Found ADB in env PATH
2024-11-22 17:33:02.469   class com.floriandraschbacher.deskdockserver.Main: Using ADB from /usr/bin/adb
2024-11-22 17:33:02.508   ab@c703a44: Error getting devices: ADB server didn't ACK
2024-11-22 17:33:02.508   q$b@2b7d5ba: Error getting ADB devices: java.io.IOException: java.io.IOException: 
ADB server didn't ACK127.0.0.255192.168.1.2:5555
--
Mario.
--00000000000091fd6a0627868760--