Odin is the official tool by Samsung to flash its Galaxy line of smartphones and tablets. Unfortunately, the tool is available for Windows only. However, you can still flash your Samsung phone on Linux using Odin on Windows VM via a virtual machine named VirtualBox. Moreover, a recent leak has suggested, that Samsung has officially released Odin for Linux as well. In this tutorial, we’ll see how we can use Odin on Linux to install the stock firmware or TWRP recovery.
It’s true that Heimdall has been there as an Odin alternative for Linux and macOS, but it doesn’t work efficiently with newer LZ4-encrypted Samsung firmware binaries and recent versions of macOS and Linux.
If you are a Linux user and want to use Odin to flash the firmware on your Samsung Galaxy device, you aren’t out of luck. Follow the steps described below to install and set up VirtualBox on various Linux distributions like Oracle, Debian, Ubuntu, Fedora, etc. so that you can run Odin.
Alternatively, you can download the official Samsung Odin v4 1.2.1 for Linux and install firmware on your device using commands.
Install VirtualBox and Create Windows VM on Linux
Before you can create Windows virtual machine, you’ll need to install VirtualBox on your computer.
- Go to VirtualBox and download the package for your specific Linux distribution. Do not forget to verify the SHA256 and MD5 checksums after downloading the file.
- When the installer package is downloaded, right-click on it, and select the Open with > Software Install option. If the Software Install option is not available on your computer, you should try a package manager like Synaptic or APT (Advanced Package Tool) to install it. Here are some commands that you can use to install VirtualBox on Debian, Fedora, RHEL, and CentOS-based Linux distributions.
- Debian-based Linux distributions:
$ sudo apt install virtualbox -y
- Fedora-based Linux distributions:
$ sudo dnf install virtualbox
- RHEL and CentOS-based Linux distributions:
$ sudo yum install virtualbox
- Debian-based Linux distributions:
- If you get the “Kernel driver not installed” error while installing VirtualBox, try the tip given on askubuntu.com
- Now that you have installed VirtualBox, go to Microsoft’s download page and download Windows 10 ISO image.
- Launch VirtualBox and click on New.
- Type Windows 10 in the Name field, select the Windows 10 installer image, and click on Next.
- You’ll be prompted to enter your username and password.
- If you download the 32-bit version of Windows 10, set the RAM Memory Size to 1GB or 1024MB. However, for the 64-bit version, you’ll need to assign at least 2GB or 2048MB.
- Now, click on the Create a virtual hard disk now button.
- On the next screen, choose the VDI (VirtualBox Disk Image) as the hard disk type and click on Next.
- Now, choose the size of the virtual hard disk and click on the Create button. If you propose of settings up the Windows VM on Linux is only to flash Samsung firmware using Odin, you can set the size between 25 to 50GB.
- Now, go to Settings > Storage, click on Empty > CD icon in the Attributes section, and click on Choose a disk file.
- Navigate to the location where you saved the downloaded Windows ISO image and select it.
- Finally, click on Open to initiate the installation of Windows 10 in the VM environment.
- The installation process will take some time and your computer will reboot a couple of times.
Steps to Install and Use Odin Linux via Windows VM
Setting up USB Connection in Windows VM
Follow the steps given below to make your VirtualBox Linux computer recognize your Samsung phone as a USB device.
- Launch VirtualBox, select Windows 10 and click on Start.
- Download the latest Samsung USB drivers for Windows and install the downloaded EXE file.
- Power off the Windows VM.
- Open the Linux Terminal and execute the following Bash command which unloads the ‘cdc_acm’ module. You can later load it by executing
insmod cdc_acmcommand in the Terminal.
sudo rmmod cdc_acm
- Make sure that the Windows VM is turned off and launch VirtualBox.
- Go to Settings > USB > Enable USB Controller, click on it and manually select 2.0 or 3.0 as USB controller.
- Now, close VirtualBox, open the Terminal again, and run the Bash command mentioned below.
sudo usermod -a -G vboxusers $USER
- If you don’t find your Samsung devices listed under USB devices, execute the following command:
sudo gpasswd -a myusername vboxusers
- Now, log out of your computer and log in again.
- Launch VirtualBox and click on Settings > USB.
- It’s time to boot your Samsung phone into the Download or Odin Mode so that you can add it as an authorized USB device.
- Connect your phone to your computer via a USB cable and click on the USB cable icon with a plus sign.
- You should see your Samsung device with its model number. Click on the box which displays your phone’s name. You’ll see your device showing up under USB Device Filters.
- Click on OK, disconnect your phone and hold the Volume down + Power buttons for about 7 seconds to exit the Download Mode.
Using Samsung Odin on Windows VM
Finally, it’s time to reap the profit of the efforts you made so far. You are all set to use the Odin flash tool on your Linux computer via Windows VM.
- Download the latest Samsung Odin and extract the downloaded zip.
- Right-click on Odin3_v3.14.4.exe and select the Run as administrator option.
- Boot your Samsung Galaxy device into the Download Mode and connect it to your computer.
- Download the Samsung firmware for your device.
- Click on the BL, AP, CP, and CSC buttons in Odin and add the appropriate files to them.
- Click on the Start button to install the firmware.
I have already written a detailed tutorial on flashing firmware on Samsung devices using Odin. You should refer to that. If you encounter any errors related to connection and firmware installation, you should check out my article listing the solutions to fix Odin errors.