Given that Mac OS X is derived from BSD (Berkeley Systems Distribution) UNIX, I would assume that in some way or another, it would be possible to run command-line OS X programs on Ubuntu. I am really talking about those compiled programs which do not make use of any user interface features (in my case I need to run an executable file conversion tool). The particular tool I'm interested in runs on Mac OS X Mavericks.

If someone knows a way of achieving this, perhaps by recompiling the Linux kernel or installing some system software on Ubuntu, please let me know. I'm running Ubuntu 12.04.2 LTS, but I can also upgrade the system if absolutely necessary.

  • 1
    And what is the "particular tool you're interested in"? – slhck Nov 17 '13 at 21:40
  • Not sure if it makes a difference, but I'm trying to run a tool called "InstallESD.dmg.tool" (which is used to make a .dmg (Apple Disk Image) file bootable. In theory, this is just a file conversion tool and thus needs nothing but I/O to run. However, when I run the file on Ubuntu Linux, I get the following error message: "This tool is supported only on OS X." . Could there be a workaround? – John Sonderson Nov 17 '13 at 21:49
  • I'd encourage you to ask this specific question instead. Like, you want to make a .dmg file bootable from Linux. – slhck Nov 18 '13 at 5:44
  • 2
    FWIW, InstallESD.dmg.tool is simply a shell script, which invokes several programs which may or may not be OSX-specific (hdiutil, pkgutil, PlistBuddy, chflags, and bless stand out; but, there may be others). github.com/ntkme/InstallESD.dmg.tool/blob/master/… – Kent Nov 18 '13 at 7:29

Linux and OS X are two completely different operating systems, just like Linux and BSD, OS X and Windows, Windows and Solaris, etc. Unless you have the source code for the tool you're trying to use, you will not be able to just copy it from OS to OS and expect it to work. While it may need "nothing by I/O" to run (really, aren't all computer programs just "nothing but I/O"?), it was built by a certain compiler against a certain toolchain, and expects certain libraries with certain functions to be in certain places in order for it to work.

Look for the source and attempt to recompile on Linux, or look for a Linux equivalent.

  • Thanks. Seems like there is no easy way to do this. – John Sonderson Nov 18 '13 at 10:03

This probably won't help in your situation, but there are three general ways to move commands between unixes, and a way to cheat which may help.

  1. find one that has already been ported: for example the standard mailx command has been implemented many times. Debian and therefore Umbutu have at least three versions.

  2. recompile/port: if you have access to the source code, it is normally fairly strait forward to recompile on another platform, but sometimes there are some catches (what do you mean select modifies / does not modify its parameters).

  3. binary emulations: this is where you have a binary that was compiled for one operating system running on another this gets complicated when you have dynamic libraries, and requires specific and detailed information such as what does ldd say. you probably want to lean heavily on the forums for your specific emulator. If you want to go this way check out http://darling.dolezel.info/en/Darling

  4. cheat: file sharing and ssh. you need a common location for files available for both computers, nfs samba, ftp, etc. put the file somewhere the mac can read it, use ssh to login to the mac from linux, run the one command, possibly move the results, continue with your day.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.