johndbritton / teleport

Virtual KVM for macOS
GNU General Public License v2.0
790 stars 132 forks source link

Mouse control works, but keyboard does not #46

Open briantully opened 5 years ago

briantully commented 5 years ago

Hi there. I realize Teleport has been abandonware for some time now, but I still use it on a daily basis and haven't found a better replacement.

Sending this out into the ether in case someone else has experienced the following issue and figured out a workaround.

Every now and then, when switching over to control a secondary Mac, the mouse control works as expected but the keyboard control does not. When typing on the keyboard I hear an alert sound on the master computer.

Inspecting the Console when this occurs shows the following:

systemsoundserverd

687: -> Incoming Request : actionID 4096, inClientPID 60998(teleport), inBehavior 1, customVibeDataProvided 0, loop 0, loopPeriod 0.000000, inFlags 0, inClientCompletionToken 48

90: token 375, mActionID 4096, process 60998(teleport), mClientConnection -790570592, mPlayerSynchronizer 0x0, mPlayFlags->ShouldPlayAudio 1, mPlayFlags->ShouldVibe 0, mAudioFinishedPlaying 0, mVibeFinishedPlaying 0, mIsLoopedSound 0, mClientCompletionToken 48, timeSinceClientRequestedStopInMS 0, elapsedTimeInMS 8
teleport (CFNetwork)

Cannot start load of Task <FC67FD2D-FD07-4829-8AFA-C6E1438DC9AF>.<0> since it does not conform to ATS policy

NSURLConnection finished with error - code -1022

Any idea why this is occurring and how to resolve it?

Sometimes if I restart both computers it starts working again.

Alternatively, can anyone recommend an alternative app?

tomads commented 5 years ago

Hi Brian!

In my case, this problem occurs (sometimes) when Safari is open at the same time. After I quit Safari, the keystrokes are recognized normally again. Try it out, maybe it's up to you. Have fun.

briantully commented 5 years ago

Thanks for your response, @tomads :)

Unfortunately this is happening for me without Safari open. I've tried restarting both computers, (which seemed to resolve it before) but am still having this issue. No idea why it stopped working.

briantully commented 5 years ago

FWIW, I gave up trying to get teleport to work like it used to. I just purchased Synergy. Synergy takes a little patience to get it working properly, but once you do it works well. Mouse AND KEYBOARD(!) are now being shared across Macs.

I've been using Synergy for the past couple of hours, and so far the only thing I miss are the visual "bezel" notification showing me which mac I'm controlling. Other than that, everything else seems to be in parity with teleport.

tchek commented 5 years ago

With Synergy you can not use trackpad gestures and magic trackpad from one screen to another

briantully commented 5 years ago

Interesting, @tchek Thankfully I don't using trackpad gestures or a magic trackpad. I do however use a keyboard from one screen to another, which teleport doesn't appear to support anymore. 🤷‍♂️

tchek commented 5 years ago

This work on mojave

https://github.com/abyssoft/teleport/files/2648694/teleport-1.2.2-build2.zip

From this thread 👍 https://github.com/abyssoft/teleport/issues/42

johndbritton commented 3 years ago

Thanks for reporting this issue, glad to see you found a workaround with Synergy. I'm cleaning things up around here and hoping to get teleport into a bit better shape.

@briantully @tomads Are either of you still experiencing this issue? Did you find any workarounds? I haven't had this problem so I'll likely close the issue unless someone can provide steps to reproduce.

briantully commented 3 years ago

Hi there @johndbritton -- yes I still experience the problem intermittently. Last year I saw that @grunerd was kind enough to build a patched version to support Mojave ( from #42 ) and have been using that since with some success. But every now and then the keyboard just stops working when switched over to the remote computer. The mouse still works. When this happens I can occasionally resolve it by rebooting both computers. Otherwise I just fall back to using Synergy.

I was surprised to see your comment. Am I to assume that Teleport is once again being maintained or should I curb my enthusiasm? ;)

johndbritton commented 3 years ago

Thanks for following up here. The next time it happens can you please follow up on this thread with as much information as you can. Ideally we're looking for steps to reproduce.

I was surprised to see your comment. Am I to assume that Teleport is once again being maintained or should I curb my enthusiasm? ;)

I'm a big fan of Teleport and am going to do my best to maintain the project as I use it every day. I'm not an incredibly skilled macOS developer but I've done my fair share of hacking on Obj-C and Swift for desktop and mobile. My hope is that others will be willing to work on the project now that someone is here to provide code review and ensure that things get merged and released.

So yes, this project is maintained once again and contributions are welcome. My focus is going to be on fixing bugs and improving stability.

johndbritton commented 3 years ago

I did some searching of the error message from your console:

since it does not conform to ATS policy

It seems this error message is related to making network requests that are not permitted by the settings of the build. I learned about this in an apple development class, there are some settings in the project file that essentially tell the app what types of network connections are allowed.

I don't know why it would happen intermittently though. Is it possible anything is changing about your network setup? Do you have a wired and wireless connection at the same time? Do you use a VPN? Maybe one of those is experiencing an issue and the traffic changes routes (and thus IP addresses). Just some ideas as to what could be the cause.

If you do have multiple connections, can you try to reproduce the issue by switching network connections while the two computers are paired?

Any other detail you can provide will be helpful.

johndbritton commented 3 years ago

Here's the relevant documentation for App Transport Security (ATS): https://developer.apple.com/documentation/bundleresources/information_property_list/nsapptransportsecurity

johndbritton commented 3 years ago

build a patched version to support Mojave ( from #42 ) and have been using that since with some success.

What operating system version are you using on each machine? I think the behavior of NSAllowsArbitraryLoads may have changed.

briantully commented 3 years ago

Thanks for the updates @johndbritton and many thanks for taking Teleport under your wing!

What operating system version are you using on each machine? I think the behavior of NSAllowsArbitraryLoads may have changed.

Both machines are running the latest version of Mojave. In terms of networking, both machines are on the same network managed by my Airport Extreme. The "primary" computer with the mouse/keyboard attached is a MacBook Pro using WiFi. The "secondary" computer that I use Teleport to control is a Mac Pro desktop that is connected via Ethernet and is also running a VPN (Mullvad). Initially when I had these issues I thought that I might need to set up port forwarding in both the Apple Extreme and VPN, but I wasn't able to see what ports Teleport uses and/or if I can change them. But even without port forwarding, Teleport works, so I'm guessing it's not necessary.

For the most part, the latest version of Teleport (1.2.2) is working for me, it's just that every now and then the keyboard stops working on the secondary computer. Rebooting both machines usually resolves it.

Thanks again!

johndbritton commented 3 years ago

is also running a VPN (Mullvad)

This jumps out as a potential culprit. I'm not familiar with Mulvad, but ExpressVPN has an option that let's you disable VPN for some apps. Maybe see if there's something similar for your VPN and try that to see if it helps.

Another debugging thing would be to disable the VPN for a few days and see if you can replicate the issue with the VPN disabled so that we can try and eliminate that as a source of the issue.

briantully commented 3 years ago

So i've had the VPN disabled for the past couple of days, and the issue just occurred again. Again, the mouse works on the remote computer, but the keyboard does not.

I opened Console.app on both computers and searched by "teleport" to see if there was anything obvious getting logged. Surprisingly nothing on the remote computer's log, but on the host computer I see the following messages appear whenever I am controlling the remote computer and pressing a key on the keyboard:

systemsoundserverd

687: -> Incoming Request : actionID 4096, inClientPID 32525(teleport), inBehavior 1, customVibeDataProvided 0, loop 0, loopPeriod 0.000000, inFlags 0, inClientCompletionToken 42

90: token 198, mActionID 4096, process 32525(teleport), mClientConnection 802233392, mPlayerSynchronizer 0x0, mPlayFlags->ShouldPlayAudio 1, mPlayFlags->ShouldVibe 0, mAudioFinishedPlaying 0, mVibeFinishedPlaying 0, mIsLoopedSound 0, mClientCompletionToken 43, timeSinceClientRequestedStopInMS 0, elapsedTimeInMS 1

teleport

NSURLConnection finished with error - code -1001

TIC TCP Conn Cancel [5:0x600001f9c9c0]

[C5 Hostname#e60a2535:80 tcp, url hash: 769d76c9] cancel

[C5 Hostname#e60a2535:80 tcp, url hash: 769d76c9] cancelled

Task <7BF45160-106B-48E5-9710-FC51D541836A>.<0> setting up Connection 5
johndbritton commented 3 years ago

Does the keyboard work on the local computer when you move the mouse back or does it stop working on both machines when the issue occurs?

I'm pretty sure the systemsoundserverd is just related to playing the beep sound and isn't actually telling us anything about the error.

NSURLConnection finished with error - code -1001 is a timeout error, see https://developer.apple.com/documentation/foundation/1508628-url_loading_system_error_codes/nsurlerrortimedout

When this happenes again can you check activity monitor on the remote machine and see if teleport is still responsive? I can't figure out why the mouse would continue to work but the keyboard would stop.

Also any information about what you were doing immediately prior to experiencing the issue could be helpful.

Appreciate you taking the time to keep giving detail. If you can figure out how to reproduce the issue reliably that would be a huge help for debugging.

briantully commented 3 years ago

Hi again -

Yes the keyboard works on the local computer. In fact the issue is observed most times when I am moused over to the remote computer, where the mouse IS working, and on the keyboard I press COMMAND-TAB to bring up the app switcher, but the app switcher appears on the local machine and not the remote machine, even though Teleport is controlling the remote machine. At that point the keyboard only works on the local machine.

When this happened the other day, I did check Activity Monitor, and teleport was normal/responsive (i.e., it wasn't displayed in red text), and the Console logs didn't reveal anything obvious.

I haven't observed a pattern of "things I'm doing when this happens", but I'll certainly be more mindful of this when it happens in the future, so that it might get us a step closer to being able to reproduce this.

stk0vrfl0w commented 3 years ago

Having used several similar tools (ShareMouse, Synergy, etc.), I've noticed the same symptoms when an application on my host box has turned on SecureInput -- https://www.sharemouse.com/doc/troubleshooting/#secureinput. Unfortunately, tracking down which applications are responsible doesn't appear to be straightforward. Things like keybase, password managers, browsers, etc. can all enable secure input. And if that app is terminated (e.g. force quit) before it disables the request for secure input, the keystrokes won't be sent to target systems.

briantully commented 3 years ago

Having used several similar tools (ShareMouse, Synergy, etc.), I've noticed the same symptoms when an application on my host box has turned on SecureInput -- sharemouse.com/doc/troubleshooting/#secureinput. Unfortunately, tracking down which applications are responsible doesn't appear to be straightforward. Things like keybase, password managers, browsers, etc. can all enable secure input. And if that app is terminated (e.g. force quit) before it disables the request for secure input, the keystrokes won't be sent to target systems.

@stk0vrfl0w I think you hit the nail on the head! While I haven't force-quit any applications today, I certainly was using my browser and logging into sites using both passwords and yubikey. I also used several password managers (LastPass and 1Password). The keyboard control from host to remote stopped working again today while the mouse still worked. So I'm inclined to believe your theory that SecureInput is involved, and that one of the apps is not releasing it. For now I am logging out of my host Mac when this occurs, and this resolves it. My next step is to not log out, but to quit open apps one at a time until the keyboard works on the remote again. I suspect it's Google Chrome, but I'll post an update if and when I find out more info. Thanks for enlightening me and putting me on the right path!!! 🍺

tomads commented 3 years ago

Hi Brian.

I've read here now and want to inform you that I have exactly this problem (Big Sur).

In my case it concerns Safari only, since I only use this browser together with 1Password. And it also occurs exclusively, but not always, when I use the auto-login function to log into devices on my LOCAL network (e.g. the router).

But anyway, to my knowledge this is a widespread problem. It not only affects Teleport, but also e.g. BetterTouchTool (see here: https://community.folivora.ai/t/how-to-get-out-of-secure-input-macos-mojave/5129) or TextExpander (see here: https://smilesoftware.com/textexpander/secureinput/).

There is no solution from within the affected program, because 'secureinput' is a central macos security feature and, once enabled, can only be disabled by the triggering program. And turning off the auto-submit feature of any auto-login ist not an option.

But I think it would be a good idea to show, e.g. with a notification when changing screens or in the icon of teleport, if secureinput is still active and by which program it was triggered (TextExpander does it like this for example). Then you won't be surprised that keyboard input on the other computer suddenly doesn't work ...

I hope I could contribute something to solve the problem ...

Tom

Am 02.12.2020 um 01:57 schrieb Brian Tully notifications@github.com:

Having used several similar tools (ShareMouse, Synergy, etc.), I've noticed the same symptoms when an application on my host box has turned on SecureInput -- sharemouse.com/doc/troubleshooting/#secureinput https://www.sharemouse.com/doc/troubleshooting/#secureinput. Unfortunately, tracking down which applications are responsible doesn't appear to be straightforward. Things like keybase, password managers, browsers, etc. can all enable secure input. And if that app is terminated (e.g. force quit) before it disables the request for secure input, the keystrokes won't be sent to target systems.

@stk0vrfl0w https://github.com/stk0vrfl0w I think you hit the nail on the head! While I haven't force-quit any applications today, I certainly was using my browser and logging into sites using both passwords and yubikey. I also used several password managers (LastPass and 1Password). The keyboard control from host to remote stopped working again today while the mouse still worked. So I'm inclined to believe your theory that SecureInput is involved, and that one of the apps is not releasing it. For now I am logging out of my host Mac when this occurs, and this resolves it. My next step is to not log out, but to quit open apps one at a time until the keyboard works on the remote again. I suspect it's Google Chrome, but I'll post an update if and when I find out more info. Thanks for enlightening me and putting me on the right path!!! 🍺

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/abyssoft/teleport/issues/46#issuecomment-736917093, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLVU4CKKAZKYWKK6TBFAZTSSWGILANCNFSM4GPRBRKQ.

johndbritton commented 3 years ago

Thanks for sharing all these details.

I have experienced the secure input issue in other apps and agree it would be good to add a feature to teleport to at least detect secure input status, that way we can inform the use as to what is happening.

@briantully please report back if you are able to confirm that secure input is causing the issue.

I would assume that secure input on the controlling computer is the issue, not on the controlled computer.

johndbritton commented 3 years ago

Next time this happens run the command ioreg -l -w 0 | grep SecureInput in terminal. That will give you the process id of the application that has secure input enabled.

reaperhulk commented 3 years ago

When this occurs for me the ioreg command points at /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow console. Deliberately locking/unlocking the machine resolves it.

Edit: For programmatically determining this information and displaying it to the user in teleport so they know what is going on https://github.com/phodal/typing/blob/e2e25009fa10c307d963688ceefb4fb70c18ec2b/native/macos/bridge.mm#L61-L85 might be helpful.

briantully commented 3 years ago

Interesting! So it finally happened for me this week. I was beginning to think it had gone away. Running the ioreg -l -w 0 | grep SecureInput command on the host machine resulted in several calls to kCGSSession related info, including kCGSSessionSecureInputPID. After Googling this, it appears that this is related to when the Mac's screen is locked or on console key, so I suspect it's that the wake from screensaver/unlock Mac that is failing to release the SecureInput correctly. As a test, rather than my usual fix of logging out or restarting the host machine, I simply forced the screensaver to start and then unlocked it with my Apple Watch (much faster than logging out/in again) -- and presto, Teleport and the keyboard started working again on the remote machine :) Thanks again @johndbritton for the debug command!

hyperjeff commented 3 years ago

awesome @briantully, that did it for me too! My laptop was unplugged for too long and went into low-power mode, and after juicing up teleport wouldn't accept keyboard input. So, based on your trick, i put the machine into screensaver mode, which requires a fingerprint/pwd to get back in, then it immediately works again. Hooray! was driving me nuts. (Long live teleport!)

nriley commented 2 years ago

For what it's worth, I just ran into this on a 16ʺ M1 MBP on Monterey, so not fixed yet. ioreg -l -w 0 | grep SecureInput pointed to loginwindow and was resolved using Touch ID to lock and unlock, as suggested in https://github.com/johndbritton/teleport/issues/46#issuecomment-744135823.

tomads commented 2 years ago

As a sidenote: one can use bettertouchtool to see, if securemode is on - and why …

briantully commented 2 years ago

For what it's worth, I just ran into this on a 16ʺ M1 MBP on Monterey, so not fixed yet. ioreg -l -w 0 | grep SecureInput pointed to loginwindow and was resolved using Touch ID to lock and unlock, as suggested in #46 (comment).

Ooh! @nriley does that mean that Teleport works on Monterey? I'd been holding off on a new laptop for fear that teleport is not supported on Monterey. Throughout the day I am constantly using teleport to go back and forth from my Macbook (Mojave) to old Mac Pro (Mojave), so I would hate not being able to continue doing that.

Assuming teleport works on Monterey, would it still be able to connect to my old Mac Pro which is forced to run Mojave?

nriley commented 2 years ago

Yes, Teleport works great on Monterey — I use it between a Monterey and Catalina Mac. There was just a release a few weeks ago in fact!

johndbritton commented 2 years ago

It seems we have found the source of this issue. The next step here is to add a feature to Teleport that will detect when SecureInput is activated and causing issues for Teleport. We could update the menubar icon with a warning or something like that.

It's not likely I'll have the time to add this feature, but if someone sends a PR I will happily review and release an update after we get it merged.