How To Root Nexus 7 2013 In Ubuntu Linux

root Nexus 7 2013 in Linux

When I bought Nexus 7, the first thing on my mind was to install Ubuntu touch on it. But to do that, Nexus 7 has to be rooted first. In this article, I’ll show you how to root Nexus 7 2013 in Ubuntu Linux.

This tutorial was performed with a Dell Inspiron running Ubuntu 13.10 and a Nexus 7 2013 running Android Kitkat. I followed the procedure mentioned on XDA Developer Forum, I am just presenting them in more humane format with clear instructions and screenshots so that even beginners can root their Nexus 7 device.

Before we proceed to root Nexus 7 2013 in Linux, lets see what are the prerequisites.

Prerequisite to root Nexus 7 2013 in Linux:

  • A computer running Linux (preferably Ubuntu).
  • Nexus 7 2013 and a USB cable.
  • Internet connection.

Before you proceed with the rooting, I must warn you that this will violate the warranty of your device. Also, if you mess things up (which you should not), I am not responsible in any ways. When you are ready to take the risk, lets see how to root Nexus 7 2013.

Steps to Root Nexus 7 2013 in Linux:

1. Install Android dev tools

You’ll need adb and fastboot Android dev tools. Open a terminal and use the following commands to install it in Ubuntu:

sudo apt-get install android-tools-adb
sudo apt-get install android-tools-fastboot

2. Enable USB debugging option on Nexus 7

Before you connect your Nexus 7 device, you need to enable USB debugging on it. Go to Settings->About Tablet->Build Number. Tap on build number 7 times. This will enable the developer mode on your tab. You can see Developer Options in the Setting menu. Go in it and enable the USB Debugging option.

If you are facing troubles, refer to this screenshot tutorial to enable debugging option in Nexus 7 2013.

3. Unlock the bootloader

This step is sort of optional but if you skip this step, all the device data will be wiped out. This is why I would suggest you to unlock the bootloader. I have written the steps to unclock Nexus 7 bootloader in Linux in details. You can follow the steps there.

4. Download TWRP recovery and CF-Auto Root

TWRP (TeamWin Recovery Project) is a custom recovery ‘tool’. You can download the image from this official link. You’ll see different version of tool, choose the latest one to download.

Download TWRP recovery tool for Nexus 7 2013.

CF-Auto root installs and enable SuperSU on your device while keeping it as close to stock as possible.

Download CF-Auto root tool.

5. Flash TWRP recovery

If you have not already, connect your Nexus 7 2013 to your computer via USB. Now boot in to the bootloader using this command:

adb reboot bootloader

You will see that your Nexus has been rebooted in bootloader and looks like the following:

Unlock Nexus 7 2013 bootloader

Remember where you downloaded the TWRP image? I presume that you know the basic Linux commands and can use the following command with the path of just downloaded file:

sudo fastboot flash recovery ~/Path-to-TWRP.img

6. Go to recovery mode

After flashing the TWRP recovery, from the bootloader, press volume up and down button to shuffle between Start, Reboot and Recovery. These options will be displayed in huge fonts at the top of the device. Press power button to confirm your selection:

Flash TWRP Recovery mode to root Nexus 7 2013 in Linux

7. Confirm rooting

When you enter the TWRP recovery mode, it may greet you with a screen asking for password. Just press Cancel. No need for any password here.

TWRP recovery Nexus 7

On the next screen, out of several options presented, choose Reboot.

Root Nexus 7 2013 in Linux

In the Reboot menu, choose Recovery:

Rooting Nexus 7 2013 in Ubuntu

The next screen will ask you if you want to enable root or not. Since you have followed so far, it means you do :) Confirm enabling the root. Alas! I forgot to take screenshot of this message. I hope you can manage without it.

8. Lastly, root it

And here comes the final step. If you have been successful so far, now is the time to root with SuperSU. Remember the CF-Auto Root file we downloaded? Extract that zip file and enter the extracted directory. You’ll see an image directory here that contains an image file CF-Auto-Root-flo-razor-nexus7.img. Use the following command and point it to the said image:

fastboot boot ~/Path-To-The-Image/CF-Auto-Root-flo-razor-nexus7.img

If everything goes fine, you shall be booted normally in Nexus 7. You will be asked to download an SuperSU or something from Google Play Store. That’s an indication that you have been rooted.

Note: If you mess up somewhere, explore TWRP recovery. In case you are stuck in ‘bootloop’ after unlocking the bootloader or rooting the device and you see four bouncing balls and not able to boot in to the device, go back to recovery mode again. Try options in Advance to reset factory settings or as a lost resort Wipe the data and do a complete clean up. Reboot now and it should be fine.

I hope this guide helps you to root Nexus 7 2013 (Flo) in Ubuntu Linux despite of those poor screenshots taken from my phone camera. Please note that this has been written for Nexus 7 2013 version, if you want to use it on Nexus 7 2012 (grouper), download the TWRP image for older version. Rest of steps will be the same.

If you have any questions, suggestions, feel free to hit the comment box.

  • Eric Johnston

    great tutorial. Worked like a charm on Linux Mint 13

    • http://www.computerandyou.net/ Abhishek Prakash

      Thanks Eric :)

  • Peter Sommer

    I think it would be easier just to “sudo fastboot boot /… .img in step 8..! you have allready installed that tool and the fastboot-linux.sh script is very poorly constructed… Anyway not to the Linux installation??? that was the point or…?

    • http://www.computerandyou.net/ Abhishek Prakash

      Hi Peter,
      Thanks for noticing. Now, when I look at the file, it indeed is not good. And yes, since we have already used the unlock commands and stuff, we don’t need to do it again. I am updating the article.

  • Jan Cernohorsky

    I have followed all steps until 8, but on doing 8 the fastboot program responds with and the Nexus does not root anywhere. On switching on it just shows the colourful 4 ‘bouncing balls’ but seems otherwise inert. How do I get out of this ?
    Help ?

    • http://www.computerandyou.net/ Abhishek Prakash

      Hi,
      The four bouncing balls and it never boots in Nexus, right?
      Using the TWRP, try to format/restore factory settings (it will obviously remove all the data you have, if you can back it up, it will be good).
      Then be a little patience with it. In one of my case, after successful factory reset, it booted after sometimes, without doing anything else.

    • Alex

      I’m stock in the exact same point, same problem. I tried to wipe it, but it says it failed. Now I’m stock at the initial black screen with big Google letters.

      • http://www.computerandyou.net/ Abhishek Prakash

        Did you try Factory reset?

    • Tyler Dinsmoor

      You have to reboot into your bootloader, not recovery.

  • Daniel Martinez

    The question I have is, do I need to root my device in order to unlock the boot loader? More specifically, if I do one (root), do I have to do the other (unlock bootloader)? That seems to be 2 different processes. I want to dual boot Ubuntu Touch and Android.

    • http://www.computerandyou.net/ Abhishek Prakash

      Indeed unlocking the bootloader and rooting are two different processes. No, you don’t need need to be root to unlock bootloader and neither you need to unlock the bootloader before you become root.

      It is, however, advisable to unlock the bootloader before rooting to save the data.

      I have not tried dual booting Ubuntu and Android yet (it is not supported to Nexus 7 2013) but as per the instructions, you don’t need to be root. BUT you MUST unlock the bootloader. And this makes sense because if your bootloader is unlocked, you won’t be able to add another OS in the boot.

      Hope this helps.

      • Daniel Martinez

        Thanks for clarifying this for me. I get it now.

  • Dogora

    Many thanks for this tutorial! I have a couple of suggestions:
    1) since we’re installing adb anyway, backing up everything first is in order: adb backup -f backup-file -apk -shared -all
    That way we can restore everything afterward, since unlocking the bootloader wipes all user data.
    2) before running the last fastboot command in step 8, you need to tell the TWRP tool to reboot into the bootloader. Otherwise, the fastboot command will wait forever.
    Since my current plan was to just get root, and not install a different O/S, backing up the data first was a very good thing, and worked perfectly.
    Otherwise, the process was quite easy and I’m very happy I now have root.

  • bmg442

    Very well presented article. I gave this a stab, and the process is stuck at installing TWRP. I get “could not clear input pipe; result e00002ed” and it just sits there, forever. The device is in the Fastboot screen, with a green droid on it’s back, not red, as some articles discuss. The device is indeed Unlocked at this point. I simply can not get a rooted.img to flash to the gadget. Is openrecovery-twrp-2.6.3.1-flo.img the best file to use for a 4.3 Nexus 7 Wifi/Nakasi?

    • http://www.computerandyou.net/ Abhishek Prakash

      No… openrecovery-twrp-2.6.3.1-flo.img is not suitable for 4.3 Nexus 7 Wifi/Nakasi (2012). This image is for FLO devices (Nexus 7 2013). You should try the grouper images here: http://techerrata.com/browse/twrp2/grouper

      • bmg442

        I flashed it with sudo ./fastboot flash recovery openrecovery-twrp-2.6.3.1-grouper.img, the rebooted by selecting “Recovery Mode”. Any idea how long it should sit on the block and white Google screen? 5 minutes and counting. Obviously judging by my writing this post, I am starting to get a bad feeling on this one.

        I waited a while longer, then attempted to reboot holding down both sets of buttons. It remained blank for quite a while. Eventually, it made another attempt to boot, displaying the Google screen. However, it remains on that screen indefinitely.

        Perhaps the Grouper image was not the correct one to use? It does NOT appear to work, and now I can not use adb or any other tools.

        • http://www.computerandyou.net/ Abhishek Prakash

          Process of rooting is pretty much the same for all different versions of Nexus. Difference lies in the image used. I could not guarantee the image, this is why I stated that this was performed for Nexus 7 2013 WiFi version. I would suggest to check on XDA forum, the best place to get information on it.

  • Joseph Wickremasinghe

    Abhishek – thanks very much for this! Was able to use it succesfully on Mint 13 64-bit. Couple of suggestions though. The USB device id appears to be different between ‘normal’ mode and ‘recovery’ mode, so the adb reboot bootloader command works but then the fastboot command fails with ‘waiting for device’ since it thinks nexus in Recovery Mode is a different device. More info here: http://blog.dantup.com/2012/10/fixing-adb-device-not-found-with-nexus-7-in-recovery-mode/

    Additionally, might be nice to highlight ‘flo’ vs ‘grouper’, and make sure that users check that they have the correct device. I was initially unsure if I needed flo or grouper, and couldn’t easily tell which device I had, but it’s clearly listed on the bootloader screen, Might be a useful thing to have users check to ensure this guide is appropriate for their device.

    Thanks again!

    • http://itsfoss.com/ Abhishek Prakash

      Thanks for your suggestions Joesph. I’ll edit the article with it once I get some time.

  • Mark

    JAN ALEX the last command is not in recovery but after a reboot to bootloader :)

    little fault in the guide.

    • http://itsfoss.com/ Abhishek Prakash

      After recovery it boots back in bootloader. I agree the step is not very clear at this point.