anbox / anbox-modules

Anbox kernel modules
327 stars 224 forks source link

issue while installing anbox in kali linux #101

Open Bkq24680pm opened 2 years ago

Bkq24680pm commented 2 years ago

┌──(piyush㉿kali)-[~/anbox-modules] └─$ ./INSTALL.sh [sudo] password for piyush:

Building module: cleaning build area... make -j2 KERNELRELEASE=5.18.0-kali5-amd64 all KERNEL_SRC=/lib/modules/5.18.0-kali5-amd64/build......(bad exit status: 2) Error! Bad return status for module build on kernel: 5.18.0-kali5-amd64 (x86_64) Consult /var/lib/dkms/anbox-ashmem/1/build/make.log for more information.

Building module: cleaning build area... make -j2 KERNELRELEASE=5.18.0-kali5-amd64 all KERNEL_SRC=/lib/modules/5.18.0-kali5-amd64/build....(bad exit status: 2) Error! Bad return status for module build on kernel: 5.18.0-kali5-amd64 (x86_64) Consult /var/lib/dkms/anbox-binder/1/build/make.log for more information. modprobe: FATAL: Module ashmem_linux not found in directory /lib/modules/5.18.0-kali5-amd64 binder_linux 225280 0 ls: cannot access '/dev/ashmem': No such file or directory crw------- 1 root root 10, 125 Aug 18 14:10 /dev/binder WHY I AM GETTING THIS ERROR SOMEONE PLEASE HELP

SoulInfernoDE commented 1 year ago

Because you cannot build the modules any longer with new kernel versions. Instead you need to make the kernel with the modules built in. This mean you need to build the kernel from source but the configuration file changed to include the modules in the kernel for your linux distro.

Adapt example here: https://github.com/anbox/anbox-modules/issues/75#issuecomment-794079944

SoulInfernoDE commented 1 year ago

Here are the manual steps to go through: https://www.kali.org/docs/development/recompiling-the-kali-linux-kernel/

If you need a kali optimized script please tell me to do so. I will make a script out of the article mentioned if enough people are interested in a script for it.

alex20465 commented 1 year ago

I wonder what the point of snap-applications is when you have to build your kernel from source in order to use a snap application... this totally is snappy.

SoulInfernoDE commented 1 year ago

Hey alex, the problem is that this is sadly two completely different things/troubles.

Anbox was built in times where you need to add some functionality to your linux system. As the linux system has grown and is steadily improved and secured the modules that could be built cannot be build any more due to a security decision of the linux team. The modules are based on a linux access program code that were removed from the linux system (kernel) permanently for security issues with no other option to access those areas of linux again from untrusted sources... The two modules then were added to the linux system directly and marked trusted when used directly but only in the "staging phase" which never left that phase and made it into the main linux kernel branch. If you have a linux installed with the staging things activated, then you can use just the snap without the old modules. Therefore it will run without the external modules needed anymore. So normally the snap should then work more likely out of the box but this needs the ASHMEM and BINDER module beeing in the main kernel branch activated from every linux distribution. Unfortunately this is not the case yet.... They are trusted and included but into the staging area which standard linux kernel has not activated and therefore not build in yet...