News for hackers. Stuff that matters.
Re:Simulate an Ubuntu-like VM inside macOS by sgarland on Monday January 15, 2024 @09:54PM (#39008861)
From TFA, the author mentions things like `date` having different args on Mac (BSD utils) and Linux (GNU utils). While true, you can just install GNU utils on a Mac, and get access to all of those, prefixed by g (e.g. GNU sed is launched with gsed).

Linuxify [0] is a decent shell script that does all of this for you.

[0]: https://github.com/darksonic37/linuxify

Re:Simulate an Ubuntu-like VM inside macOS by rswail on Tuesday January 16, 2024 @12:03AM (#39009714)
If you use Macports (much more consistent than homebrew and much more attentive to the way MacOS works and MacOS SIP etc works) then installing the GNU utils ports gives you a standard GNU environment, so pretty close to Ubuntu/Fedora etc.

Of course, networking etc and DNS and other system services will be the native MacOS, but MacOS is a Unix. It has its own init with launchtl and DNS/mDNS with scutil and mDNSResponder.

Re:Simulate an Ubuntu-like VM inside macOS by mook on Monday January 15, 2024 @11:18PM (#39009440)
If you already use homebrew, that works too: https://github.com/Homebrew/homebrew-core/blob/3ef7d3e13549b...
Re:Simulate an Ubuntu-like VM inside macOS by k_roy on Monday January 15, 2024 @11:16PM (#39009434)
You can also do the same thing just with homebrew. I regularly replace a number of CLI utils because the BSD alternatives often have silly defaults/incompatible changes

No gsed, just sed.

Re:Simulate an Ubuntu-like VM inside macOS by sgarland on Tuesday January 16, 2024 @07:47AM (#39012698)
Yeah, the script is just calling brew install over a list anyway.

I also outright replace sed and awk with their GNU equivalents. Better options and behavior, IMO. The only downside is if you have to share a script with someone, and then have to figure out how to make it work with stock.

Re:Simulate an Ubuntu-like VM inside macOS by yashodhanmohan on Tuesday January 16, 2024 @03:39AM (#39010906)
Yep, used to use linuxify a few years back. But then it used to mess with my internal scripts. Anyhow, this was just a "what-if" exercise. Plus, Ubuntu was a test OS, but CentOS/RHEL were real PITA on client systems and this gives me a quick way out from spinning up a VM while still maintaining control. But agreed, if I just wanted GNU utils, I'd have just gone ahead with linuxify.