starfive-tech / VisionFive2

438 stars 78 forks source link

/dev/net/tun does not exist #89

Open plsnotracking opened 4 months ago

plsnotracking commented 4 months ago

Trying to start tailscale on my machine, it fails to boot up.

Issue on the tailscale forum suggest a newer available kernel: https://github.com/tailscale/tailscale/issues/10498

sudo /usr/sbin/tailscaled  --statedir=/workspaces/.tailscale/  --socket=/var/run/tailscale/tailscaled.sock  --port=41641
logtail started
Program starting: v1.60.0-tb36943c9b-g99e84774b, Go 1.22.0: []string{"/usr/sbin/tailscaled", "--statedir=/workspaces/.tailscale/", "--socket=/var/run/tailscale/tailscaled.sock", "--port=41641"}
LogID: 840df67af56ee18c54fb0de26894e92a47f6eb0015cec5eb483d69e03c3b61e2
logpolicy: using system state directory "/var/lib/tailscale"
wgengine.NewUserspaceEngine(tun "tailscale0") ...
Linux kernel version: 5.15.0-starfive
is CONFIG_TUN enabled in your kernel? `modprobe tun` failed with: modprobe: FATAL: Module tun not found in directory /lib/modules/5.15.0-starfive
tun module not loaded nor found on disk
wgengine.NewUserspaceEngine(tun "tailscale0") error: tstun.New("tailscale0"): CreateTUN("tailscale0") failed; /dev/net/tun does not exist
flushing log.
logger closing down
getLocalBackend error: createEngine: tstun.New("tailscale0"): CreateTUN("tailscale0") failed; /dev/net/tun does not exist

Any assistance in setting this up will be appreciated, thank you.

MichaIng commented 4 months ago

Add CONFIG_TUN=y or CONFIG_TUN=m to your kernel configuration.

plsnotracking commented 4 months ago

@MichaIng sorry, I don't have enough knowledge about the kernel, but is there a guide you'd recommend it order to do this? Thanks.

MichaIng commented 4 months ago

It seems you did not compile the kernel yourself. To not exceed the scope, let's have this as a request for StarFive to enable TUN interfaces for OpenVPN, Tailscale and other VPN software OOTB. It is extremely common, so zero point to not have it enabled by default.

Here is the kernel configuration to touch: https://github.com/starfive-tech/linux/blob/JH7110_VisionFive2_6.1.y_devel/arch/riscv/configs/starfive_visionfive2_defconfig

I see you opened an issue at the kernel repo already some months ago: https://github.com/starfive-tech/linux/issues/129 It is correctly suited there indeed.

I just opened a PR, let's see whether StarFive accepts it any time soon: https://github.com/starfive-tech/linux/pull/137

MichaelZhuxx commented 3 months ago

Add this config as default, please check the latest tag.

plsnotracking commented 3 months ago

I'll update my starfive image and retry, thanks.

plsnotracking commented 3 months ago

Is there a correct way to update to get this patch?

I tried with - sudo apt-get update && sudo apt-get full-upgrade -y && sudo apt-get autoremove -y && sudo apt-get autoclean

MichaelZhuxx commented 3 months ago

Oh, this patch is for kernel. so you need use the latest Debian image , or build the latest kernel and replace it (please refer to guideline)