Community discussions

MikroTik App
 
uberwebguru
Member Candidate
Member Candidate
Topic Author
Posts: 173
Joined: Sat Feb 26, 2022 12:05 pm

Winbox on Mac with Bash shell?

Sun Mar 13, 2022 3:34 am

Can we install winbox on mac but using bash (instead of zsh)?
This video mentioned we must use zsh shell

https://www.youtube.com/watch?v=FXhT2QGxgp0
 
User avatar
tangent
Forum Guru
Forum Guru
Posts: 1661
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: Winbox on Mac with Bash shell?

Sun Mar 13, 2022 7:47 am

The only reason that video insists on the shell change is that they then proceed to give a single method for setting the necessary environment variables. If you wish to stick with the outdated Bash 3 that Apple still ships, you merely have to put the same commands into that shell's equivalent startup script, ~/.bash_profile.

The PATH adjustment is needed only if you're using the GUI Wine installer they show. If you install "wine-stable" via Homebrew instead, it'll be in your PATH without any extra help.

I don't know why they recommend the Freetype interpreter adjustment. I run without, and it seems to work fine.

The dyld stuff also seems unnecessary if you install Wine via Homebrew.

Three strikes, yer out: I don't have any of those lines in my zshrc, my zprofile, or my bash_profile. That's the answer to your question, then: the shell has almost nothing to do with how or whether you can run Winbox on a Mac.

I use this script to run Winbox from the command line:

#!/bin/bash
wine64 $(dirname $(greadlink -f "$0"))/winbox64.exe "$@"

I put it into my ~/bin directory alongside winbox64.exe. Relaunch the shell and that directory will be put into your PATH if it wasn't there before.

As you can see, it needs greadlink to be installed, which I believe is part of the coreutils package, so you'll need that as well as wine-stable.

This also saves you from the ugliness of putting Windows executables into /Applications. 🤮
 
uberwebguru
Member Candidate
Member Candidate
Topic Author
Posts: 173
Joined: Sat Feb 26, 2022 12:05 pm

Re: Winbox on Mac with Bash shell?

Sun Mar 13, 2022 5:00 pm

You are right
i installed wine via homebrew and downloaded winbox64.exe in Applications folder
and boom started winbox like so
wine64 "/Applications/winbox64.exe"
only issue is i have to keep the command session open while am using the winbox
if i terminate from that command, winbox closes

how can one keep winbox running continuously in the background?
 
User avatar
tangent
Forum Guru
Forum Guru
Posts: 1661
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: Winbox on Mac with Bash shell?

Mon Mar 14, 2022 2:18 am

how can one keep winbox running continuously in the background?

"winbox &"

This is not the best place to learn how to use a Unix shell.
 
uberwebguru
Member Candidate
Member Candidate
Topic Author
Posts: 173
Joined: Sat Feb 26, 2022 12:05 pm

Re: Winbox on Mac with Bash shell?

Tue Mar 15, 2022 3:05 am

Image

I get this when i run the command
/usr/local/bin/wine64 "/Applications/winbox64.exe"
Issue now is, first time i installed winbox on my mac, everything worked great, i was able to connect tot he router and switches on my GNS3 project
but now when i try to login, i am not able to
it is able to find the router but it keeps giving this error
ERROR: RoMON Agent not found. Add it to Managed List
but RoMON is already enabled as i am able to login from a Windows 10 machine and i also logged in before on the mac

Anyone know what i need to do to make winbox on Mac able to connect again?
 
uberwebguru
Member Candidate
Member Candidate
Topic Author
Posts: 173
Joined: Sat Feb 26, 2022 12:05 pm

Re: Winbox on Mac with Bash shell?

Tue Mar 15, 2022 3:16 am

Ok solved second part of winbox not working on mac again
followed this video

https://www.youtube.com/watch?v=UZcOKYVNup4




Anyone know how i can permanently trust opening this file without the popup?
Image
 
User avatar
tangent
Forum Guru
Forum Guru
Posts: 1661
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: Winbox on Mac with Bash shell?

Tue Mar 15, 2022 4:27 am

Anyone know how i can permanently trust opening this file without the popup?

Once again, you've asked something that has nothing to do with this forum's topic. You've simply broadened it to "how do I use macOS" now.

We're happy to help you with MikroTik hardware, RouterOS, and so forth, but take the other topics somewhere else, please.
 
uberwebguru
Member Candidate
Member Candidate
Topic Author
Posts: 173
Joined: Sat Feb 26, 2022 12:05 pm

Re: Winbox on Mac with Bash shell?

Tue Mar 15, 2022 7:18 am

Anyone know how i can permanently trust opening this file without the popup?

Once again, you've asked something that has nothing to do with this forum's topic. You've simply broadened it to "how do I use macOS" now.

We're happy to help you with MikroTik hardware, RouterOS, and so forth, but take the other topics somewhere else, please.
A bit too aggressive here
You can be a bit less aggressive with approach
This is issue with using winbox on mac, others are using winbox for mac here
so possible that someone faced same issue as me and might be willing to share what worked for them
It is ok if you don't feel like helping in cases like these, but no need to take over what questions should be asked
 
User avatar
tangent
Forum Guru
Forum Guru
Posts: 1661
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: Winbox on Mac with Bash shell?

Tue Mar 15, 2022 11:40 am

You can be a bit less aggressive with approach

It was an escalation after seeing two prior hints go unheeded, then you posting obnoxious double-size screenshots twice.

Side issue 1: Downscale screenshots taken on Retina systems by 2x before posting to the web to avoid this scaling problem. The macOS way of doing that is via Preview: Tools → Adjust Size, then say either 50% or change the resolution to something more like 72 ppi.

Side issue 2: Don't post the same question (or in this case, screen shot) twice in rapid succession. It's not only pointless, it comes across as needy, desperate, or demanding. Remember that we are here offering free support, using our free time for your benefit.

Now to the disregarded hints.

The first was in the video you originally posted, which covered the topic starting about 6:09 in.

The second was in the post giving the "winbox &" hint, which implicitly suggested that one wishing to style oneself an "über web guru" should try a web search before posting, in case it's a very common topic with a generic answer, as in this case. I get tens of thousands of results for the phrase "developer cannot be verified" from a wide variety of web sites, because it affects every unsigned app on each of the last several versions of macOS. There's not a thing specific to Winbox about the problem you're running into, nor is its solution specific to anything in the MikroTik universe.

you don't feel like helping

Did you not find the link I gave in the prior post helpful, or did you not try what it suggested?

It says essentially the same thing as the bit at the end of the MikroTik video, meaning you've been given the answer twice and still missed it. Since you like screenshots, here's a third attempt:
Screen-Shot-2022-03-15-at-3.51.26-AM.jpg
no need to take over what questions should be asked

While you are right that I have no authority to tell you what you can ask, where, as an Internet citizen offering their free time to provide technical support, I do feel I have the moral right and responsibility to propound basic standards of behavior. Posting off-topic questions goes against precepts established back in the earliest online communication forums. This, too, is not unique to MikroTik hardware or to RouterOS.
You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12589
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Winbox on Mac with Bash shell?

Tue Mar 15, 2022 12:22 pm

tangent: bravo
 
uberwebguru
Member Candidate
Member Candidate
Topic Author
Posts: 173
Joined: Sat Feb 26, 2022 12:05 pm

Re: Winbox on Mac with Bash shell?

Fri Mar 18, 2022 9:39 pm

Side issue 1: Downscale screenshots taken on Retina systems by 2x before posting to the web to avoid this scaling problem. The macOS way of doing that is via Preview: Tools → Adjust Size, then say either 50% or change the resolution to something more like 72 ppi.
one your screenshot you posted is big as well, i was not aware the size of screenshot was intimidating. Mikrotik company that owns forum has not complained to me yet that a few screenshots i have ever posted on forum is causing issues.
And yes, it is free forum, which means help "whenever" you can

Anyways we can move past that.

I did not get the prompt or see "Allow Anyway" which was why i asked in the forum, if anyone has come across similar issue
Also i did not follow exactly what video did, so video was not relevant to me much, i had slightly different setup than video
I am not a noob with computers, I have also checked to see if i could allow anyway, but its not there

I suspect many people installed winbox on mac, and could have happened to them also and maybe someone else found a solution
that was purpose of posting, maybe some times let others chip in to help
especially if you feel you can't help any further, many other people on forum also


P.S i can not upload image from computer to this forum, i can only add image URL from external website e.g imgur
and i don't know how to scale down imgur images

Image
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4372
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Winbox on Mac with Bash shell?

Fri Mar 18, 2022 11:33 pm

The MacOS feature is a called Gatekeeper, it's enforced even on Wine apps like winbox.exe.

You should be able to use the Finder, control-click winbox.exe, then "Open", or at least try to. The should trigger gatekeeper, with an an actual "Open Anyway" button. You just need to do this once to remove the "gatekeeper flag" on the app, then it will work from the command line. See Apple KB "Safely open apps on your Mac", specifically a footnote at the bottom:
* If you're prompted to open the app in Finder and you're sure you want to open it despite the warning, you can control-click the app, choose Open from the menu, and then click Open in the dialog that appears. Enter your admin name and password to open the app.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4372
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Winbox on Mac with Bash shell?

Sat Mar 19, 2022 12:00 am

I'll note that it might be easier to use the `brew` package manager on a Mac, along with with the winbox-mac "cask", nrlquaker/winbox-mac which packages up both winbox.exe and wine into an application. You'd still have to do same trick to allow the application as noted in KB above.

Brew can be installed using Mac OS X Terminal using a single command from here: See https://brew.sh but it's
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

And, once `brew` is installed, winbox-mac can be installed using:
brew install --cask nrlquaker-winbox


The reason I suggest the method since you mention you'd wanted pass args to winbox. Since winbox-mac get packages as native app (even though it really still wine+winbox.exe), Apple's CLI command, OS X's "open" will work to provide arguments to winbox-mac app installed by `brew` :
open /Applications/Winbox-mac.app --args ip login password
 
uberwebguru
Member Candidate
Member Candidate
Topic Author
Posts: 173
Joined: Sat Feb 26, 2022 12:05 pm

Re: Winbox on Mac with Bash shell?

Sat Mar 19, 2022 10:54 am

@Amm0 With the method above, I will be unable to specify the exact winbox version i want to use
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4372
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Winbox on Mac with Bash shell?

Sat Mar 19, 2022 2:34 pm

@Amm0 With the method above, I will be unable to specify the exact winbox version i want to use
Nevermind. Just a suggestion, since I actually like that "brew upgrade" get me the latest winbox and the wine stuff is automatic/included.

Clearly you have unique problems. Gatekeeper is needed but annoying & not hard to fix. zsh is the default shell in any recent Mac OS, so unclear why bash is important if you don't know ~/.bash_profile. And, why someone would want/need to run an old version of winbox is beyond me (e.g. a new version of winbox can connect to older version of RouterOS). And the primary source isn't the docs, it's YouTube. Bash'ing head.
 
uberwebguru
Member Candidate
Member Candidate
Topic Author
Posts: 173
Joined: Sat Feb 26, 2022 12:05 pm

Re: Winbox on Mac with Bash shell?

Sat Mar 19, 2022 5:17 pm

@Amm0 With the method above, I will be unable to specify the exact winbox version i want to use
Nevermind. Just a suggestion, since I actually like that "brew upgrade" get me the latest winbox and the wine stuff is automatic/included.

Clearly you have unique problems. Gatekeeper is needed but annoying & not hard to fix. zsh is the default shell in any recent Mac OS, so unclear why bash is important if you don't know ~/.bash_profile. And, why someone would want/need to run an old version of winbox is beyond me (e.g. a new version of winbox can connect to older version of RouterOS). And the primary source isn't the docs, it's YouTube. Bash'ing head.
I have unique problems? lol
I will continue to use the setup i have
I just click cancel and it works

Your method, am not sure how to start the app..when i click the app, nothing happens
i have to run this command?
open /Applications/Winbox-mac.app --args ip login password
how is this convenient? i need to add username and password?

right now i run just type "winbox" from how have mine setup and it spins up winbox..i can install any version of winbox i want....it is all about having options and flexibility
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4372
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Winbox on Mac with Bash shell?

Sat Mar 19, 2022 5:37 pm


I have unique problems? lol
I will continue to use the setup i have
I just click cancel and it works
Omyzsh, I wasn't trying to pick a fight :). And the use case of needing specifically bash and wine+winbox is part that's unique. More a general suggestion IF you didn't like getting prompted... since posted numerous screenshots of generally understood Mac security feature.

Using an bash or zsh "alias" to either an "open" or "wine64 .../winbox.exe" would also be an approach too. Since you are going through a shell script, that might also need to be marked as "safe" by gatekeeper, while "open" would follow the permissions of what's being open'ed (i.e. the brew cask version of winbox). Anyway.

Anyway, lots of way to skin the cat, if you're happy, I'm happy.

Who is online

Users browsing this forum: huntah and 52 guests