Complete Beginners Guide To Root Samsung Galaxy S2 In Ubuntu Linux

How to root Samsung Galaxy S2 on Ubuntu

You might think it is a bit late to write on how to root Samsung Galaxy S2 in Ubuntu Linux because its been over 3 years since its release and there are already Samsung Galaxy S3 and S4 in market. But it was only recently when I decided to root my Samsung Galaxy S2 after my contract with SFR was over. At least now I won’t be violating the warranty from the manufacturer as its over 2 years now for my phone.

The other reason why I am writing this article on rooting Android phone is that I did not find any good articles that could teach a beginner to easily root an Android smartphone on Linux. I followed the steps mentioned on XDA forum, but I felt the need of improving the article with clear steps and proper screenshots and hence I came up with this article to show you how to root Samsung Galaxy S2 easily in Ubuntu Linux.

How to root Samsung Galaxy S2 in Ubuntu Linux

The tutorial was performed on Elementary OS Luna and Samsung Galaxy S2 I9100 running on Jelly Beans (Android 4.2.1). But these steps are generic and with a little modification, can be followed on any other Linux distribution and any other Smartphone with any other Android version.


Here are some of the prerequisites to root an Android phone on Ubuntu:

  • A USB data cable to connect your phone to computer
  • A computer running any standard Linux OS with internet connection (to download some files, mentioned later).

The procedure may seem a bit long to you, but trust me, it is not. Its really easy to root your Android phone and it won’t take you more than 10-15 minutes to follow the complete procedure. Steps are detailed so that even a beginner can easily root the phone.

Step 1: Find the Kernel version on your phone

First thing first. You need to find which Kernel version your smartphone is currently running. On your phone, go to Settings-> About phone. Look closely for Build number.

On Android: Settings->About phone-> Build number

Know the Android Kernel version

As you can see in the picture above, the build number for my Samsung Galaxy S2 is I9100XWLSD. Notice the LSD. This is important to download the correct “rooted Kernel” image for your phone.

Suggested read
Learn To Fine Tune Your Linux Systems With Linux Performance Tuning

Step 2: Download the rooted Kernel image

Once you have got the Kernel number, its time to download the rooted Kernel image (thanks to XDA developers). For XWLSD, download Siyah-s2-v6.0b4.tar file.

Download Siyah-s2-v6.0b4.tar

For other Kernel versions, please check on XDA developer forum or search on Google. Its not possible for me to provide the links for each of them.

Step 3: Extract the downloaded Kernel image

Once you have downloaded the tar file, extract it. The extracted file would be zImage. Copy it to your home directory (for simplicity purposes).

Step 4: Download and install Heimdall

Heimdall is a cross platform Open Source tool that is able to flash firmware on Samsung devices. You can download Heimdall form their repository. Reposiory has a number of files for different Linux distributions. Basically, you have to download the command line (heimdall) and front-end (heimdall-frontend) files for your Linux OS.

For Ubuntu and other Debian based distributions, you can see the .deb binaries there. Download and install the one for your Ubuntu version.

Install heimdall in Ubuntu to root your android phone

Alternatively, you can also try to compile the source code.

Step 5: Put your phone in Download mode

Once you have the correct rooted Kernel image and Heimdall installed on your Linux system, its time to start the rooting process. For this purpose, you have to put your phone in “download mode”. Try the following steps:

  • Switch your phone off
  • Hold the power key+volume down+ home key

Download mode for Samsung Galaxy S2

You’ll see a warning message after few seconds on the screen. Press volume up button to continue in “download mode”.

Root Samsung Galaxy S2 on Linux

Once you are in downloaded mode, you shall see a screen like this on your Android phone:

How to Root Samsung Galaxy S2 on Linux

Step 6: Connect the phone to computer

In the download mode, connect your phone to the computer using a USB data cable. To check if it is well detected by your Linux OS, open a terminal (Ctrl+Alt+T) and use the following command:

heimdall detect

This should show you a result like “device detected“:

Suggested read
How To Install Ubuntu Alongside Windows 10

Root Samsung Galaxy with heimdall

Step 7: Flash the Kernel

Now is the time to replace your old Kernel with the rooted one. In the terminal, use the following command:

sudo heimdall flash --KERNEL zImage

It will be a long output. If its a success you will see the following lines at the end of the long message:

Uploading KERNEL
KERNEL upload successful
Ending Session....
Rebooting Device....
Re-attaching kernel driver....


If it was not successful for some reason, you should see the message at the bottom of the log. In the first try, I saw this error message: ERROR: Partition “kernel” does not exist in the specified PIT. When I checked with sudo heimdall print-pit –verbose command, I found that there were several partition on my phone and the Kernel was on partition KERNEL and not kernel (case sensitive, you see).

Your phone will be logged in automatically.

Step 8: Check if your Android phone is rooted

Al right, it was a success for you so far. But how to verify if your phone is rooted? For this download a terminal app on your Android phone. I used Android Terminal Emulator. It is like a Linux terminal in your Android phone. Start the app and write the following command in the terminal and press enter key.


If you are rooted, it will prompt you like this to ask for root access:

super user root access check in android

Once you give the root access, the $su will change in #su. An indicator that you have root access now and it also means that you have successfully rooted your Galaxy S2.

I hope this guide helps you to root your Samsung Galaxy S2 in Linux. Feel free to drop your suggestions, feedback, thanks and questions in the comment box below. Subscribe to the blog for more tutorials. Ciao :)

Add comment

E-mail is already registered on the site. Please use the Login form or enter another.

You entered an incorrect username or password

Sorry that something went wrong, repeat again!


by Newest
by Best by Newest by Oldest

sir, can i install this on galaxy s2 gt i9100g version using ubuntu 16.04

build number ends i9100gddls3

Thanks! I have just followed the instructions for a Galaxy S2 and it worked perfectly. I really appreciate the clarity and usefulness of your post. Suzie

Abhishek Prakash

You are welcome Suzanne :)

Can you please tell me where I can find a rooted kernel for ECLAIR.ZSJH1 according to my Galaxy S (GT-I9000) phone? Baseband is I9000ZSJH1 and current kernel is 2.6.29.

Thank you for this, what is the most clear and simple set of instructions I have found so far for this task.

My situation blocks me from finding the current kernel details and I'm guessing I'm not the only guy on the planet with this issue, so I'll ask for any help you may offer.

My friend took photos and videos until her phone no longer had enough memory to boot. So it is in a boot cycle and can't finish the full boot owing to not enough memory on the phone!

She was not using an external card, so all data was saving on the phone memory.

I am wondering there is any way for me to get access to the /data on this phone to get off the photos and videos? We would like to then do a reset so that they can use it as a backup phone.

One strategy that I have been working on is to "root" the phone, but I don't know how to find the current kernel information without being able to boot up the phone.

Any help will be very welcome as they have many family photos and videos on this phone that they would love to save. This was their only camera for the family for some time and they never backed it up. (I have that set up for them now on their new phone, but it's a bit late for this one.)

Thank you,


This guide was very helpful and really clear. Thanks! Couple of points:
From terminal, "sudo apt-get install heimdall-flash-frontend heimdall-flash" for current Ubuntu (14.xx) works; the heimdall commands from terminal remain the same as in the guide.
If you get a libusb error when you run heimdall, your phone will have the "Downloading" droid stuck on it; just press power button for 15-20 sec until it shuts down. Restart as usual; then follow the above guide but use another USB port on your machine. Battery pull is another way to make the droid disappear, if power button pressing does not work.
Lastly, if like me, you are trying to root your Galaxy S2 just to remove crappy bloatware apps because your phone keeps saying "Insufficient storage" for anything and everything you try to install/update, first try out a fix for deleting old logs: type in "*#9900#" and select the 2nd option of "Delete dumpstate/logcat" followed by last option "Exit". This is what worked in getting my free storage back (more than 1GB freed up!). Rooting was a good thing because it let me uninstall the crapware, but it didn't really free up storage (which was my aim). If this is your only goal, the logcat fix will save you quite a bit of time. It has no other effects than deleting old system error logs and whatnot!

Patrick Marchand

Hello, nice article, though the usb cord came out accidentaly while I was in download mode, (i hadnt actually managed to make heimdall flash work yet) and now the phone is stuck in download mode. It says that the firmware encountered an issue and that I had to select recovery from kies and try again. I tried connecting it in windows and while kies detects it, it doesnt actually connect itself.

When I select initialises in kies tools, I get a message that my device (sgh-t989d) does not support initialization.

Now I'm on ubuntu an checking the usb devices with lsusb and I can see that: Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode)

Any suggestions? :P

I get this: Failed to open file "zImage" what can I do? The file is copied to my desktop.

copy the zimage file into your home folder. as the command you'll be typing picks from home folder by default.

i often use your site, and appreciate the many times your simple and clear explanations have been my saving grace. i have everything needed to root my chinese galaxy ace3, but i can't find a rooted kernel for s7272czcuanh1. i have scoured the chinese internet, without much luck (other than a pay to download site). i can't really access xda reliably for some reason, might be because of the HK protests. even my old and faithful vpn got blocked....

do you know of anywhere else i should look? i feel like i am just screwed with this unrooted, chinese bloatwared to hell decent phone.


Honestly XDA is the first place I look for such things :(

scoured xda, no luck. do you think its possible to use a non matching rooted kernel? and if so, how would i figure out which one?

Felipe Nogueira

Heimdall doenst detect my phone on Ubuntu 14.04...

Try installing it from the ubuntu repository:
sudo apt-get install heimdall-flash-frontend heimdall-flash
It worked perfectly in my 14.04

MY Build Number is showing I9100XWLST. What Should I do. Do i need to follow this or not???

Hi Abhiskek, i tried this .. the kernel uploaded successfully but it got stuck on the boot screen with the samsung logo and model number. Please help me !!!

thank you so much! very helpful and clear" and easy!

i've no luck:( my phone is dead... it wont boot up and i can't get it in download mode..:( can someone help me??

Fascinating... simply baffled!


Welcome :)

I did this and got no luck! My phone is dead. I can get it in downloadmode but when I repet the procedure I get no booting!


What procedure? A little detail please.

Load more