Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Zerotier #79

Open
mangotek opened this issue Oct 3, 2024 · 19 comments
Open

Feature Request: Zerotier #79

mangotek opened this issue Oct 3, 2024 · 19 comments

Comments

@mangotek
Copy link

mangotek commented Oct 3, 2024

Simliar to Tailscale, alternative VPN is Zerotier a SD-WAN

@Zepan
Copy link
Contributor

Zepan commented Oct 14, 2024

Hi, what is the advantage of Zerotier, compares to Tailscale.
We will add support if it have enough advantages, otherwise you can port by yourself as it is opensource now.

@amyc935
Copy link

amyc935 commented Oct 16, 2024

Hi, what is the advantage of Zerotier, compares to Tailscale. We will add support if it have enough advantages, otherwise you can port by yourself as it is opensource now.

The performance of SG2002 itself is not very powerful.
current Tailscale will take up too much performance, and zerotier will provide a better experience.

@Pouletgrill
Copy link

I would personally only buy the NanoKVM if it can be integrated in my zero tier environement. I am sure im not the only one out there that use zero tier and dont want to use Tailscale in top of that.
Thank you.

@Zepan
Copy link
Contributor

Zepan commented Oct 22, 2024

I see, we will consider it

@shimco
Copy link

shimco commented Dec 21, 2024

On my remote devices including pikvm's, which are often deployed hundreds of miles away, I use both Tailscale and Zerotier to provide redundancy if one service fails.
Adding multiple options like this would be beneficial for the NanoKVM project, so I hope you can implement this.

@staberas
Copy link

staberas commented Jan 18, 2025


**Guide to Installing ZeroTier 1.8.1 on NanoKVM **

NOTE: THIS MIGHT BREAK IN FUTURE UPDATES
EDIT : Managed to get it running and get it to boot at startup will return later to add setup details here
EDIT2: This is a short guide of people who know how to move around in linux , vim/vi and zerotier-cli

Steps

1. Download ZeroTier 1.8.1 .deb File

Use wget to fetch the ZeroTier 1.8.1 .deb file for riscv64:

mkdir zero
cd zero
wget https://download.zerotier.com/debian/bullseye/pool/main/z/zerotier-one/zerotier-one_1.8.1_riscv64.deb

2. Extract the .deb File

Extract the .deb contents using ar and xzcat:

ar x zerotier-one_1.8.1_riscv64.deb
xzcat data.tar.xz | tar -xvf -

3. Move Files to Correct Locations

Move the extracted binaries and files to their appropriate locations:

cp -r ./usr/sbin/zerotier-one /usr/sbin/
cp -r ./var/lib/zerotier-one /var/lib/
cp -r ./etc/init.d/zerotier-one /etc/init.d/

4. Verify Required Libraries (not sure if 1.8.1 requires them)

Ensure required libraries like libstdc++, libgcc_s, libc6, and libm exist in /lib or /usr/lib. If missing:

  1. Download and extract dependencies from [Debian repositories](https://ftp.debian.org/debian/pool/main).
  2. Example for libc6:
    wget http://ftp.debian.org/debian/pool/main/g/glibc/libc6_2.40-5_riscv64.deb
    ar x libc6_2.40-5_riscv64.deb
    xzcat data.tar.xz | tar -xvf -
    cp -r ./lib/* /lib/

ZeroTier requires has an extra dependency in order to fully run which is lsb,

4. **Install LSB Functions **

If your system lacks LSB support, copy the LSB init functions from Linux From Scratch:

Download the LSB init functions script:

Linux From Scratch LSB Functions

Save the script to /lib/lsb/init-functions.

Test it with
/etc/init.d/S97zerotier-one start

if it doesnt i would suggest creating a zerotier user/group and assigning it

busybox addgroup -g 108 zerotier-one
busybox adduser -H -D -s /bin/false -G zerotier-one zerotier-one
chown -R zerotier-one:zerotier-one /var/lib/zerotier-one

5. ** To start at boot **

 mv /etc/init.d/zerotier-one /etc/init.d/S97zerotier-one

S97 is the boot order and we want it to load as late as possible

@ciroiriarte
Copy link

would like to see this included, I extensively use Zerotier already.

@AndrewMoryakov
Copy link

I also actively use Zirotier, it can be much more convenient.

@GulinSS
Copy link

GulinSS commented Feb 9, 2025

What to do if it stopped to boot after reboot? I mean NanoKVM itself does not loading after these steps, seems I got it broken somehow. 😅

@staberas
Copy link

staberas commented Feb 9, 2025

What to do if it stopped to boot after reboot? I mean NanoKVM itself does not loading after these steps, seems I got it broken somehow. 😅

it doesn't boot at all? or zerotier doesn't start at boot ?

@GulinSS
Copy link

GulinSS commented Feb 9, 2025

it doesn't boot at all?

That one. KVM does not switch on its display with IP address. Only blue led is blinking.


Does it support some kind of hard reset?

@staberas
Copy link

staberas commented Feb 9, 2025

you have to reflash the sd card, but before that you need to see if the device is available on the network and access it.

@GulinSS
Copy link

GulinSS commented Feb 10, 2025

Yes, reflasing internal sd card with fresh image fixed the device. Well, another turn to enable ZeroTier :-)


@staberas which versions did you use?


Unfortunately only 1.8.1 could be installed due of:

# LD_TRACE_LOADED_OBJECTS=1 LD_WARN= LD_BIND_NOW= LD_VERBOSE= /lib/ld-linux-riscv64-lp64d.so.1  /usr/sbin/zerotier-one 
/usr/sbin/zerotier-one: /lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/sbin/zerotier-one)
/usr/sbin/zerotier-one: /lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/sbin/zerotier-one)
/usr/sbin/zerotier-one: /lib/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by /usr/sbin/zerotier-one)
	linux-vdso.so.1 (0x0000003fc2836000)
	libstdc++.so.6 => /lib/libstdc++.so.6 (0x0000003fc2416000)
	libm.so.6 => /lib/libm.so.6 (0x0000003fc2391000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0000003fc237a000)
	libc.so.6 => /lib/libc.so.6 (0x0000003fc2214000)
	/lib/ld-linux-riscv64-lp64d.so.1 (0x0000003fc2838000)
	libc.so => /lib/libc.so (0x0000003fc2179000)

But upgrading /lib/libstdc++.so.6 turns kvm into fail to boot. Or I messed it by another way...

The loader /lib/ld-linux-riscv64-lp64d.so.1 should be copied from libc6_2.40-5_riscv64.deb to kvm. It is a basic brick in this game.

@staberas
Copy link

@staberas which versions did you use?

Image

1.8.1 , its the only one i got working . (i started with 1.14.something added the libs on step 4 but it failed to work then went down to 1.8.1 which i know works on the licheeRV )

@GulinSS
Copy link

GulinSS commented Feb 10, 2025

1.14 worked for me but I got a broken state after kvm reboot: it was unable to connect to network and turn on lcd.

@staberas
Copy link

staberas commented Feb 10, 2025

1.14 worked for me but I got a broken state after kvm reboot: it was unable to connect to network and turn on lcd.

interesting i couldnt get it work cause of various dependencies thats why i dropped to 181 with the only dependency was LSB

@GulinSS
So apparently
http://ftp.debian.org/debian/pool/main/g/glibc/libc6_2.40-5_riscv64.deb
has been replaced by
http://ftp.debian.org/debian/pool/main/g/glibc/libc6_2.40-6_riscv64.deb
(i have the old one)

regardless

post me what /usr/sbin/zerotier-one tells you

and do the following :
strings /usr/sbin/zerotier-one | grep '\.so'

you should get the following :

/lib/ld-linux-riscv64-lp64d.so.1
libstdc++.so.6
libm.so.6
libgcc_s.so.1
libpthread.so.0
libc.so.6
ld-linux-riscv64-lp64d.so.1
/var/run/minissdpd.sock

After downloading it should do the following (confirming):

ar x libc6_2.40-5_riscv64.deb or ar x libc6_2.40-6_riscv64.deb

//we dont need debian-binary
rm control.tar.xz debian-binary
//decompress and move the files

 xzcat data.tar.xz | tar -xvf - 
 mv usr/lib/* /lib/ 

//remove the data.tar when done
rm -rf usr lib data.tar.xz

@Josephur
Copy link

Josephur commented Feb 12, 2025

Thanks a lot guys! I was able to get zerotier working on my nanovkm using latest firmware, and by using the directions above but using the latest libc from http://ftp.debian.org/debian/pool/main/g/glibc/libc6_2.41-1_riscv64.deb

However I'm not sure if I missed something in the instructions but for me the zerotier-cli and zerotier-idtool binaries that came in the deb file did not copy, (I think the instructions above are a bit old, now they reside in usr/sbin) I just copied them manually to /usr/sbin

This really needs to be a built in feature to choose between zerotier and/or tailscale.

@staberas
Copy link

@Josephur
That's Great!
can you post your command history of your installation ? i will need to refine the installation guide so we might make an installation script for others .

@Josephur
Copy link

@staberas I'm going to flash back to stock and make a YT video actually, as I see one does not yet exist. I will provide the commands I use here as well. I hope to get it done in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants