Running Duplicati from a USB drive

I am needing to run Duplicati strictly from a USB drive. It will be integrating with our MacOS application also on the USB drive (i.e. our application will call Duplicati backup / restore operations via command line). I can move the Duplicati application to the USB drive and install the Mono framework also to the USB drive. When launching Duplicati from the USB drive, it says, “Cannot launch Duplicati, Duplicati requires the Mono Framework version 5.0 or later”. I checked $PATH (i.e. echo $PATH), it had “/Library/Frameworks/Mono.framework/Versions/Current/Commands” (set automatically from the Mono Framework install). I updated the $PATH variable to include “/Volumes/MyUSB/Library/Frameworks/Mono.framework/Versions/Current/Commands”, where MyUSB is the USB drive name. It still comes back with the same message stating it requires the Mono Framework. So, Duplicati still can’t see the Mono framework where both of them are installed on the USB drive with the $PATH variable updated. Any other ideas on how to get Duplicati to see the Mono framework? I looked at plist files and didn’t see anything there.

Welcome to the forum @robhoth

I am not familiar with Mac. How exactly is this done?

What Duplicati version? 2.0.6.1 should use 5.10 or later, but I think the launchers were never updated:

I think which is supposed to use the PATH. At least with bash a change doesn’t need a new export, however you might check to make sure that a subshell on whatever shell you have gets the change.

You can do manual probes per the above, and run mono --version on whatever mono you can get.
The NSLog statements might also make some output you can look at, e.g. perhaps by the following:

How to View the System Log on a Mac

ts678 – thanks for the reply. To answer your questions:

  1. When launching Duplicati from a USB drive >> double clicked on the Duplicati application icon to start the local server, then went to the URL http://localhost:8200/ngax/index.html#/ to access the UI
  2. It is Duplicati 2.0.6.1 using Mono Framework version 6.12.0.122

I’ll download an instance of Duplicati, include the USB path to *probepaths to see if that will do the trick.

How does PATH flow in that situation? I don’t use a Mac, but on Windows one can set up custom system and (at least sometimes) per-user Path variables in advance.of anybody logging in to click to start things.

Setup can, of course, interfere with a truly portable experience if that’s a goal, but you could perhaps use another start procedure, e.g. setting up the PATH somewhere on the way to where the launcher needs it.

Changing the launcher probably also works, except it’s probably more trouble to have a custom Duplicati. The launchers used to be bash scripts, but security in macOS Catalina is (I think) why they’re not now…

As a plug, if you’re skilled with development on Mac, Duplicati team could probably use help covering it…

1 Like

To access a USB drive on the macOS, it’s /Volumes/MyUSB/…, where MyUSB is the name of the drive. I am new to Duplicati and am unfamiliar with setting up a custom system per-user Path variables. Can you supply a link to the documentation on how to do that? That approach sounds easier than doing a one off custom Duplicati launcher on my end.

Once I get up and operational with Duplicati, I can see what I can provide help on.

It’s not done by Duplicati. It’s done by the OS. Example documentation links below. You can also search.

How to Change the PATH Environment Variable on Windows

I find lots of search results about how to change macOS path at login time for your shell, however I don’t know whether that’s enough to change it for things that you click on. A more general solution may be this:

Setting $PATH globally on OSX

If you did that within a single shell, it only affects shell and things it starts. Can you start Duplicati from it?

You can definitely change PATH for shell login. I’m not sure if it helps double-click launches. You can test.

How to Add to the Shell Path in macOS Big Sur and Catalina using Terminal

Oh, I tried this setting the System Path variable to look for the Mono Framework installed on the USB drive - no luck there. Looks like I am forced to modify the code segment mentioned above for my purposes. Any special tips & tricks and/or documentation links to compile the Duplicati solution in Visual Studio?

It probably inherits down as usual, so make sure you log back in, or even safer, start the system again.

Did the NSLog from the launcher do anything? You can try manual which mono, mono --version, etc.

How to build from source and you can search “visual studio” site:duplicati.com to find other discussion.
Possibly the launcher compile.sh can get you a revised launcher without having to build all of Duplicati.

EDIT:

Instead of trying to get the UI, maybe you can also just type duplicati-cli and see if it says anything.

I modified the run-with-mono.m file and was able to successfully compile the code.

I replaced the original launcher files with the modified ones. When re-launching Duplicati, I get the same message. Any ideas on where to go from here. Appreciate your help in advance! BTW, I installed the Mono Framework on the USB drive successfully so it’s there.

image

I’ve given a few. Unknown what’s been tried.

Check the log for NSLog output. If somehow that doesn’t happen, modify launcher with your own logging.

Alternatively try doing what the launcher did:

Run which mono, as the launcher would do.

Run mono --version to see what it reports. Repeat for whatever mono installations launcher might find.

Run ./duplicati-cli from CLI (not by click) to be certain that you started version you think you started.

Going further, and knowing where all your mono are, you can see if the time-last-read (ls -lu) got updated.

You can try starting Duplicati by finding your installation, then doing mono Duplicati.CommandLine.exe
I’m more familiar with the Linux launchers, but it’s basically just a convenience wrapper to run such lines:

exec -a “$APP_NAME” mono “$EXE_FILE” “$@”

copied from /usr/bin/duplicati. For macOS, the retired script-based launcher has a similar line in its code:

How good is your Objective-C? I’ve never used it. It’s possible the version checking code has some issue,
however first I would like to know what version strings your installed mono (are there several?) are saying.

Code below looks maybe wrong, but if the minor version check is wrong, it might be harmless for minor 0.

(my objection is that this looks like the major number can be huge, but a small minor going with it is fatal)

Believe I found out what the issue is with Duplicati not finding the Mono Framework that is installed on the USB drive. There’s a bug with the initial Mono Framework installation process. You can see below in: (1) it lets you select the installation destination, which is where I selected MY MEDKAZ USB drive; (2) says the Mono Framework was successfully installed; and (3) the aliases files should be pointing to /Volumes/MY MEDKAZ/Library/… and not /Library/… For example, Commands alias should be /Volumes/MY MEDKAZ/Library/Frameworks/Mono.framework/Versions/Current/bin and NOT /Library/Frameworks/Mono.framework/Versions/Current/bin which would be my Mac HD. This is why Duplicati can’t find the mono framework with it’s OSX launcher programs. Is this a known bug? Any ideas on workarounds?

  1. Select a Destination for installation
    image

  2. Installation was successful
    image

  3. Commands, Headers, Home, Libraries and Mono are alias files (a.k.a. pointers to where the original installation files exist)

This is not Duplicati’s installer from what I can tell. It looks like Install Mono on macOS, i.e. mono project.
Installing Mono Framework on Mac is a somewhat old video where they skipped over Destination Select.

Bugs is mono project’s information on filing and tracking bugs. I’m not familiar with their use of aliases…

An option is to bundle Mono with Duplicati.

“… will generate a native executable that has no dependencies on Mono being installed on the system and is a native executable.”
https://www.mono-project.com/docs/tools+libraries/tools/mkbundle/

Thanks. That might be a good path for this case, but I’m not sure it’s the easiest method.
@robhoth is certainly welcome to try. At first glance, it looks like do-it-yourself will work.

Publish self-contained is (I think) in the plans for the current .NET 5 port. Mono is kind of outdated at the moment because its job is to be like .NET Framework which is outdated. Microsoft will support it for a long time, but functionality changes ended with 4.8 in 2019.

.NET Framework was very convenient with Windows because it was very likely installed.
I’m not sure if its replacements will be nearly-default too, but it’s still quite early in rollout.

It seems quite simple to make a basic build-script, based on that article.
I’m a software developer so OP may see it differently.

I’m looking forward to .NET 6 with MAUI, that basically will replace most use of Mono in the future.

I’m not sure I’ve heard of MAUI talk, but I’m only loosely following Duplicati planning.
You can look at the couple of pull requests, and there are a lot of single-topic issues.
There has been talking of replacing the current AngularJS UI, but nothing specific…

If you would like to contribute to a port or to bug fixes and features, there’s lots to do.
Duplicati is typically looking for volunteers in all areas. Progress is slow without help.

EDIT:

I found the prior discussion I was thinking of (you commented I see). Anyway, re UIs:

Apologies for getting off-topic, but mono led to .NET 6 led to MAUI led to UI in general.