Here is how to clone your apps on openSUSE Linux
Tags: productivity, tutorial
Published: 2023-10-24 10:30:06

Ever wonder how to use the same app with different profiles/settings on Linux? Of course, one can create a new user profile, then download and install the same app, as **[suggested by Exodus](https://www.exodus.com/support/article/54-can-i-create-multiple-wallets-on-the-same-computer)** for example. But there's some downsides to this method: 

1. We have to download the same app again, and when there's a new update of the said app, we will have to update every instance of the app separately every time (if you haven't installed the app in the root directory). 
2. We won't be able to use all of the app instances simultaneously.
3. Creating and switching to a new user profile just for a few apps is clunky.

On Android, we have **[Island](https://github.com/oasisfeng/island)** or **[Shelter](https://gitea.angry.im/PeterCxy/Shelter)**, and we can expect that **[Android 14 will come with this feature by default](https://www.xda-developers.com/android-14-app-cloning/)**. On Linux, we have **[Distrobox](https://github.com/89luca89/distrobox)**! It lets us run a Linux container using specific Linux distro images, at full speed!

> Most of the apps will run inside Distrobox just fine. But some apps might not run inside Distrobox at all, **[Cloudflare WARP](https://developers.cloudflare.com/warp-client/get-started/linux/)** for example. However, from my experience, any Electron app works just fine inside Distrobox.

---

## Let's clone our apps with Distoxbox!

![A Girl's reading](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y335gn38u1a402rob90l.jpg)

1. Install Distrobox in the system by running `sudo zypper install distrobox` in the terminal. You can also install Distrobox using **YaST Software Management** app.

2. After the installation, we will create an openSUSE Tumbleweed container to run our clone app. In this walkthrough, I will clone **[Exodus](https://www.exodus.com/)**, a multi-cryptocurrency wallet app, as an example. Therefore, I will create a container called `exodus-wallet2`. And our home directory for this container will be `home-exodus-wallet2` in our `home` directory since we want to separate the app profile inside the container from the one that's already installed in our system:

     ```
     distrobox create -i registry.opensuse.org/opensuse/tumbleweed:latest -n exodus-wallet2 --home ~/home-exodus-wallet2
     ```
     &nbsp;
     - `distrobox create` is the command to create a Distrobox container. 
     - `-i` option is for specify the Linux distro image we want to use in the container. The full list of containers distros can be found **[here](https://github.com/89luca89/distrobox/blob/main/docs/compatibility.md#containers-distros)**.
     - `-n` option is there to specify our container name.
     - `--home` option is very important, as it's where our container app profile/configurations will be saved to. Otherwise, the container will use the same app profile as our original installed app. It won't be a clone without this option.
     
     The full list of Distrobox commands and usage examples can be found **[here](https://github.com/89luca89/distrobox)**.
     
     > Please don't name the container as `exodus`. Otherwise, the container will create a desktop file called `exodus.desktop` which will replace your original app's desktop file (you will have to create a desktop file for your original app again).
     
     &nbsp;
3. After the container creation process, we should be prompted to enter the container by running `distrobox enter exodus-wallet2`. It will set things up for a moment.

4. Here are all the dependencies necessary for Exodus to run inside the container, run this command inside the container:

     ```
     sudo zypper install glib2-devel mozilla-nss at-spi2-core-devel cups-devel gtk3-devel lunar-calendar-gtk3-module libcanberra-gtk3-module
     ```
     &nbsp;
     > Unfortunately, there's a 💀 dependency hell issue 💀 when using Distrobox. It's our usual workflow in Distrobox that we run any app the first time, then the app would complain about dependencies missing. We find those missing dependencies on **[pkgs.org](https://pkgs.org/)**, then install the responsible packages inside the container, since the packages that we have installed in the system are not used together with the packages inside the container. I hope the dependency hell issue will be fixed in the future.
     &nbsp;
     > However, all these dependencies will be deduplicated when we create a new container and need to use the same dependencies again. Therefore, even if we clone 10 instances of our app, those dependencies won't take our disk space at all. We can check the container disk space usage by running `docker system df -v` outside the container.
     
     &nbsp;
5. Now, we can try running Exodus inside a container. My Exodus app is at `/home/archerallstars/Exodus/Exodus` (this has to be an absolute path, i.e. The path you get when you right-click and copy a file), so I run it inside the container by running `/home/archerallstars/Exodus/Exodus`, just like that. The app should run without any issue and using a new profile at `~/home-exodus-wallet2`.

6. For our convenience, we will create a desktop file called `exodus-wallet2.desktop` at `~/home-exodus-wallet2/.local/share/applications` directory. This has to be done on our system outside the container. Here's my desktop file content:

     ```
     #!/usr/bin/env xdg-open
     [Desktop Entry]
     Type=Application
     Name=Exodus
     Comment=Secure, manage, and trade blockchain assets.
     Exec=/home/archerallstars/Exodus/Exodus
     Terminal=false
     MimeType=x-scheme-handler/exodus;
     Categories=Utility;Network;Finance;
     Encoding=UTF-8
     ```
     &nbsp;
     > Most apps, including Exodus, will come with their desktop file that's inside the app's installation folder. Just copy and rename it like I do, then change the content of the desktop file easily by using **[MenuLibre](https://github.com/bluesabre/menulibre)** 😂
     &nbsp;
     If the app is packaged in AppImage format, you can extract its contents to get a desktop file by running the app with `--appimage-extract` option, see more **[here](https://docs.appimage.org/user-guide/run-appimages.html#extract-the-contents-of-an-appimage)**.
     
     &nbsp;
7. After step 6, export our app in the container to be used on outside the container (so, we don't have to `distrobox enter` in the terminal every time we want to run the app) by running `distrobox-export --app Exodus` inside the container. We should see the app's icon in our system.
     
8. We need to add `distrobox enter exodus-wallet2` in front of the app's launching command like this: 

     ```
     distrobox enter exodus-wallet2 -- /home/archerallstars/Exodus-linux-x64/Exodus
     ```
     &nbsp;

After all the steps above, we should have the app cloned and ready to use just like other apps in our system.

---

I hope this helps, bye 💨

---

**Cover** Photo by **[Chan](https://unsplash.com/@chanportofolio?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)** on **[Unsplash](https://unsplash.com/photos/two-women-talking-each-other-tw7btb8vfrk?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)**

**A Girl's reading** Photo by **[Jamakassi](https://unsplash.com/@jamakassi?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)** on **[Unsplash](https://unsplash.com/photos/person-holding-elvis-presley-vinyl-sleeve-wejxKZ-9IZg?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)**