Zend certified PHP/Magento developer

How to install WireGuard on Orange Pi 4B?

I want to make minecraft server to play with my friends and I need to connect my Orange Pi to WireGuard server, because it’s located under the NAT (if I get that term right). But when I try to apt install wireguard, it also installs linux kernel:

orangepi@orangepi4:~$ sudo apt install wireguard
[sudo] password for orangepi:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  linux-image-5.10.0-27-rt-arm64 linux-image-rt-arm64 wireguard-tools
Suggested packages:
  linux-doc-5.10 debian-kernel-handbook
Recommended packages:
  firmware-linux-free apparmor
The following NEW packages will be installed:
  linux-image-5.10.0-27-rt-arm64 linux-image-rt-arm64 wireguard wireguard-tools
0 upgraded, 4 newly installed, 0 to remove and 27 not upgraded.
Need to get 44.8 MB of archives.
After this operation, 252 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
orangepi@orangepi4:~$

When I first tried to apply WireGuard config, it said about unknown device type (haven’t exact message). I searched about it and thoguht it’s because of kernel modules weren’t applied. After reboot I was unable to connect to my Orange Pi by SSH. I reinstalled system and tried to install WireGuard again. Now I saw it tried to install kernel 6.x and thought it might be the reason of Orange Pi to be “dead”. I found mistake in /etc/apt/sources.list and changed it:

-deb http://mirror.docker.ru/debian/ stable main contrib non-free-firmware
+deb http://mirror.docker.ru/debian/ bullseye main contrib non-free

I installed wireguard, because saw now it has almost the same kernel version. But after realizing modprobe doesn’t want to apply new module, I removed it. Here is kernels I had after installing:

orangepi@orangepi4:/boot$ dpkg --list | grep linux-image
ii  linux-image-5.10.0-27-rt-arm64        5.10.205-2                      arm64        Linux 5.10 for 64-bit ARMv8 machines, PREEMPT_RT (signed)
ii  linux-image-current-rk3399            3.0.6                           arm64        Linux kernel, version 5.10.43 # <-- that one is which I had in the start
ii  linux-image-rt-arm64                  5.10.205-2                      arm64        Linux for 64-bit ARMv8 machines (meta-package)
orangepi@orangepi4:/boot$ sudo find /boot/ -iname "vmlinuz*"
/boot/vmlinuz-5.10.43 # <-- that one is which I had in the start
/boot/vmlinuz-5.10.0-27-rt-arm64

I think after rebooting my Orange Pi could become “dead” again and removed WireGuard with kernels.

So how can I install wireguard on my Orange Pi 4B? Or should I use other solutions like OpenVPN?


Here’s some additional information, which might be useful:

orangepi@orangepi4:~$ uname -a
Linux orangepi4 5.10.43 #3.0.6 SMP Mon Aug 1 18:31:02 CST 2022 aarch64 GNU/Linux

Debian image: Google Drive

Orange Pi 4B downloads section: orangepi.org