• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

Running RadioDJ on Mac via Wine/Crossover - a step nearer?

Started by DavidEsp, October 17, 2022, 04:44:36 PM

DavidEsp

Regarding running RadioDJ on macOS...
I already succeeded in running it in a Parallels virtual machine containing Windows-10, on my mac...
...but I wondered if it could also be run within a Wine/Crossover "Bottle" (windows emulator) - riskier but with a smaller footprint, not having to load the whole W10 OS - maybe useful for doing experiments.

I did manage to get RadioDJ itself running that way, but getting it to connect to the database is beyond my understanding.  Ideally I'd like to connect to my existing MariaDB running on macOS.  I guess that would be like remote networking to that database as if it was on another computer.  But I know nothing about such things (and could waste enormous amounts of time by uninformed experimenting / "flailing about in the dark").

Meanwhile, I asked Codeweavers if they could officially support RadioDJ.
Looks like they are asking who else wants this, presumably also to do testing.
https://www.codeweavers.com/compatibility/crossover/radio-dj
So if anyone else is interested, why not register that interest with them?

DJ Garybaldy

AFAIK RadioDJ will not natively work on WINE I tested in January this year and couldn't get WINE to install the .NET patches required.

The best way is the method you're already using I had a virtual machine with RadioDJ at least 7 years ago and it ran on that OK
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

DavidEsp

On macOS Catalina (10.15.7), I just now updated Crossover (to V22.0.1) and installed the latest RadioDJ version (RadioDJ v2.0.3.9) into a Windows10 Bottle.  For anyone not familiar, a Crossover "Bottle" is broadly like a virtual machine (it is technically an "emulation environment").

First, into the Bottle, I installed RadioDJ.  At this stage it would not run (I attempted it but it quit after a couple of seconds).  But stay with it... From earlier correspondence with CodeWeavers (developers of Crossover) I gathered I needed to install Microsoft's .NET into the Bottle (same way as any Windows application).

So next, I tried to install what seems to be Microsoft's latest recommended version of .NET, namely windowsdesktop-runtime-6.0.10-win-x64.exe, the "Run Desktop Apps" variant from https://dotnet.microsoft.com/en-us/download/dotnet/6.0/runtime. Not sure it really installed - I think it "completed" merely by quitting (and not telling me).

However the following alternative approach did work - I instead used Crossover (Bottle-RightClick) to "Install a Windows Application", then selected the (Crossover-) Listed Application version of .NET, namely 4.8 (which Crossover users had given a "5 Stars" rating) into the bottle. This worked better - there were some installation issues but I skipped those, apparently without issue. One error message complained that I already had some dependencies (.NET v2) installed - maybe that's what led to the previous error messages?.  Regardless, finally I got the magic confirmer-prompt: ".NET Framework 4.8 has been installed", following which, as instructed by a prompt, I restarted the "machine" (i.e. the relevant Bottle).

Having got this far, I (of course) again tried running RadioDJ (in that Bottle).  And this time it did not quit!

First I got this (familiar, when there is no mysql-type database server running) PluginInterface error-prompt:
QuoteDatabase Check Error: Authentication to host '127.0.0.1' for user 'root' method 'mysql_native_password' failed with message: Access denied for user 'root'@'localhost'

Then, immediately afterwards (on clicking that prompt's OK button)...
A DatabaseError prompt appeared:
QuotePlease check if the server is running and if the database is installed correctly.
Also check if the user/password/server address are correct.
Do you want to run Database Setup to check these details?

No point in checking any of that since I knew I had not (yet) got the required database running.
I think the reason it asked me if I wanted that, rather than doing it "automatically", was because I may have (can't fully remember) un-checked the option to do so (at some earlier point).

EDIT: No point, but I clicked OK anyway, and indeed RadioDJ's Database Setup Utility popped up:
QuoteMySQL Server seels to be offline!

Anyhow, the point is, RadioDJ installation got that far at least.

Next I'd like to get RadioDJ to "talk" to my mac-based MariaDB - I don't want to have to make a fresh one in the Bottle.
This is where I get out of my (limited) depth...
I'm guessing that at the very least the IP address for any app in the Bottle to talk to any service/server on the (host) macOS system will not be '127.0.0.1'.  I suppose it might need to be the MAC (in IP sense) address of the host machine running macOS (a macbook).  But this is an area where I could waste loads of time guessing and experimenting - like a "Sorcerer's Apprentice".

In summary: I think this is broadly where I got to a year or two ago, when I last tried to take up this challenge.  But I needed to demonstrate/confirm to myself (and yourselves) that this much at least was achievable right now.

Any advice on how to get RadioDJ (or any app) to talk to "a MariaDB on another machine" in general, or of course outside its Crossover/WINE Bottle, would be appreciated.

DavidEsp

I just now voted on the Codeweavers site for RadioDJ to be officially supported.
The more votes the better... (hint)

worldradioman

In your /etc/mysql/mariadb.conf.d/ directory (or whatever the Mac Host folder is... it should be close) the file 50-server.cnf has to have a line changed.  You'll see  bind-address = 127.0.0.1 
Put a hashtag in front of that and on a new line put in bind-address =  the ip of the host.  Using your internal network ip lets anyone on your network with credentials log in.  You need SSH tunnels or the equivalent for external network access. You'll need to restart mariadb.

One issue I've found -- and I don't know how analagous this is to the bottle framework --  is the character set the .Net framework expects vs what MariaDB expects, giving you host/guest character set differences and communication errors.  I learned the hard way not to consider the various ways of backing up equivalent.  (Heidi, phpmyadmin, RadioDJ's)  The RadioDJ backup uses the Mysql.NET system, and by definition the expected character set.  The other two are far more gregarious.  I'm still not 100% on the collation interface.  Don't use your host machine's database backup machine to restore the Win10 database.
Bee-Link N-100 (Intel Alder Lake)
Ubuntu 23.10  with Win11 VirtualBox Guest
System 16GB, VM gets 6GB

DavidEsp

Thank  you WRM, exactly the kind of obscure details I could never have imagined
I have no familiarity with "SSH tunnels",
but I (just now) read that: "SSH tunnels allow connections made to a local port (that is, to a port on your own desktop) to be forwarded to a remote machine via a secure channel."

In an attempt to locate the mariadb.conf.d directory:
I first looked in /etc but there was no mysql directory in there

Then, in an attempt to find mariadb.conf.d I ran:
find / -name 'mariadb*' 2>/dev/null
But it appeared not to locate it - just myriad python and Homebrew-related items
(It was via Homebrew that I had installed the macOS version of MariaDB - about a year ago)

Clutching at straws, I briefly wondered if the following were contenders - but both turned out to be binary:
/usr/local/Cellar/mariadb@10.4/10.4.22_1/bin/mariadb_config
/System/Volumes/Data/usr/local/Cellar/mariadb@10.4/10.4.22_1/bin/mariadb_config

I will look for it again tomorrow

DavidEsp

Ok I believe I have found the required file to modify.
Finding it was not straightforward, as its name and location on my system differ from your suggestion.

For posterity, even if only for myself, this is what I did to find it.  Skip down to <END-LOG> if not interested.

<START-LOG>
The following did not find it.
sudo find / -name 'mariadb.conf.d' 2>/dev/null
Perhaps the name is different in this version of MariaDB?
Or the macOS version?

On a different tack, checking out the /etc directory
ls -l etc
lrwxr-xr-x@ 1 root  admin  11 17 Oct  2019 etc -> private/etc


Ok so /etc is just an alias, to /private/etc
However it does not contain any *mysql* (or *maria*)

Websearch-time - Google:[mysql config file macos catalina]
It seems that others have been similarly confused:
https://stackoverflow.com/questions/62102008/where-is-my-cnf-or-mysql-conf-on-mac-os-catalina
One advice is to try cd /usr/local/etc/
<END-LOG>

What I found in /usr/local/etc/:

ls -F
bash_completion@ groonga/ my.cnf profile.d/
bash_completion.d/ init.d/ my.cnf.d/ unbound/
ca-certificates/ logrotate.d/ my.cnf.default output_file.csv
fonts/ mecabrc openssl@1.1/
gnutls/ mpv/ pkcs11/


So no mysql directory lives in there.

Continuing...

Directory my.cnf.d contains nothing useful

However the file my.cnf.default contains the following lines:
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1


Similarly for 'mariadb'
mariadb --help
mariadb  Ver 15.1 Distrib 10.4.22-MariaDB, for osx10.15 (x86_64) using readline 5.1
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Usage: mariadb [OPTIONS] [database]
Default options are read from the following files in the given order:
/usr/local/etc/my.cnf ~/.my.cnf


Bingo! (I assume).  So this is where Homebrew puts (and how it names) that file on a macOS Catalina system.

DavidEsp

I see your next step is:

  • Put a hashtag in front of that and on a new line put in bind-address =  the ip of the host.
Ok that's easy enough.

Just to be certain about your next step:

  • You need SSH tunnels or the equivalent for external network access.
Like:

  • By "external" I think you mean "external to my local network" (as opposed to "external to the Bottle")
  • To get SSH Tunnels available/working, do I need to install or enable something?  Do I need to run some terminal command?
Aha - I see it explained at the following how to get SSH Tunnels working for macOS (of some version) along with other OS's: https://www.concordia.ca/ginacody/aits/support/faq/ssh-tunnel.html#:~:text=SSH%20tunneling%2C%20or%20SSH%20port,machine%20via%20a%20secure%20channel.

Regardless, any corrections (if I have mistaken anything) would be most welcome at this point.

DavidEsp

Ok now I know there was a simpler and more effective way to find that file:
mysql --help
It returned:
Default options are read from the following files in the given order:
/usr/local/etc/my.cnf ~/.my.cnf


I will (initially at least) stick with the plan to edit the "/usr/local/etc/" version of "my.cnf"
(I might experiment with the overriding home-directory ("~") version of it later on)

"Learning all the time" (B.Hill)

DavidEsp

Incidentally, I also did the following (and modified my earlier reply to reflect that).  Seems it uses the same ".cnf" files as mysql.
mariadb --help
mariadb  Ver 15.1 Distrib 10.4.22-MariaDB, for osx10.15 (x86_64) using readline 5.1
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Usage: mariadb [OPTIONS] [database]

Default options are read from the following files in the given order:
/usr/local/etc/my.cnf ~/.my.cnf

DavidEsp

But no - that "my.cnf" did not include the required "bind" line
So my search continues...

I see others on the web are similarly disorientated
Possibly when Homebrew is used to install MariaDB/MySQL then it puts it in a different place?
One user wondered if it was in one of Homebrew's (local machine) "Cellars"

I wander further in this foreign land...
(A song by Paul Simon comes to mind)