The Custom Droid

Android Tutorials, Tips and Tricks

Root Google Pixel 2 and Pixel 2 XL using Magisk

Root Google Pixel 2 and Pixel 2 XL

You can now enjoy root-enabled apps and mods on your 2017 Pixel devices. Follow this guide to easily root Google Pixel 2 and Pixel 2 XL using Magisk.

Advertisement

The development scene is rolling fast than we have imagined. We recently saw Alpha builds of TWRP being released for the devices, and now you can easily root your newly bought Google Pixel flagship. Rooting will allow you to customize the device according to your needs, install popular mods like ViPER4Android, use root-enabled apps to modify the system, and much more. So, if you want to root Google Pixel 2 and Pixel 2 XL, then follow the steps below.

How to Root Google Pixel 2 and Pixel 2 XL
How to Root Google Pixel 2 and Pixel 2 XL

Root Google Pixel 2 and Pixel 2 XL

The device owners in the Pixel 2 XDA community have already tried rooting the device by sideloading a customized kernel. The solution worked out pretty good for those using the Pixel 2, but when tried on the Pixel 2 XL, several users reported of bootloops. And ultimately they needed to flash back the stock boot.img to fix it.

Advertisement

While TWRP has been released, but it is still not completely functional and it seems like not everyone has felt the urge to flash it. When the development progresses in the future, and TWRP becomes more functional, then we can expect a much efficient root method.

For now, if you would like to permanently root Google Pixel 2 and Pixel 2 XL, then you can simply use Magisk to do so. No, we don’t mean by sideloading the installer file via TWRP. We will use a rather more functional method that was introduced in Magisk 14.0 release.

The new installation method doesn’t rely on TWRP or a pre-rooted environment. It rather patches the stock boot (kernel) image and injects the root into it. The new boot image (patched_boot.img) could then be flashed easily using Fastboot. Easy right? Even if you’re new to the rooting scene, the instructions below are simple enough to help you root Google Pixel 2 and Pixel 2 XL.

Disclaimer

Rooting your device is your and only your liability. We do not hold any responsibility for the damage caused during or after performing this procedure. However, in case you find yourself stuck in any such situation, we will try the best to help you.

Prerequisites

Before you get to the process to root Google Pixel 2 and 2 XL, make sure that you meet the requirements below, beforehand.

Instructions to Root Google Pixel 2 and Pixel 2 XL using Magisk

First off, download the latest Magisk Manager application and install it on your device.

Update: With the Magisk 14.5 Beta, you shall now easily root Google Pixel 2 (XL) by flashing the zip using TWRP recovery.

Step 1: Patch Stock ‘boot.img’

  1. Now, download the stock boot.img file corresponding to the current build number installed. You can extract it from the factory image.
  2. Connect your device to the PC in File Transfer mode. Copy the boot.img to the internal storage (Anywhere on it).
  3. Open the ‘Magisk Manager’ app.
  4. Tap on the menu icon (3-horizontal lines) on the top-left and select ‘Settings’.
  5. Press the ‘Patched Boot Output Format’ option and select ‘”.img”.
    Root Google Pixel 2 and Pixel 2 XL - Change Patched Boot Image format
    Root Google Pixel 2 and Pixel 2 XL – Change Patched Boot Image format
  6. Now, go back to the main screen and tap on the ‘Install’ button.
  7. Again, tap on ‘Install’ and then select ‘Patch Boot Image File’ from the pop-up menu.
    Root Google Pixel 2 and Pixel 2 XL - Patch Stock Boot Image
  8. Browse the internal storage and select the ‘boot.img’ file. As soon as you select it, the app will download the installer, patch the boot image, and will output the new ‘patched_boot.img’

Step 2: Flash the  ‘patched_boot.img’

Now, we need to flash the patched boot image file in order to root Google Pixel 2 and Pixel 2 XL.

  1. Connect your Pixel device to the PC via USB cable.
  2. Go to the ‘Magisk Manager’ folder in the internal storage.
  3. Copy the ‘patched_boot.img’ file and paste it into the folder where the Fastboot files are present (C:\adb).
  4. Go to C:\adb folder, press the SHIFT key and right-click on an empty space inside this folder.
  5. Select ‘Open PowerShell window here’ from the pop-up menu.
  6. Now, disconnect the device and power it off.
  7. Boot into Bootloader Mode by pressing the Volume Down + Power button altogether.
  8. Connect the device to the PC via USB cable.
  9. Enter the following command to flash the file and root Google Pixel 2 and Pixel 2 XL.
     fastboot flash boot patched_boot.img

    Root Google Pixel 2 and Pixel 2 XL - Flash Patched Boot Image via Fastboot

  10. Once the image has been flashed, reboot your phone using:
     fastboot reboot

Your Pixel device is now rooted and should have Magisk working. You can take the benefits of supported Magisk Modules and add more options and features to your device.

You have just been able to root Google Pixel 2 using Magisk. If you have any problems during the root process, then feel free to ask us via comments.

About the Author

Founder and Editor-in-Chief

Dhananjay has more than 11 years of experience in Android software customization and development, and has spent the past 10 years writing about it. He spends most of his prime time reading, learning and writing about Android and other open-source projects. He is also a community-taught web developer. Apart from that, he loves mountain biking and playing video games on his PlayStation.

Leave a Reply

Comments are moderated, and published only if they are relevant to the topic and add value in a constructive way. If you disagree with something, please be polite and respectful. We suggest you read our comment policy before commenting.