duanefields / virtualkvm Goto Github PK
View Code? Open in Web Editor NEWAutomatically toggles Bluetooth and Target Display Mode when you connect a Macbook to your iMac via Thunderbolt.
Automatically toggles Bluetooth and Target Display Mode when you connect a Macbook to your iMac via Thunderbolt.
I noticed that the power assertion isn't recreated after it has been released.
There's a problem I keep running into where the iMac or the Macbook falls asleep and things can't recover. When I wake them up, Target Display Mode is disabled, and plugging/unplugging the thunderbolt cable doesn't do anything. I've confirmed that the app still recognizes connect/unconnect, but it can't re-enable target display mode.
I'm guessing that because at this point the iMac has no keyboard, the Mac is ignoring the AppleScript key code commands, because the only "fix" is to re-enable bluetooth and connect to the keyboard on the iMac.
I have a Mid 2015 MacBook Pro connected to a Mid 2011 iMac using a new thunderbolt cable. Both macs are running High Sierra and Virtual KVM is on the iMac. The iMac is not detected when connected to the MacBook Pro as a second display. Any ideas?
It'd be nice to have the app only toggle the mouse and keyboard when connecting/disconnecting. At the moment, the bluetooth toggle turns off so I lose my headphones and any other devices connected to my laptop.
Maybe some kind of menu where you can select which devices to toggle on connecting?
Hi,
I'm really not sure if this was a direct cause of VirtualKVM but I have had a serious issue croup while using it, and think it's worth investigating.
Basically I had VirtualKVM installed and running on my iMac which had been working fine. However I did something this week, and maybe didn't fully think about the potential ramifications.
I needed to connect my MacBook using target disk mode, put it into that mode and connected it to my iMac. This didn't go well at all, the disks didn't mount and basically my MacBook volume got corrupted and the MacBook would not boot at all afterwards.
After some hard work I have managed to recover the data, but had to do a fresh install etc.
Could this have had anything to do with VirtualKVM? It feels to me that putting my MacBook into target disk mode made the MacBook emulate a thunderbolt storage, as it was plugged into the iMac would VirtualKVM have detected the thunderbolt connection and switched to display mode at the same time the drive was trying to mount? In hindsight it sounds like what I did was asking for trouble, but just didn't occur to me at the time!!.
Thanks
Since my update to El Capitan and VirtualKVM v1.1.2 both MacBook and iMac the Client Mode status is not set correctly both on connecting and disconnecting the iMac.
iMac could be left with Client Mode: Connected even if disconnected and MacBook are left in Client Mode: Not Connected even when connected.
The Target Display Mode works as usual but I have to change the bluetooth status manually β very annoying since I use a bluetooth keyboard.
The current magic keyboard and trackpad doesn't appear to pair the same way the old ones do.
I have a 27" iMac 2011 model that works fantastic when I manually put the display into target display mode. I run the Virtual KVM package on my MacBook and it shows that the iMac is connected only after manually activating target display mode. Plugging it in and unplugging the thunderbolt cable only changed the status from "Connected" to "Not Connected". Once "not connected", I can not get it to say connected again until I manually activate display mode from the iMac again. I have tried using all packages compatible with OSX 10.11. I've rebooted everything multiple times and tried a few different wired and wireless keyboards. I've left a keyboard on the iMac through all of the testing. Nothing works. Any ideas?
I was really hoping this would resolve issue trying to connect my 2016( new gen) MBP to a mid 2011 iMac. Cannot seem to get iMac into Target Display Mode no matter what I try - any suggestions appreciated.
When I run the tool it seems to be active but plugging in MBP has no effect and I note that in the status bar on the iMac, the 'host mode' status seems to be greyed out as per the subject line above.
thanks
Received this exception today.
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to set posix_spawn_file_actions for fd -1 at index 0 with errno 9'
*** First throw call stack:
(
0 CoreFoundation 0x00007fffb149f7bb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffc5c0ca2a objc_exception_throw + 48
2 CoreFoundation 0x00007fffb151ca65 +[NSException raise:format:] + 197
3 Foundation 0x00007fffb2ed2a16 -[NSConcreteTask launchWithDictionary:] + 2518
4 VirtualKVM 0x000000010f02b089 +[KVMSystemProfiler dataTypes:] + 265
5 VirtualKVM 0x000000010f02948d -[KVMThunderboltObserver updateSystemProfilerInformation] + 141
6 VirtualKVM 0x000000010f0296bb -[KVMThunderboltObserver checkForThunderboltConnection] + 43
7 VirtualKVM 0x000000010f028f1f __45-[KVMThunderboltObserver registerRepeatBlock]
I've got an iMac 27 late 2009 and a macbook pro 15 late 2013 and this app is not working at all...any help?
thanks! :)
I am running a MacBook Pro on OS X El Capitan and an iMac on the macOS Sierra and the Virtual KVM software no longer detects the Thunderbolt cable being connected and disconnected. Has anyone else running macOS Sierra experienced this issue?
It's not really difficult to build the project, but it takes some time if you're no a Mac developer. It would be great to describe the process at least shortly. Tricky moments for me were to find, that:
sudo gem install cocoapods
)pod install
)open VirtualKVM.xcworkspace
)Also I still don't know how to build Release instead of Debug.
The Host Mode is 'Connetcted',but can't automatically switch mode.
I can switch it use Keyboard..
Hi All,
I had the vKVM working beautifully between my 2011 iMac and 2015 MacBook Pro via Thunderbolt 2
Then I decided to add the OWC Thunderbolt 3 dock to the mix (Why 3, because I will be upgrading soon and didn't want to buy a legacy dock).
So now my setup is
2015 MBP <-> T2 Cable <-> T2 to T3 Adapter <-> OWC T3 Dock <-> T3 to T2 Adapter <-> T2 Cable <-> 2011 iMac
I can manually turn on TDM from iMac, and then use screen sharing to get K+M working, but when I connect or disconnect Thunderbolt from my MBP nothing happens. Looks like the client/server communication is totally blocked by the dock.
Is this expected behaviour or a bug?
Any chance this will get fixed?
I shelled out quite a bit of cash for that dock, and may need to return it if this doesn't work
I am running latest 1.2.3
Thx
BQ
There is already an issue regarding manually connecting KVM.
My current workaround is to quit VirtualKVM and start it up again. That seems to do the trick.
Would it be possible to add that as a menu item?
I am wondering if this also works with the iMac Pro using an older iMac 2013 as an external second display. Both running the latest OSX High Sierra. Does anyone know?
Thank you
Hi,
do you have to login to your iMac for this to work on will this process simple work on iMac boot up?
thanks - great idea!
Is there a new release available? It shows updates from the past week or so but the latest release on the release page (https://github.com/duanefields/VirtualKVM/releases) is from last year.
The link to the release build is broken.
I have downloaded the binary and could run the application from Xcode. The screen will toggle to target display mode. However if I build an application and start it then it doesn't work.
Please provide a ready-to-go release build.
So I lucked upon your repository and you may have added a few hours to my life and hairs to my head! I was banging my forehead against the keyboard asking why I had to do an automator workflow for this? Seems like it should be "apple-matic", especially with the bluetooth release.
Anyways, thank you for starting the project and going at the problem with complete solution.
EDIT
Got it working! Thanks again!
Aloha!
Jeremy
I'd love to be able to toggle TDM from my MacBook, manually. The auto mode doesn't work so well for me, because it's a bit imprecise.
What I mean is, if I leave my desk and my laptop goes into screensaver, after a while the iMac goes to sleep. I turn it back on but since it doesn't record a Thunderbolt connection, VirtualKVM doesn't trigger TDM and I have to go in and do it manually.
Would be awesome if I could install VirtualKVM on my laptop as well and use it to trigger the one on the iMac...
I use macOS 10.12.4 and VirtualKVM 1.2.2 but the same issue appeared in the previous versions, too.
When I connect a cable iMac is switching to the TDM but Mac Book doesn't enable Bluetooth and I have to enable it manually. When I disconnect a cable Bluetooth is not disabled on Mac Book. At the same time, "Auto Toggle Bluetooth" works fine in a host mode.
Ok I figured out the cocoapods thing but I'm now getting this error upon attempting to build
linker command failed with exit code 1 (use -v to see invocation)
Here's the setup:
VirtualKVM isn't detecting a connection. Any suggestions? Should I be able to see a connection in System Information on the MBP under Thunderbolt?
with 1.2.3, I'm attaching a macbook air 6,1 (High Sierra) to an imac13,2 (Sierra)
The system report recognises each other under thunderbolt, (so the cable is connected okay) but VirtualKVM just has Host: ready to accept connections
and macbook has client mode: not connected
.
Moreover, I cannot seem to manually invoke target display mode, (but with a non-apple keyboard)
It may just be a case of an incompatible pair of machines, but just in case, I thought I'd report it! :)
I noticed high energy utilization due to NSTimer
that fires every 2.5 seconds. I can understand why the timer is needed on the host computer but not on the client.
I usually have VirtualKVM always open on MacBook and having a timer that is polling for thunderbolt connection isn't very inefficient. I know this issue may seem trivial to some but I decided to report it anyway. π
I have a MacBook Pro (13-inch, 2015) that I use in target display mode with my iMac (21-inch, 2011) at home using a Thunderbolt cable. I also use this MacBook Pro with a DisplayPort monitor (not Thunderbolt) at work.
I've noticed that if I have VirtualKVM running when I have the device connected to the DisplayPort monitor, it will disconnect Bluetooth when the DisplayPort cable is detached. However, when I reattach the cable, Bluetooth isn't re-enabled automatically.
This is odd - it should either disconnect and reconnect automatically when a DisplayPort cable is disconnected/reconnected, or do neither. I'd prefer that it do both, as when I attach the DisplayPort cable I'm typically using a Bluetooth keyboard/mouse.
Is there any reason OS X 10.9 is the minimum build version?
I'm trying to compile this for 10.7 on my fork at https://github.com/nybblr/VirtualKVM, but I am not an Obj-C coder (yet =) so I don't know if there are breaking SDK changes that would prevent this.
Thoughts?
Sometimes the client may indicated that it's connected even if it's not in TDM. I noticed that this comes times happens if the thunderbolt cable is pulled in but TDM was not enabled.
It would be great if you provide an option in preferences to start "VirtualKVM" on system login.
Now I have to manually start VirtualKVM and then connect my MacbookPro via thunderbolt cable.
I've been debugging the NSTimer
not repeating for the last two days now. I found that sometimes the timer would simply stop firing on the host machine. This usually happens after the machine exited or entered sleep mode or when the screensaver started.
This report relates to Issue number 2.
I have two iMacs, only the master iMac has a cabled keyboard.
VirtualKVM on the slave iMac recognizes when the master is connected via Thunderbolt, but it does't toogle to TDM since no keyboard is connected.
Having two keyboards connected all time isn't a real solution because then I can also just use the shortcut on the slave iMac to start TDM.
Are there any known issues with thunderbolt 3 and the bluetooth toggle? I just got a new Macbook Pro and I'm using the thunderbolt 2 to thunderbolt 3 adapter to connect to my iMac. Everything works except bluetooth does not toggle on/off on the Macbook. I'm wondering if it has to do with the thunderbolt converter.
It seems like there have been many commits since the latest release. (Oct. 12)
Can we get a new release with the latest code?
I believe it's possible to enter TDM without having a keyboard connected to the iMac.
I was able to open the force quit window using:
AXUIElementRef appRef = AXUIElementCreateSystemWide();
AXUIElementPostKeyboardEvent (appRef, (CGCharCode) 0, (CGKeyCode)55, true);
AXUIElementPostKeyboardEvent (appRef, (CGCharCode) 0, (CGKeyCode)58, true ); AXUIElementPostKeyboardEvent (appRef, (CGCharCode) 0, (CGKeyCode)53, true ); AXUIElementPostKeyboardEvent (appRef, (CGCharCode) 0, (CGKeyCode)55, false );
AXUIElementPostKeyboardEvent (appRef, (CGCharCode) 0, (CGKeyCode)58, false ); AXUIElementPostKeyboardEvent (appRef, (CGCharCode) 0, (CGKeyCode)53, false );
Note: The keyboard was disconnected from the computer with the above example.
However I am unable to use it to enter TDM
AXUIElementRef appRef = AXUIElementCreateSystemWide();
AXUIElementPostKeyboardEvent (appRef, (CGCharCode) 0, (CGKeyCode)55, true);
AXUIElementPostKeyboardEvent (appRef, (CGCharCode) 0, (CGKeyCode)120, true);
AXUIElementPostKeyboardEvent (appRef, (CGCharCode) 0, (CGKeyCode)55, false);
AXUIElementPostKeyboardEvent (appRef, (CGCharCode) 0, (CGKeyCode)120, false);
Any suggestion of how I would be able to enter the key codes to trigger TDM?
In the current state, then I start the VirtualKVM and the cable is already plugged in, it does not detect it and does not switch to TDM. Would it be possible to change this behavior, so that the application also switches to TDM if the cable is already connected?
Use case is the following: If I boot or reboot the target iMac, it starts without TDM enabled. I would like it to automatically switch to TDM if booted and cable plugged in. (Application is in Login Items and there is a dummy user configured with auto login.)
Hi all,
thx to saving time and nerves. Are there any plans to make it available via homebrew?
Greetings
Olli
Is anyone else having issues since upgrading to Mojave?
I started to see problems after upgrading. Then, found I needed to update VirtualKVM which I did. I think it worked once when I unchecked Prevent Display Sleep and hasn't worked since with a combination of turning settings on and off.
I have an 2012 iMac running Mojave and a 2016 Macbook Pro running Mojave. Thanks for your help and input on the issue!
VirtualKVM v1.1.0 allows users to transfer control of a keyboard/mouse/display (in particular the iMac display) by connecting or disconnecting a Thunderbolt cable. My setup involves two computers that may be connected indefinitely, and I would like to avoid stressing the hardware with repeated (dis)connections. This request is for the addition of a menu item to transfer KVM control.
It is assumed that communication between VirtualKVM processes occurs strictly through the Thunderbolt connection (or lack thereof).
The "Auto Toggle Bluetooth" and "Auto Toggle Display" options of VirtualKVM v1.1.0 effectively allow a user to toggle the Bluetooth keyboard/mouse independently of the display. It does not make much sense to me for a wired connection to only toggle a wireless protocol and do nothing else. The below proposal removes this functionality.
The abbreviations "TDM", "hBT", "cBT", and "cTB" stand for "Target Display Mode", "host Bluetooth", "client Bluetooth", and "client Thunderbolt", respectively. The prefixes "-" and "+" used with one of these abbreviations denote actions/events depending on the context. For example, "+TDM" means both "host enters TDM via key code 144" and "client observes TDM being entered via 'system_profiler SPDisplaysDataType'". Note that not all actions can be observed on the other end.
The VirtualKVM menu on the host computer will have these items:
The menu on the client computer will have:
Notes:
When "Bluetooth follows Display" is enabled, both host and client watch for -TDM and +TDM events and react accordingly. This means that manually toggling the display via Command-F2 (as opposed to the VirtualKVM UI) will transfer control of the KVM to the client.
When "Auto Toggle Display" is enabled, the host will +TDM if a +cTB is observed. (-TDM always happens upon -cTB.)
When "Toggle Display" is selected on the host, these actions/events occur:
Host: +TDM
Client: nothing
When "Toggle Display" is selected on the client, these events occur:
Client: -cTB, wait 2x polling interval, +cTB
Host: -TDM (the OS should do this automatically in reaction to -cTB)
Thunderbolt can be enabled/disabled programmatically via some kernel extensions . I have not personally tried any of the cited tools.
Big thanks for VirtualKVM and the latest client update! Makes my work set-up so much cleaner, i love it.
The only thing I'm missing now is the client to set brightness to 100% on connection since the iMac i TDM-mode always starts off with brightness on 0%. What do you think?
Testing the 1.1.0 beta right now, will report on any problems.
It seem to be possible to run commands on boot without logging in: use launchctl
under root. However that doesn't seem to work with GUI apps.
Target display mode works after boot if disk is not encrypted so logging in is an annoying overhead.
Lately, I don't remember if after 10.13.3 or 10.13.4 update I have sometimes bluetooth issues. The fact is that bluetooth doesn't turn off on iMact aftwer display switching; thus, keyboard and mouse remain attached to the iMac and are not syn with my Macbook Pro. Any idea about how to deal or debug this issue?
Great extension -- I'm wondering if there is a flag that could be added to disable disconnecting from the bluetooth keyboard?
I'd like to get around the issue you mentioned by preserving a keyboard connection to the iMac, but still get the autoswitching. I'm using the Logitech K760 which allows me to pair with multiple devices, so I can preserve the connection to the TDM computer (thus preventing the issue you mentioned).
I'm no Obj-C croney unfortunately, but this looks like it should be easyish to do?
Hi there! I have an editing rig that runs both macOS and Windows (Hackintosh) with an Asus ThunderboltEX 3 add-on card which works great and is recognized by my 2011 27" iMac.
Unfortunately, the iMac won't go into Target Display Mode when I press Command + F2 even though I have a video signal feeding into it (The thunderbolt card has a displayport in which it then injects into the thunderbolt signal). Switching to Target Display Mode does work when I plug in my 2013 13" MacBook Pro.
It seems like the Mac is waiting for some kind of Apple Thunderbolt handshake to switch, and it's not getting it from the Hackintosh.
VirtualKVM wonβt pick it up either. Would you happen to know how I could force the iMac into target display mode?
It seems that perhaps the Objective-C API changed in OSX Sierra because the app crashes in KVMThunderboltObserver.m. In the method isThunderboltEnabled() the call to systemProfilerThunderboltInfo() returns an NSDictionary, not an NSArray. The following code corrects the problem...
- (BOOL)isThunderboltEnabled {
NSDictionary *profilerResponse = [self systemProfilerThunderboltInfo];
if (profilerResponse.count >= 1) {
NSArray *items = profilerResponse[@"_items"];
if (!items || items.count == 0) {
return NO;
}
NSString *busName = items[0][@"_name"];
if ([busName isEqualToString:@"thunderbolt_bus"]) {
return YES;
}
return NO;
}
return NO;
}
After that the app seems to be working well. I'm having a slight issue with my new wireless keyboard with number pad though. It seems that two computers can't trade ownership of the keyboard because of a passkey mismatch. This requires me to turn off and turn on the keyboard again before pairing to the other computer. Not a showstopper, but let me know if anyone has any ideas.
First of all I'd like to thank you for this software. It perfectly solves my problem and I don't have to deal with Synergy or similar stuff. Good job!
So here's the feature request. Each time I disconnect MacBook from iMac, I've to manually disable bluetooth on MacBook, otherwise iMac can't find keyboard and mouse. The idea of the feature is to avoid it. So if the app is installed on MacBook and client mode is enabled, bluetooth will be automatically switched off when Thunderbolt cable became disconnected or Target Display Mode disabled. If it's possible to know current TDM state, it'll probably fix #2.
What do you think?
Seems like the bluetooth toggle stopped working after my update to El Capitan on client laptop.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.