[Android Software/Hacking General [Developers Only]] ethical_haquer:
EDIT: There is now an alternative way to flash Samsung firmware on Linux that, in my opinion, is a better option: Galaxy Flasher.

Odin 3 running inside VirtualBox on PureOS, a Debian-based Linux distribution:

View attachment 5826273

I found a way to get Odin running on Linux! It uses a virtual machine (VM), but it works better than heimdall for newer devices, and is much better than dual booting Windows just to use Odin. Used it to flash Lineage OS 20 to my Samsung Galaxy A52 4G multiple times. Here are the steps I used to install and use Odin on Linux.

I highly recommend reading through the steps once before following them, especially the "Things to know" and "Solutions to common problems" sections.

Install VirtualBox:

Download VirtualBox for your distribution from virtualbox.org,

Right click on the downloaded file,

Click "Open With",

Click on "Software Install" or something similar,

Install according to onscreen instructions,

NOTE: if you don't have an app like "Software Install", you can either install the downloaded file manually - How to install .deb, How to install a .rpm; or try to install VirtualBox with a package manager such as apt, synaptic, etc. However, VirtualBox may not be included with your distribution and it probably will not be the newest version. In either case, skip the above four steps.

Download the VirtualBox Extension Pack from virtualbox.org,

Right click on the ".vbox-extpack" file you just downloaded,

Click "Open With", and select VirtualBox,

Follow the onscreen instructions to install it.

Create a Windows VM:

Download the correct version (32-bit or 64-bit) of Windows 10 from microsoft.com,

NOTE: If Microsoft gives you an error like: "We are unable to complete your request at this time. Some users, entities and locations are banned from using this service..." when you are using a VPN, then just start the download on a normal network, pause the download, switch to your VPN, and then continue - It worked for me!

Run VirtualBox,

Click "New",

Type "Windows 10" in the "Name" entry,

Select the Windows ISO image you downloaded earlier,

Click "Next",

Enter a username and password, and change the host-name to "Windows",

NOTE: You will need to remember your password, because even though you don't have to enter it every time, you will be required to change it every month, which requires your current password.

Click "Next",

Set the "Base Memory" to 1GB (1024MB) for 32-bit, or 2GB (2048MB) for 64-bit,

Leave the "Processors" at 1,

Click "Next",

Select "Create a Virtual Hard Disk Now",

Set the "Disk Size" to whatever meets your requirements (Just remember that Windows needs 20GB, Samsung firmware needs ~17 GB (You can store it on a USB drive though), and that the virtual drive does take up space on your computer),

Click "Next",

Verify everything is as you expected,

Click "Finish",

Windows should now boot up and start installing itself, once it is done it will do multiple things, and finally boot to the desktop.

Install Odin on the Windows VM:

(The steps in this section are to be done on the VM)

(To make this section easier, open this webpage on the VM)

Download the newest Samsung drivers from developer.samsung.com,

Open the "SAMSUNG_USB_Driver_for_Mobile_Phones.exe" file you downloaded,

Follow the onscreen directions to install the USB drivers,

Download Odin from androidfilehost.com,

Extract "Odin_3.13.1.zip",

Run "Odin3 v3.13.1" found in the newly extracted "Odin_3.13.1" folder,

Odin should run fine, BUT DON'T USE IT FOR YOUR PHONE YET, for now just close it.

Get USB working with the Windows VM:

In the terminal, run the following (this unloads the "cdc_acm" module, which can be re-added by running "insmod cdc_acm"):

sudo rmmod cdc_acm

With the Windows VM powered off, run VirtualBox,

Click "Settings",

Click "USB",

"Enable USB Controller" should be auto-checked, but manually choose either the 2.0 or 3.0 controller (if one isn't already selected), according to your computer's USB ports,

Close VirtualBox,

In the terminal, run the following:

sudo usermod -a -G vboxusers $USER

Log out and log back in (of your computer),

Run VirtualBox,

Click "Settings",

Click "USB",

Plug your phone into your computer while in download mode,

Click on the icon of a USB cable with a plus sign,

Your phone should show up as something like "Samsung SM6150 [021B]",

Click on the box next to where your phone is listed,

Your phone should now show up under "USB Device Filters",

Click "OK",

Unplug your phone,

Exit download mode.

Using Odin on the Windows VM:

Run VirtualBox,

Select "Windows 10",

Click "Start",

(The following steps are to be done on the Windows virtual machine),

Right click on the "Odin3v3.13.1" app you downloaded,

Select "Run as Administrator",

Odin should now recognize your device if you plug it in (be aware that your device will not show up if it's not in the mode it was in when you added it to the USB filters).

Things to know:

To turn the VM off, click on the Windows logo in the bottom right, and then click on the power icon.

To turn the VM on, run VirtualBox, Select the "Windows 10" VM, and click "Start".

VirtualBox uses something called "USB filters" to decide whether the host OS (Linux), or the Windows VM get access to specific devices when they are plugged in, for information on how this works, look here. NOTE: If the VM is off, everything you plug in will open on the host OS, regardless of filters.

If you have files you want to move from your Linux computer to your Windows virtual machine, you can use a thumb drive, to do so add the drive to your USB filters (see above), make sure the VM is off, move the files you want to transfer from the Linux host onto the drive, eject the drive, unplug it, power on the VM, plug the drive back in, Windows should then see the drive, so move the files from the drive to the VM.

Solutions to common problems:

If Odin is unable to see your device after following this tutorial try to unplug as many USB devices as you can from your computer (except your phone) and restart Odin.

If you encounter a "Kernel driver not installed" error when installing VirtualBox, look here.

If Odin gets stuck on "SetupConnection" during a flash, follow these steps.

If you have any problems and/or questions, let me know.

Hope this helps!