Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Nov 2024 21:49:37 +0100
From:      Mario Marietto <marietto2008@gmail.com>
To:        FreeBSD Mailing List <freebsd-questions@freebsd.org>,  freebsd-hackers <freebsd-hackers@freebsd.org>,  FreeBSD virtualization <freebsd-virtualization@freebsd.org>
Subject:   ADB server does not ACK if it is launched inside Linux chrooted / jailed / emulated with the Linuxulator
Message-ID:  <CA%2B1FSijBc6ZrxDA%2BBuzawL6rDn6KEZWx5Je=6dUNt5RrHYT5LQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--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"

<div dir="ltr"><div><div class="gmail-s-prose gmail-js-post-body">
                
<p>Hello.<br></p><p>I&#39;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&#39;ve already tried to 
run the app using java installed natively on FreeBSD,but it fails 
because it wasn&#39;t designed for this. So :</p>
<pre><code>[root@noble /]==&gt; adb connect <a href="http://192.168.1.2:5555">192.168.1.2:5555</a>;

* daemon not running. starting it now on port 5037 *
cannot bind &#39;tcp:5037&#39;
ADB server didn&#39;t ACK
* failed to start daemon *
error: cannot connect to daemon
</code></pre>
<p>that&#39;s the error that I get. I&#39;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 :</p>
<pre><code>[root@marietto /home/marietto]==&gt; adb connect <a href="http://192.168.1.2:5555">192.168.1.2:5555</a>;

* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to <a href="http://192.168.1.2:5555">192.168.1.2:5555</a>;
</code></pre>
<p>The problem is that the java app does not recognizes that the adb server is working :</p>
<pre><code>[root@noble /home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0]==&gt; 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&#39;t ACK
q$b@31524dfb: Error getting ADB devices: 
java.io.IOException: java.io.IOException: 
ADB server didn&#39;t ACK
</code></pre>
<p>but it is working :</p>
<pre><code>[root@noble /home/marietto/Desktop/Files/OS/Linux/Tools/DeskDockServer_1.3.0]==&gt; 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
</code></pre>
<p>According with this thread :</p>
<p><a href="https://forums.freebsd.org/threads/make-jail-available-to-bind-only-certain-ports.85609/" rel="nofollow noreferrer">https://forums.freebsd.org/threads/make-jail-available-to-bind-only-certain-ports.85609/</a></p>;
<p>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.</p>
<p>this is what I tried to do :</p>
<pre><code>nano /etc/pf.conf

nat on $ext_if from <a href="http://127.0.0.0/24">127.0.0.0/24</a>; to any -&gt; 192.168.1.2
rdr on $ext_if proto tcp from any to any port 5037:5555 -&gt; 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
</code></pre>
<p>but it didn&#39;t work :</p>
<pre><code>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&#39;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&#39;t ACK127.0.0.255192.168.1.2:5555</code></pre></div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Mario.<br></div></div>

--00000000000091fd6a0627868760--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B1FSijBc6ZrxDA%2BBuzawL6rDn6KEZWx5Je=6dUNt5RrHYT5LQ>