Install Magisk on Android x86 Feb 18th 2018 Words: 329
This post is created 4 years ago, the content may be outdated.

Installing Magisk will give you ROOT, a super powerful Systemless Interface,
Magisk Modules support, and hide from tons of integrity tests like SafetyNet!

Apparently the direct install in the MagiskManager is not working thus the Magisk needs to be installed manually. The tutorial is tested on cm-x86-14.1-rc1 with Magisk 15.3 and should work on most of the AOSP based ROM.

** Note if you are using SuperSU on the Android x86, after the installation SuperSu will be invalid and replaced to MagiskSU automatically. **


  • Linux environment
  • Partition r/w Android x86
  • Any Android device with MagiskManager installed.

Install android-tools-mkbootimg abootimg on Linux

sudo apt install android-tools-mkbootimg abootimg

If you are using debian, the apt may report “Unable to locate package” because the android-tools-mkbootimg is in sid branch. You can download it here and install it using dpkg -i /path/to/android-tools-mkbootimg_version_architechture.deb.

Pack boot.img

Copy the kernel and ramdisk.img file from the partition of the Android x86 to the work folder. The following command will pack the boot.img of Android x86.

mkbootimg --kernel kernel --ramdisk ramdisk.img --output boot.img

Patch boot.img

Copy the extracted boot.img to the Android device. In MagiskManager, choose Install -> Patch boot.img then select the boot.img file.

After the operation, there should be a patched_boot.img file in the same directory.

Extract and Boot New Image

Copy the patched_boot.img to the work folder of Linux.

Extract kernel and ramdisk from patched_boot.img file using the following command.

abootimg -x patched_boot.img

There should be 3 new files in the folder after this operation.

Rename zImage to kernel and overwrite the one in the Android x86 partition.

Rename initrd.img to ramdisk.img and overwrite the one in the Android x86 partition.

** Do not mess up with the original permission **

Boot the Android x86 and the Magisk should be seen activated in MagiskManager.