Home > ROMs > Custom ROMs

How to Root GSI ROM via Magisk [2 Methods] [Video]

In this guide, we will show you the steps to root any GSI ROM via Magisk. Not every device is lucky enough to get blessed with a custom ROM. For those sets of devices, a Generic System Image is more than enough to checkmark their requirement. Offering all the feature set that a custom ROM has to offer, these system images make it possible for even the less popular devices to enjoy all the latest goodies in town. However, there is a major difference in how these ROMs work.

Right from its flashing steps to gaining administrative access, things are a rad bit different. For instance, in custom ROMs, you just need to extract the boot.img, patch it via Magisk, and flash it via Fastboot Commands. However, things don’t work that way with GSI as they don’t have any boot.img to deal with. But fret not. There still exists a nifty workaround through which you could root the GSI ROM via Magisk. So without further ado, let’s show you how this could be carried out.

How to Root GSI ROM via Magisk and TWRP [Video]

While the process will not wipe off data, it is still recommended to be on the safer side and take a complete device backup beforehand. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.

root gsi rom

  1. First off, download and extract Android SDK Platform Tools on your PC.
    install adb platform tools windows
  2. Then download the latest Magisk APK and send it to your device.
  3. Now grab hold of the TWRP [only IMG file will do, no need for the ZIP] from its official site or XDA
  4. Then send it to the platform-tools folder. Likewise, rename it to twrp.img.
  5. Now enable USB Debugging on your device and connect it to your PC via a USB cable.root gsi rom
  6. Then launch CMD inside the platform-tools folder and type in the below command to boot your device to Fastboot Mode:
    adb reboot bootloader
  7. Now type in the below command to temporarily boot your device to TWRP Recovery.
    fastboot boot twrp.imgroot gsi rom
  8. From TWRP, go to Install > select Magisk.APK and flash it.root gsi rom
  9. Once done, go to reboot and select System. Your device will now boot to the OS.root gsi rom
  10. Now install the Magisk app as well. Once done, launch it.
  11. You will now get a prompt to complete additional setup, tap OK.root gsi rom
  12. Then select Direct Install and tap on Let’s Go. Once done, tap Reboot.
  13. Your device will reboot to the rooted OS and your task stands complete.root gsi rom

How to Root GSI ROM via Magisk and Boot.img [Without TWRP]

In the earlier method, we showed you the steps to root the GSI ROM via TWRP. However, not every ROM has a working custom recovery. So for those sets of devices, they could use this non-TWRP method to root their GSI ROM. Here’s how.

STEP 1: Get Boot.img

This is the most challenging part. You’ll have to get hold of the boot.img of the same firmware version which is installed on your device [in other words, the ROM which is currently acting as a base firmware]. You cannot get hold of the boot.img for the currently installed GSI ROM because it doesn’t have any [a GSI ROM is just a system.img].

root gsi rom

For instance, I flashed the LineageOS 20 on top of MIUI v14.0.23.5.15, so my base firmware is MIUI v14.0.23.5.15 and I’ll have to extract the boot.img from that MIUI firmware itself. However, in case you aren’t aware of that base firmware version, then you have no other option but to reflash the base firmware [any version], extract the boot.img from that firmware, and then flash the GSI ROM.

STEP 2: Patch Boot.img

  1. Download and install the Magisk App on your device.
  2. Then launch it and tap on the Install button next to Magisk.
  3. After that, choose ‘Select and Patch a File’, and navigate to the stock boot.img file, and select it.
    root gsi rom
  4. Then tap on the Let’s Go button situated at the top right.
    root gsi rom
  5. The boot.img file will now be patched and placed under the Downloads folder on your device. You should transfer this file to the platform-tools folder on your PC. We will now be using this file to root your GSI ROM.
    root gsi rom

STEP 3: Boot to Fastboot Mode

  1. Connect your device to the PC via USB cable. Make sure USB Debugging is enabled.
  2. Then head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
    command-prompt-inside-adb
  3. Type in the following command in the CMD window to boot your device to Fastboot Mode
    adb reboot bootloader

    root gsi rom

  4. To verify the Fastboot connection, type in the below command and you should get back the device ID.
    fastboot devices

    root Pixel 6A

STEP 4: Boot Device using Magisk Patched Boot.img

Now, there exist two different methods to proceed ahead. You could either directly flash the patched boot.img file [see FAQ] or temporary boot it. The second approach is highly recommended because you could easily test if everything is working well or not. If it is, then you could proceed ahead with the permanent installation.

root gsi rom

On the other hand, if things don’t go as planned and your device ends up in a bootloop/ softbrick, then just a normal reboot will fix the issue. So on that note, let’s get started with the second approach. For that, execute the below command in the CMD window and your device will be booted to a temporarily rooted OS.

fastboot boot magisk_patched.img

Root GSI via Magisk Direct Install

After executing the above command, your device will be booted to the OS with a temporary root. Here’s how to make it permanent:

  1. To begin with, launch the Magisk Manager App.
  2. Then tap on Install > Direct Install and tap Let’s Go situated at the top-right.
    root gsi rom
  3. Once done, hit the Reboot button situated at the bottom right.
  4. That’s it, your device will now boot to the rooted OS.

That’s it. These were the steps to root any GSI ROM via Magisk and TWRP. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.


Share: