How To Guide Rooting the Google Pixel 6a

Search This thread

Voxilli

Member
Aug 14, 2015
12
0
Ok, first time taking OTA and dealing with root in over 8 years.
June update - rooted. Took the file uploaded in the 2nd post here in this thread.

Now, have OTA update pending, can't update.
What exactly do I need to do? Which factory image should I download? (June/July)
I have the boot.img from it, patch it with magisk? then boot it? that's it? I thought the security update updates more than just boot.img.. no?

Thanks!
Sideload the OTA. Download the full image (corresponding to the OTA). Patch the boot.img from it and flash. Then you'll be up-to-date and rooted again.
 

V0latyle

Forum Moderator
Staff member
Ok, first time taking OTA and dealing with root in over 8 years.
June update - rooted. Took the file uploaded in the 2nd post here in this thread.

Now, have OTA update pending, can't update.
Trying to follow your OTA update with magisk - keep getting "stock backup does not exist" when trying to Uninstall Magisk ...
What exactly do I need to do? Which factory image should I download? (June/July)
I have the boot.img from it, patch it with magisk? then boot it? that's it? I thought the security update updates more than just boot.img.. no?

Thanks!
If you want to be able to restore images, you'll need to flash the stock boot image, then live boot the patched image and perform Direct Install in Magisk.

But, since you're trying to update anyway, just use the factory image method. If you want to be able to update via OTA, follow the instructions above - don't flash the patched image, just use it for temporary root.
 

EvoX2008

Member
May 9, 2009
31
3
Detroit, MI
If you want to be able to restore images, you'll need to flash the stock boot image, then live boot the patched image and perform Direct Install in Magisk.

But, since you're trying to update anyway, just use the factory image method. If you want to be able to update via OTA, follow the instructions above - don't flash the patched image, just use it for temporary root.
Guys!! English!!! Please!!! :)

I'm done for tonight :)

Somehow I got to the point where the security update got installed!!! I followed the ota with magisk guide and did not restart after it, went into the magisk, installed onto the secondary partition (or whatever it's called), rebooted.. and the phone completely froze.. I thought "that's it, this pixel has had a nice long 1wk long life :D".
Held the power button for over 30 seconds, booted up, went to magisk, patched the boot.img file, flashed it, and nothing - still no security update installed.

I want to offload the process of updating the phone to my wife, but I kinda like permanent root for acc control, etc
 

ctfrommn

Senior Member
May 25, 2011
7,341
10,711
Minnesota
Ok, first time taking OTA and dealing with root in over 8 years.
June update - rooted. Took the file uploaded in the 2nd post here in this thread.

Now, have OTA update pending, can't update.
Trying to follow your OTA update with magisk - keep getting "stock backup does not exist" when trying to Uninstall Magisk ...
What exactly do I need to do? Which factory image should I download? (June/July)
I have the boot.img from it, patch it with magisk? then boot it? that's it? I thought the security update updates more than just boot.img.. no?

Thanks!
Just reflash the stock June bootimage, take the new update and reflash the patched boot. The kernel didnt change between these 2 releases so the patched boot works on either.
 

IImanuII

Senior Member
Mar 12, 2010
104
23
Just reflash the stock June bootimage, take the new update and reflash the patched boot. The kernel didnt change between these 2 releases so the patched boot works on either.
how reflash stock boot image if i dont have a backup? I need to flash it in bootloader mode?

Let me explain worse 😂: I download the boot.img directly from google, but then if I flash it in bootloader mode, I don't lose all the magisk modules on reboot? Don't risk the bootloop?

Edit:

All done, i follow before this:


And after this:
 
Last edited:
  • Like
Reactions: EvoX2008

V0latyle

Forum Moderator
Staff member
Guys!! English!!! Please!!! :)
You won't like this answer, but if you don't know what you're doing, you shouldn't be doing this.
I'm done for tonight :)

Somehow I got to the point where the security update got installed!!! I followed the ota with magisk guide and did not restart after it, went into the magisk, installed onto the secondary partition (or whatever it's called), rebooted.. and the phone completely froze.. I thought "that's it, this pixel has had a nice long 1wk long life :D".
Held the power button for over 30 seconds, booted up, went to magisk, patched the boot.img file, flashed it, and nothing - still no security update installed.

I want to offload the process of updating the phone to my wife, but I kinda like permanent root for acc control, etc
I think you misunderstand me.

When you flash the boot image with fastboot flash boot <boot image>, you're actually writing that binary to the /boot partition. If you do this with a patched image, Magisk does not have a backup.
When you boot the boot image, with fastboot boot <boot image>, you're sending the binary to the device to load instead of what's written to /boot. If you boot a patched image, then perform Direct Install in Magisk, Magisk then creates a backup of the original image in /boot so as to be able to restore it later.

Just reflash the stock June bootimage, take the new update and reflash the patched boot. The kernel didnt change between these 2 releases so the patched boot works on either.
I would not recommend doing this. While the kernel may be the same, the boot image contains other components that are updated with almost every release, such as the Android security engine. It's OK to temporarily boot an older image, but I recommend always flashing the boot image that corresponds to the update.

how reflash stock boot image if i dont have a backup? I need to flash it in bootloader mode?
Download the factory update package (not the OTA) and extract boot.img from within it, then flash in bootloader: fastboot flash boot <boot image>
Let me explain worse 😂: I download the boot.img directly from google, but then if I flash it in bootloader mode, I don't lose all the magisk modules on reboot? Don't risk the bootloop?
Magisk operates via a kernel patch to grant root access. If you flash an unpatched boot image, you lose root, meaning Magisk is unable to load any modules. The only time this would cause a boot loop is if you updated via OTA, then flashed an older boot image; the system would see the mismatch and assume the update failed.
 

ctfrommn

Senior Member
May 25, 2011
7,341
10,711
Minnesota
I would not recommend doing this. While the kernel may be the same, the boot image contains other components that are updated with almost every release, such as the Android security engine. It's OK to temporarily boot an older image, but I recommend always flashing the boot image that corresponds to the update.
Ive done this like 20 times already working on building my kernel....zero issues.
 

V0latyle

Forum Moderator
Staff member
Ive done this like 20 times already working on building my kernel....zero issues.
Okay, you completely ignored what I just said:
While the kernel may be the same, the boot image contains other components that are updated with almost every release, such as the Android security engine.
The kernel version itself corresponds to the public Linux kernel, so of course you can re-use it as much as you want. The boot image still contains other information that's version specific and may not work on newer builds.
 

SAMMMMMM

Member
Nov 13, 2014
8
4
how reflash stock boot image if i dont have a backup? I need to flash it in bootloader mode?

Let me explain worse 😂: I download the boot.img directly from google, but then if I flash it in bootloader mode, I don't lose all the magisk modules on reboot? Don't risk the bootloop?

Edit:

All done, i follow before this:


And after this:

Doesn't help you at all, but I'm getting similar struggles.

Like, all the guides expect you to have a sbin folder, but Android 12 doesn't have it, it's moved to dev. I've followed a few of these guides to a T, and Magisk doesn't detect a backup no matter which I guide I follow through. I don't think the current guides are gonna work for someone with a Pixel 6* running 12.

My next effort is just gonna go through the original process of grabbing the latest factory image from Google myself and treating it like a fresh root. The Magisk/partition/OTA process has been nothing but headache so far.
 
Last edited:

maelopam

Member
Dec 13, 2014
30
9
Moto X4
I ran into the issue where the OEM unlock was grayed out. So I followed the guide, but after factory reset it still was grayed out. However, I have a esim using Google Fi, so it automatically added back Google Fi after the reset. So in my old device, I migrated my number back to my old device and the unlock immediately ungrayed itself on the pixel and I could finish unlocking and rooting.

It did somehow wipe again the device after installing magisk and rebooting, but I just needed to reinstall magisk apk and it was rooted.


It now displays the warning that the device is unlocked, when re-booting. Is there a way to disable that (preferably flashing something I can create myself)? I knew how to do it for lineageos on moto, not sure how to do it for stock on pixel.
 

ctfrommn

Senior Member
May 25, 2011
7,341
10,711
Minnesota
I ran into the issue where the OEM unlock was grayed out. So I followed the guide, but after factory reset it still was grayed out. However, I have a esim using Google Fi, so it automatically added back Google Fi after the reset. So in my old device, I migrated my number back to my old device and the unlock immediately ungrayed itself on the pixel and I could finish unlocking and rooting.

It did somehow wipe again the device after installing magisk and rebooting, but I just needed to reinstall magisk apk and it was rooted.


It now displays the warning that the device is unlocked, when re-booting. Is there a way to disable that (preferably flashing something I can create myself)? I knew how to do it for lineageos on moto, not sure how to do it for stock on pixel.
You would have to relock the bootloader.
 
  • Like
Reactions: maelopam

ryan92084

Senior Member
Jun 19, 2010
209
36
Thanks for this, the suggestion to pull the sim for oem unlock did the trick. Been a long while since i had a new device so the refresher was very welcome.
 

Pakabidu

Senior Member
Aug 27, 2013
57
6
Thanks for instructions around unlocking the bootloader!
My device came preinstalled with April update and OEM unlocking was greyed out. I removed google account in settings, took the SIM card out, updated to June patch, did factory reset, setup the device without Wifi and google account, after setting up I connected to Wifi and once I reinserted the SIM card I was able to toggle the OEM unlocking option in developer settings. Great stuff!
 

bobby janow

Senior Member
Jun 15, 2010
6,453
2,422
Thanks for instructions around unlocking the bootloader!
My device came preinstalled with April update and OEM unlocking was greyed out. I removed google account in settings, took the SIM card out, updated to June patch, did factory reset, setup the device without Wifi and google account, after setting up I connected to Wifi and once I reinserted the SIM card I was able to toggle the OEM unlocking option in developer settings. Great stuff!
All you really needed to do was do the system update and factory reset. Everything else was extraneous.
 
  • Like
Reactions: Pakabidu

bobby janow

Senior Member
Jun 15, 2010
6,453
2,422
Pretty sure it needs to connect to Google after the reset. Not in relation to signing into an account, just as part of the normal "setting up your phone" process.
Yes, of course. That's always been the case but removing the account, taking out the sim card, only connecting to wifi without a sim card.. that's what I meant. Reset after the update and just continue setting up as usual. Any connection to the internet will suffice.
 
  • Like
Reactions: ctfrommn

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    I was using powershell so tried cmd and it worked fine this time!
  • 11
    Rooting the Pixel 6a is just about as easy as any other factory unlocked pixel, but because so many people have had issues with unlocking their bootloaders, I figured I'd post my exact personal steps I took when a Pixel 6a came into my tech shop to be rooted, and I discovered the current bug with Rooting

    What You'll Need:
    - June 2022 Firmware OTA Update Installed at least: Do this on device. Do Not download the OTA update from google's firmware website.
    - ADB/Fastboot/Google Drivers for Windows: I use this to install- ADB 15sec Installer
    - Magisk Manager APK: Github - Magisk Github Releases
    - Firmware Matching Currently Installed: Google FW page - Google Official Firmware Downloads - you need this for the boot.img file
    - A Windows Computer
    - A USB-C cable to connect to your phone to the computer

    OEM Unlock Bug
    With early units sold by Google, they're shipping with a bug where OEM Unlock stays grayed out. Here's the only way I got around this issue
    1.) Log out of any Google Account on the device
    2.) Connect to Wifi, check for updates without your sim card in the device. There is a bug where it will potentially download the update for your carrier sim
    3.) At minimum, you should get the June 2022 security patch update. Run the update and remember which update it is for when you download the firmware to get boot.img
    4.) When the update is finished, Factory Reset your device either from settings or Android recovery
    5.) Go through Android setup without sim card in, and don't connect to wifi, finish setup without logging into a google account or anything
    6.) When setup is done, connect to wifi and put your sim back in.
    7.) Pay attention in your notifications for "Preparing your Device" notification.
    8.) When that notification pops up, enable Developer options (tap build number a bunch of times)
    9.) OEM Unlock should be possible to enable now. Also enable USB Debugging

    Pre-Root Setup
    1.) Install Magisk Manager from Github
    2.) Use 7zip (or any other ZIP opening program) to extract the boot.img from your firmware download from google
    -- the boot.img is inside another zip file that's in the download from google. very easy to get
    3.) Put the Boot.img on your phones internal storage
    4.) Open Magisk Manager, and select your Boot.img from internal storage. Patch the boot.img to make it a rooted boot.img
    5.) With your phone connected to the computer, move the magisk_patched.img from sdcard/downloads to your computer
    6.) If USB debugging is properly enabled, now you can open CMD and reboot to bootloader with
    Code:
    adb reboot bootloader

    Unlocking the bootloader
    1.) With the device connected, OEM Unlock enabled, and booted to bootloader, you can unlock the bootloader with the following command
    Code:
    fastboot flashing unlock
    -- If nothing changes on your phone screen, use Device Manager to make sure the device is recognized via google drivers: vid here on that - Quick Fastboot Drivers Install Tutorial
    2.) On your phone, use the volume keys to select Unlock Bootloader, then hit the power button, device should reboot back to bootloader
    3.) flash the boot partition with the magisk patched boot.img
    Code:
    fastboot flash boot magisk_patched.img
    4.) Now you can reboot back into your device and you should be rooted!
    Code:
    fastboot reboot

    Congrats! Now you're bootloader unlocked and rooted! GrapheneOS is already available if you want a degoogled rom, haven't seen another rom pop up yet
    all done from there

    updating your device when rooted
    I do not have a pixel 6a specifically for this right now to confirm this will work, but on every other device with OTA's, this has been my process.
    1.) Download your OTA using the system update part of Settings
    2.) When it pops up and is ready to restart to finish installing the update, DO NOT CLICK RESTART IN SETTINGS/SYSTEM UPDATE
    3.) Go to Magisk Manager, and select Install next to Magisk
    4.) Select "Install to Inactive Slot (After OTA)
    5.) When its done patching the boot partition, hit restart in Magisk
    Your OTA Update is now rooted
    5
    Im starting work on my custom kernel now so hopefully MVK for Bluejay will be ready in the coming days/weeks.
    4
    To save time and effort here is the magisk patched boot.img for June 2022 patch level, Carrier Unlocked 6a from the Google Store. Make SURE you are on build SD2A.220601.003 before flashing! ;)
    3
    Guys!! English!!! Please!!! :)
    You won't like this answer, but if you don't know what you're doing, you shouldn't be doing this.
    I'm done for tonight :)

    Somehow I got to the point where the security update got installed!!! I followed the ota with magisk guide and did not restart after it, went into the magisk, installed onto the secondary partition (or whatever it's called), rebooted.. and the phone completely froze.. I thought "that's it, this pixel has had a nice long 1wk long life :D".
    Held the power button for over 30 seconds, booted up, went to magisk, patched the boot.img file, flashed it, and nothing - still no security update installed.

    I want to offload the process of updating the phone to my wife, but I kinda like permanent root for acc control, etc
    I think you misunderstand me.

    When you flash the boot image with fastboot flash boot <boot image>, you're actually writing that binary to the /boot partition. If you do this with a patched image, Magisk does not have a backup.
    When you boot the boot image, with fastboot boot <boot image>, you're sending the binary to the device to load instead of what's written to /boot. If you boot a patched image, then perform Direct Install in Magisk, Magisk then creates a backup of the original image in /boot so as to be able to restore it later.

    Just reflash the stock June bootimage, take the new update and reflash the patched boot. The kernel didnt change between these 2 releases so the patched boot works on either.
    I would not recommend doing this. While the kernel may be the same, the boot image contains other components that are updated with almost every release, such as the Android security engine. It's OK to temporarily boot an older image, but I recommend always flashing the boot image that corresponds to the update.

    how reflash stock boot image if i dont have a backup? I need to flash it in bootloader mode?
    Download the factory update package (not the OTA) and extract boot.img from within it, then flash in bootloader: fastboot flash boot <boot image>
    Let me explain worse 😂: I download the boot.img directly from google, but then if I flash it in bootloader mode, I don't lose all the magisk modules on reboot? Don't risk the bootloop?
    Magisk operates via a kernel patch to grant root access. If you flash an unpatched boot image, you lose root, meaning Magisk is unable to load any modules. The only time this would cause a boot loop is if you updated via OTA, then flashed an older boot image; the system would see the mismatch and assume the update failed.
    2
    To save time and effort here is the magisk patched boot.img for June 2022 patch level, Carrier Unlocked 6a from the Google Store. Make SURE you are on build SD2A.220601.003 before flashing! ;)
    As this thread ages, not everyone will have the June 2022 update. That's why I suggested/put the steps in to do it themselves with matching firmware to what their device is on.

    To get the `OEM Unlock` option in Developer Options to work, it's simpler to just manually flash 12.1.0 (SD2A.220601.004, Jun 2022, Verizon, Verizon MVNOs) and then wipe.

    Even though it's label as Verizon, it should work for all carriers.
    This DID NOT work for me. That's why I wrote this up the way I did.

    Hello, if we have already unlocked the bootloader, we just have to do this: start cmd then fastboot flash boot magisk_patched.img then restart the phone?
    If you're bootloader is already unlocked, you just have to flash the patched magisk boot img, correct. I wrote this up for those having issue with not having the ability even if it is an unlocked from google device

    these instructions sound like "the usual process", but for the 6a isn’t there something to patch regarding vbmeta as well?

    (never had a phone that "needed" this, but in my understanding it "should" be necessary with the 6a? won’t have time to try out myself before the weekend, just asking ..)

    Correct, these are basically the usual steps. There's nothing regarding vbmeta flashing in this case of just rooting stock firmware. You only need to do that with ROMs (GSI's mainly)