sipeed / NanoKVM

NanoKVM: Affordable, Multifunctional, Nano RISC-V IP-KVM
848 stars 7 forks source link

Tailscale support #17

Closed ajorg closed 3 days ago

ajorg commented 2 weeks ago

I'd like to be able to connect the device to my Tailscale network so that I can reach it from other hosts on the VPN.

For me this is one of the more important differences when comparing to PiKVM.

polyzium commented 2 weeks ago

The latest kvmapp should have Tailscale support already, please update and check again

wj-xiao commented 2 weeks ago

Please refer to the documentation.

But there is a bug in current version. The login button in Tailscale may be no response due to a permission issue.

If you encounter this problem, you can fix it by execute the command in NanoKVM:

chmod +x /usr/bin/tailscale
chmod +x /usr/sbin/tailscaled

We will fix it in this week.

ajorg commented 2 weeks ago

Mine is on 2.0.1 and doesn't show a Tailscale option in the UI. I see references in the documentation (in screenshots) to a 2.0.4, but when I check for updates, it says "2.0.1 / You already have the latest version."

wj-xiao commented 2 weeks ago

Can you check the image version (setting -> About NanoKVM -> image version) cause we have fix that in the latest image.

If your image version is not 1.2.0, you can update image according to this doc.

There may be two reasons for this issue:

  1. Wrong time. You can check the system time by executing date. If the time is wrong, fix it by executing ntpdate time.nist.gov.
  2. Wrong DNS. Execute ping cdn.sipeed.com. If no record, vim /etc/resolv.conf, and add this line: nameserver 223.5.5.5.
ajorg commented 2 weeks ago

Can you check the image version (setting -> About NanoKVM -> image version) cause we have fix that in the latest image.

image

Wrong time. You can check the system time by executing date. If the time is wrong, fix it by executing ntpdate time.nist.gov.

Looks right, and ntpd is running.

# date
Tue Aug 27 03:04:29 UTC 2024
# ntpdate time.nist.gov
27 Aug 03:04:31 ntpdate[3130]: the NTP socket is in use, exiting
# ps | grep ntp
  388 root     /usr/sbin/ntpd -g -p /var/run/ntpd.pid
 3150 root     grep ntp

Wrong DNS. Execute ping cdn.sipeed.com. If no record, vim /etc/resolv.conf, and add this line: nameserver 223.5.5.5.

Also looks right:

# ping -c 2 cdn.sipeed.com
PING onlyv4.overseacdnweb.qiniu.com.w.kunlunsl.com (163.181.66.230) 56(84) bytes of data.
64 bytes from 163.181.66.230 (163.181.66.230): icmp_seq=1 ttl=53 time=2.72 ms
64 bytes from 163.181.66.230 (163.181.66.230): icmp_seq=2 ttl=53 time=3.23 ms

--- onlyv4.overseacdnweb.qiniu.com.w.kunlunsl.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 2.723/2.975/3.227/0.252 ms

I found in one of the logs the CDN URL that's used and it's reporting that 2.0.1 is the latest available:

# curl https://cdn.sipeed.com/nanokvm/latest
2.0.1
wj-xiao commented 2 weeks ago

It looks like CDN has wrong cache in your area. I get 2.0.5 from the same url.

I just refresh the file resources. Can you try to update again?

or try curl https://cdn.sipeed.com/nanokvm/latest?random=12345

ajorg commented 2 weeks ago

Some random parameters do work:

# curl 'https://cdn.sipeed.com/nanokvm/latest?asdfasfd'
2.0.5

But the older one is still cached:

# curl 'https://cdn.sipeed.com/nanokvm/latest'
2.0.1

Cache-Control: no-cache doesn't help either:

# curl -H Cache-Control:\ no-cache 'https://cdn.sipeed.com/nanokvm/latest'
2.0.1
ajorg commented 2 weeks ago

After upgrading the system firmware to 1.2.0 I was able to update the app to 2.0.1 again and Tailscale is working, so I think we can close this issue and will open some others.

wj-xiao commented 2 weeks ago

Closed.

CDN cache problem link to #23 .

ironicbadger commented 1 week ago
# curl https://cdn.sipeed.com/nanokvm/latest
2.0.1

Still showing here as 2.0.1 and the tailscale binary chmod's were required.

ajorg commented 1 week ago

@ironicbadger for me at least, it turned out to not matter that the "app" was 2.0.1.

The firmware comes in two parts, and there's nothing to tie them together. If you haven't manually updated your system image to the latest that could explain why you had the chmod issue and I didn't.

FWIW, I wasn't able to use the 1.2.1 pre-release system image for some reason, but the 1.2.0 worked fine for me.

If you're only concerned about still seeing 2.0.1 for the "app" firmware on the CDN, you'll want to watch #23 instead.

ironicbadger commented 1 week ago

My webUI tells me 2.0.4 for the app, how do I know which system image I am running?

ajorg commented 1 week ago

I didn't find a way to tell which system image. /etc/os-release seemed to say the same thing after upgrade, and I wasn't sure where else to look. @wj-xiao is there a way to see what release / version the installed system image is?

wj-xiao commented 1 week ago

There are two ways to check the image version.

  1. Click Settings -> About in the web page:

CleanShot 2024-09-06 at 11 30 46

  1. execute "cat /boot/ver" in the NanoKVM to retrieve the image release date. The corresponding image version can be found on the release page.
wj-xiao commented 1 week ago

It is recommended to update to the latest image firstly by this document. Older image versions may contain some bugs.

Unable to obtain the latest version will be fixed next week.

wj-xiao commented 3 days ago

The solution can be found #42