immense / Remotely

A remote control and remote scripting solution, built with .NET 8, Blazor, and SignalR.
GNU General Public License v3.0
4.54k stars 1.61k forks source link

macOS support #8

Open genxlee opened 5 years ago

genxlee commented 5 years ago

Would be amazing to have macOS client support aswell.

bitbound commented 5 years ago

I'd love to get a Mac client working. Unfortunately, I don't have a Mac, so I can't even begin working on it.

If anyone would like to work on this, the Mac client will need to implement ICapturer and IKeyboardMouseInput, following examples from the ScreenCast.Win and Linux projects.

snowtr commented 5 years ago

I have a MacBook Mini 2011 that I can give you access to if it would help.

Trouble123 commented 5 years ago

I am willing to put a bounty and pay towards this functionality.

bitbound commented 5 years ago

I won't be working on any new features for Remotely. It's mostly in maintenance mode right now.

ryanblenis commented 4 years ago

Hi @Jay-Rad,

I noticed you took the maintenance mode note off the readme and have been making some updates recently. Just wondering the status of the project and if you intend on continuing development. It's an awesome project and you've put some great work into it. Thank you!

Posting here because I am also interested in macOS support. If you are going to put more time into the project, is this something potentially worth re-opening?

edcous commented 4 years ago

Hey @lucent-sea, just following up to see if there are any updates on this?

stevesobol commented 4 years ago

@lucent-sea @edcous I have a late 2012 Mac Mini running Catalina. I already use it as my mobile dev machine, and it has Xcode on it and I can put Visual Studio on it too. I just need some available bandwidth to get started. At the moment, time is something I do not have. I personally would love to see Mac support and although I'm not a Mac guru, I am happy to help where I can, when I can.

stevesobol commented 4 years ago

@ryanblenis I am definitely interested in supporting macOS. Supporting Intel Macs would be something I can work on immediately. When the new ARM-powered Macs come out, though, I'm going to have to save up some pennies for a new machine (which I need to do anyhow, since my current Mini is 7 years old, but I'm investing in an SSD for the mini, first).

bitbound commented 4 years ago

Unfortunately, I'm currently lacking both a Mac and available time.

stevesobol commented 4 years ago

@Trouble123 I'm looking for work over and above what I have now. Obviously, bringing in some money will allow me to prioritize this project way above where it is now. We can chat if you'd like.

RedJohn14 commented 3 years ago

+1

Fimeg commented 3 years ago

@lucent-sea If you even want to dabble; not promising that there ever be a product; I could easily spin you up a fast VM of Catalina on my self-hosted proxmox server (you'd have the only password); and/or I could send you a slightly antiquated (but runs latest OS) macbook that you could wipe and keep... I'm way too huge a fan of your work. seriously, just reach out because there are techs out here who would gladly give just to make it easier for you. Remotely beats Connectwise in my opinion with it's support for powershell scripts and a tight inclusion I have with it and Zabbix... Keep up the great work! (or Thank you for showing just what can be done as an alternative to the MSP smashup.

stevesobol commented 3 years ago

@Fimeg I have a Mac mini. I'm planning on buying an M1-powered Mini when I have time and money -- HEY! Stop laughing -- but my current Mac mini is a late-2012 model with a Core i7. Remotely simply ROCKS, I want to start using it to support my own clients (using Connectwise right now, and it's great, but has some serious shortcomings regarding branding) and as part of that process, I really want to make a Mac port (ok, technically, an addition to the existing codebase) work.

I can devote time to the project, although not a ton - but my biggest hurdle is figuring out screen capture on the Mac. Oddly, I've looked at some of the VNC projects on Github - TigerVNC is one of the VNC servers that run on macOS, but I don't see any actual Mac-specific code (other than a couple conditionals in one of the Makefiles that link the code against some Cocoa libraries).

stevesobol commented 3 years ago

My guess is that VNC servers on Macs use X. So maybe I can get things working with XQuartz, since X doesn't ship with newer versions of macOS.

That leads me to wonder if/how we can get things working with M1-powered Macs. XQuartz's last major release is over four years old.

Fimeg commented 3 years ago

@stevesobol I think you're on the right track. I admit that a MacOS client would be incredibly slick; however it's not required in my own personal workflow. I can open an RDP from a server with Remotely/Connectwise on it; and Zabbix is what I use for scripting anyway on that platform.

If I can assist in this venture, I will. Yet I too have 3 startups, a full-time job along with wife and kids,

stevesobol commented 3 years ago

Would it be cool if I asked you for that VM you were talking about?

I'm trying to minimize my use of my current Mini until I can replace the almost-nine-year-old hard drive with an SSD (hopefully very soon). I'm not going to be able to avoid using it altogether because I just accepted a new project that has me creating an iOS app. :)

Fimeg commented 3 years ago

While I absolutely could; the vital need I think is negated because you do have a mac mini; provide me with a form of contact for us and I'll either ship you an SSD or send you the funds. -- If you would still prefer to endure the occasional latency from my 40MB upload limit (per second) then I will spin up an Catalina VM on my server. Again, we need to communicate on another medium to provide credentials.

find me on reddit? /u/Fimeg

stevesobol commented 3 years ago

Let's hold off on that SSD for now.

If you're going to send it to me, I want to use it to work on the project, and I'm not ready to start the work. Incidentally, which hypervisor are you using?

Fimeg commented 3 years ago

Proxmox; if you message me on reddit I'll be more comfortable sharing in-depth.

stevesobol commented 3 years ago

Done; look for a message from /u/stevesobol.

bitbound commented 3 years ago

I've purchased a Mac Mini that should be on the way soon. Once I'm done with the rewrite to Blazor, I'm going to start working on this.

As for the new Apple Silicon chip, Microsoft plans to support it in the next release of .NET. Progress for that is being tracked here: https://github.com/dotnet/runtime/issues/43313

stevesobol commented 3 years ago

M1? I want one.

On Mar 27, 2021, at 12:50, Jared @.***> wrote:

 I've purchased a Mac Mini that should be on the way soon. Once I'm done with the rewrite to Blazor, I'm going to start working on this.

As for the new Apple Silicon chip, Microsoft plans to support it in the next release of .NET. Progress for that is being tracked here: dotnet/runtime#43313

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

swilkey commented 3 years ago

It is exciting to see the direction you are taking things Jared, I hope you don't get overloaded with this again - it would be great to see remotely continue to go from strength to strength.

On Sun, Mar 28, 2021, 12:40 AM Steve Sobol @.***> wrote:

M1? I want one.

On Mar 27, 2021, at 12:50, Jared @.***> wrote:

 I've purchased a Mac Mini that should be on the way soon. Once I'm done with the rewrite to Blazor, I'm going to start working on this.

As for the new Apple Silicon chip, Microsoft plans to support it in the next release of .NET. Progress for that is being tracked here: dotnet/runtime#43313

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lucent-sea/Remotely/issues/8#issuecomment-808795751, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5UXTDQ7ZZ3OCRR3SUDXBDTFY3UHANCNFSM4HEGOIJQ .

stevesobol commented 3 years ago

@lucent-sea I've been trying to figure out how other remote-control products work on the Mac. I'm not clear on that yet. But I'd like to work on this with you.

I just upgraded to a blazing-fast SSD with a fresh install of Catalina, so I'm eager to make good use of the mini.

bitbound commented 3 years ago

@stevesobol My first task is going to be the main service, so feel free to get a head start on the remote control if you'd like.

The way I'm doing remote control is probably different from what other products are doing. I'm not using an actual video encoder, as I haven't found a viable cross-platform solution for C#/.NET. I may end up having to write my own C# wrapper around libvpx or something. Or if Microsoft ends up making their WebRTC library cross-platform, I could use that.

(As an addendum to the above, the "Stream Mode" does use actual video encoding from the Microsoft WebRTC library. But it's Windows-only and only works via WebRTC.)

Anyhow, I'm just taking screen grabs and diffing the images myself in Remotely.Desktop.Core.Services.ScreenCaster. The ScreenCaster class retrieves a transient Viewer from the DI container, which has an injected IScreenCapturer service. Each OS needs their own implementation of IScreenCapturer (e.g. ScreenCapturerWin and ScreenCapturerLinux).

Well, all of the interfaces in Remotely.Desktop.Core.Interfaces need a Mac implementation registered in the DI container.

My plan was to change Remotely.Desktop.Linux to Remotely.Desktop.Unix and have it support both Linux and Mac. The UI framework (Avalonia UI) is cross-platform. The Windows client is WPF, which is Windows-only. Eventually all these will be merged into one UI project using MAIU. Probably in .NET 6, if it's ready.

I need to move the start-up logic from Desktop.Linux.Program.Main into App.xaml.cs. The way the UI thread is currently managed doesn't work in Mac. I might have to do this part, as there are some specific things I wanted to change, and there will probably be some trial-and-error until I got it how I want.

In the BuildServices method, I'd check whether its running on Linux or Mac and register the platform-specific services.

I haven't looked very far into what native libraries I need to use to capture the screen, simulate input, access the clipboard. etc. I had this bookmarked as a place to start looking at hooking into input events: https://developer.apple.com/documentation/coregraphics/quartz_event_services

bitbound commented 3 years ago

Progress. :)

Screen Shot 2021-04-21 at 8 15 08 AM

santoshbhor commented 3 years ago

superb

sinichi19 commented 3 years ago

Progress. :)

Screen Shot 2021-04-21 at 8 15 08 AM

Sweet.. awesome work and skill Sir..

bitbound commented 3 years ago

In case anyone missed it, there's now an installer for macOS x64. If anyone wants to try recompiling it for arm64 and seeing if it works on M1, that'd be cool. :)

d1ch4rd commented 3 years ago

I'm probably missing something but the installer errors out for me on 10.14.6. I get a "139: Service cannot presently execute". What am I missing? Didn't see instructions anywhere so if I'm missing them I'm sorry.

I found the files location in /usr/local/bin/Remotely and looked inside the ConnectionInfo.json... it has the right URL and ORGID but does not have a device ID assigned or ServerVerificationToken.

How can I get those or assign them manually?

bitbound commented 3 years ago

@d1ch4rd I'm not sure about the error. This is actually my first time ever using a Mac, so I'm learning as I go.

The ServerVerificationToken is supposed to be blank at first. It will generate one and share it once with the server the first time it connects.

The Device ID missing, though, probably means must mean that uuidgen wasn't present. What version of macOS are you running?

d1ch4rd commented 3 years ago

All good man. I'm the same guy from Reddit you were responding to this morning about the Windows agent stuff. So just for context to pull both of these things together.

I'm using a late 2012 mac mini that's running Mojave 10.14.6

bitbound commented 3 years ago

Thanks. :)

Can you check if uuidgen is available in the terminal? I read that it was included with all versions of Mac out of the box. But it's not.

d1ch4rd commented 3 years ago

Haha yea actually I was just updating my previous post.

I confirmed in terminal that uuidgen does work and provides a value back. Is it worth just taking that and copying it into the ConnectionInfo.json?

bitbound commented 3 years ago

Sure. But I'm curious why it didn't work in the script. Does your version of the script have #!/bin/bash at the top for the shell? I originally had it as zsh, but then I found that some of the syntax I was using didn't work for it.

bitbound commented 3 years ago

Oh, and if the service still won't start, try doing sudo launchctl kickstart -k system/com.translucency.remotely-agent and seeing what it says. Then try sudo /usr/local/bin/dotnet /usr/local/bin/Remotely/Remotely_Agent.dll and see what that says.

d1ch4rd commented 3 years ago

Yes it does. Here is the last bit of where the installer ends.

inflating: System.Xml.XPath.XDocument.dll
inflating: WindowsBase.dll
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 42.9M 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 /Library/LaunchDaemons/remotely-agent.plist: service already loaded Could not kickstart service "com.translucency.remotely-agent": 139: Service cannot presently execute

d1ch4rd commented 3 years ago

Ok so I deleted the original files and ran the installer again. This time it did grab a device ID on it's own, but still doesn't start. Trying your other commands now.

d1ch4rd commented 3 years ago

As it seems, it might be my same problem as the Server 2016. The second command says /usr/local/bin/dotnet: command not found. I installed .NET to make sure it was there but there is no such folder even after install.

bitbound commented 3 years ago

Hmm. It was supposed to install it with Brew. What does brew install --cask dotnet say? No sudo there.

d1ch4rd commented 3 years ago

Ok that was definitely it. I can see the command as part of the install script but for some reason it seems like it never actually ran. After running it manually it did download the prereqs and I now see it in the UI.

This is amazing! I'll keep an eye out for new versions. Feel free to ping me if you need someone to test. I have a huge VM environment at home with lots of ability to test OS versions and such.

bitbound commented 3 years ago

Hah. I found one of the problems. I'm a dork. I used the reverse unary operator for checking for an existing UUID.

hans0801 commented 3 years ago

I hope Mac Os agent will release soon 👍

snowtr commented 2 years ago

I've also run into the MacOS install issue, same as above. The issue seems to have been that by running the install script with sudo, it prevents brew from install dotnet due to an update of theirs. So the only way to get it working was by reading through this post and running 'brew install --cask dotnet' as my normal user.

snowtr commented 2 years ago

I'm not seeing that brew won't let me install dotnet without at least MacOS Mojavi (10.14.x) and I'm on High Sierra (10.13.x).

introspection3 commented 2 years ago

nyuy怒火神什么.我很无语偶很无语夫人人人都很

stevesobol commented 2 years ago

Catalina, at minimum, is required by .NET 6 (the currently-supported version), and .NET 3.1.

https://docs.microsoft.com/en-us/dotnet/core/install/macos

RickvDi commented 1 year ago

The macOS script found on remotely server won't work with macOS 13.1 and zsh as default shell. Gives a command not found. Now trying to install it manually

RickvDi commented 1 year ago

The macOS script found on remotely server won't work with macOS 13.1 and zsh as default shell Now trying to install it manually

Installing it manually didn't work

redfive2012 commented 1 year ago

I found 1 problem in the install script, and 1 small enhancement.

Line 77 (this is the problem) unzip -o $InstallDir/Remotely-MacOS-x64.zip needs to be changed to unzip -o $InstallDir/Remotely-MacOS-x64.zip -d $InstallDir

I realized that the script was downloading the zip file to $InstallDir, but it unzips to whatever your current working directory is, not $InstallDir or even where the script resides. Adding -d

to the unzip command fixes that.

Line 90 curl --head $HostName/Content/Remotely-MacOS-x64.zip | grep -i "etag" | cut -d' ' -f 2 > $InstallDir/etag.txt change to echo $ETag > $InstallDir/etag.txt

This is a small enhancement to remove a second curl call to get the etag from the zip file. We already have it in the variable $ETag, so there's no need to retrieve it again.

I've tried these changes on both macOS 10.15.1 and 12.6 in zsh.

Edit to add: not sure the install completes in 12.6, seems like the agent doesn't start correctly via launchctl, but the unzip operation at least puts things where they belong.