{"id":439,"date":"2014-09-13T12:21:18","date_gmt":"2014-09-13T17:21:18","guid":{"rendered":"https:\/\/billhiggins.us\/blog\/?p=439"},"modified":"2014-09-13T12:21:18","modified_gmt":"2014-09-13T17:21:18","slug":"use-target-display-mode-with-an-imac","status":"publish","type":"post","link":"https:\/\/billhiggins.us\/blog\/2014\/09\/13\/use-target-display-mode-with-an-imac\/","title":{"rendered":"Use Target Display Mode with an iMac"},"content":{"rendered":"<p>Here&#8217;s my ideal setup:<\/p>\n<ul>\n<li>Use the same computer in all situations so that I only have to manage one configuration<\/li>\n<li>Use a large display for improved productivity<\/li>\n<li>My family has an all-in-one computer that&#8217;s easy to use<\/li>\n<li>As few devices and\u00c2\u00a0wires as possible<\/li>\n<\/ul>\n<p>Here&#8217;s my computer situation:<\/p>\n<ul>\n<li>I use a 13&#8243; <a href=\"https:\/\/www.apple.com\/macbook-pro\/\">MacBook Pro<\/a> as my work laptop<\/li>\n<li>I have an\u00c2\u00a0<a href=\"http:\/\/www.apple.com\/displays\/\">Apple Thunderbolt Display<\/a> at work<\/li>\n<li>I have an <a href=\"http:\/\/www.apple.com\/imac\/\">iMac<\/a> at home<\/li>\n<li>At both work and home I have an <a href=\"http:\/\/www.apple.com\/keyboard\/\">Apple Wireless Keyboard<\/a> and a <a href=\"http:\/\/www.apple.com\/magictrackpad\/\">Magic Trackpad<\/a><\/li>\n<\/ul>\n<p>Until recently, I used the work laptop at work using the Thunderbolt Display and at home I used the iMac. This meant that I had to maintain two configurations and try to keep them in sync as much as possible, which as anyone with any experience knows, ends up being a constant annoyance. Recently I\u00c2\u00a0spent some time\u00c2\u00a0coming up with an approach that allows me to achieve my ideal setup given the above set of devices. Here&#8217;s how it works.<\/p>\n<p><strong>The Work Setup<\/strong><\/p>\n<p>The work setup is pretty easy. Since I don&#8217;t have to share my computer with my family at work, I just\u00c2\u00a0connect the Thunderbolt Display to the MacBook Pro\u00c2\u00a0using using the\u00c2\u00a0monitor&#8217;s Thunderbolt Cable and use Bluetooth to connect the keyboard\/trackpad to the MacBook Pro and I&#8217;m done.<\/p>\n<p><strong>The Home Setup<\/strong><\/p>\n<p>The home setup is trickier, because I\u00c2\u00a0want to use my laptop for the purposes of &#8220;same computer always&#8221;, and I want to use the iMac&#8217;s big display, but when I&#8217;m not using the iMac, I want my family to be able to use it as a normal computer.\u00c2\u00a0The iMac has a feature called <a href=\"http:\/\/support.apple.com\/kb\/HT3924\">Target Display Mode<\/a>, which lets you use the iMac as a display for your laptop, but there&#8217;s a problem -\u00c2\u00a0I can&#8217;t easily connect the keyboard \/ trackpad to the MacBook Pro because they&#8217;re already connected to the iMac. And you can&#8217;t just\u00c2\u00a0disconnect them from your iMac because you need to trigger Target Display Mode from the keyboard. And once you trigger Target Display Mode, you can no longer use the iMac GUI to turn off Bluetooth!<\/p>\n<p>My solution, which I derived from <a href=\"http:\/\/wherenow.org\/imac_target_display_bluetooth_keyboard_mouse\/\">this article<\/a>, is to configure the laptop to be able to remotely\u00c2\u00a0turn the iMac&#8217;s Bluetooth on and off. Once you can do this, it&#8217;s straightforward &#8211; though a bit hacky &#8211; to use the Bluetooth keyboard \/ trackpad with the iMac -OR- the MacBook Pro, depending on what you&#8217;re trying to do. Here&#8217;s how it works:<\/p>\n<p><em>One-time Setup Activities<\/em><\/p>\n<ol>\n<li>Install <a href=\"http:\/\/www.frederikseiffert.de\/blueutil\/\">blueutil<\/a> on both computers.\u00c2\u00a0Blueutil is a simple utility that allows you to turn Bluetooth on and off from the Mac&#8217;s Terminal.<\/li>\n<li>Configure the iMac to allow incoming SSH connections. System Preferences -&gt; Sharing -&gt; Check &#8220;Remote Login&#8221;.<\/li>\n<li>(Optional) Configure your home networking to give the iMac a static IP address.<\/li>\n<li>(Optional) Edit your MacBook Pro&#8217;s \/etc\/hosts file to alias the iMac&#8217;s static IP address with a shortname like &#8216;iMac&#8217;.<\/li>\n<li>(Optional) Add your MacBook Pro&#8217;s public key file to your iMac&#8217;s $HOME\/.ssh\/authorized_keys file so you can run SSH commands without entering your password.<\/li>\n<li>Disable your iMac&#8217;s Bluetooth by running\u00c2\u00a0<code>ssh bill@home-imac '\/usr\/local\/bin\/blueutil off'<\/code> and then pair the wireless keyboard and trackpad with your MacBook Pro.<\/li>\n<li>Go to either &#8220;Use the iMac as a Display for Your Work Laptop&#8221; or \u00c2\u00a0&#8220;Use the iMac in Normal Mode&#8221; depending on what you want to do next.<\/li>\n<\/ol>\n<p><em>Use the iMac\u00c2\u00a0as a Display for Your Work Laptop<\/em><\/p>\n<p>Each time you want to use the iMac for work, you need to\u00c2\u00a0turn it into a glorified display for your MacBook Pro and connect the wireless keyboard\/trackpad with the MacBook Pro. These are the steps:<\/p>\n<ol>\n<li>Connect the Thunderbolt cable<\/li>\n<li>Enter target display mode by pressing Command+F2 on the iMac<\/li>\n<li>From the MacBook Pro, run the following commands, changing the username and hostname of course:<br \/>\n<code># Turn Bluetooth off for the iMac<\/code><br \/>\n<code>ssh bill@home-imac '\/usr\/local\/bin\/blueutil off'<\/code><br \/>\n<code># Turn Bluetooth on for the MacBook Pro<\/code><br \/>\n<code>blueutil on<\/code><\/li>\n<li>Close your MacBook Pro&#8217;s monitor<\/li>\n<\/ol>\n<p>If everything went well, you should see your MacBook Pro&#8217;s desktop on your iMac&#8217;s display and you should be able to use the keyboard and trackpad as normal.<\/p>\n<p><em>Use the iMac in Normal Mode<\/em><\/p>\n<p>Each time you want to turn the iMac back into a standalone home computer, you need to give its display back and reconnect the wireless keyboard\/trackpad with the iMac. These are the steps:<\/p>\n<ol>\n<li>Disconnect the Thunderbolt cable, which exits target display mode<\/li>\n<li>From the MacBook Pro, run the following commands:<br \/>\n<code># Turn Bluetooth off for the MacBook Pro<\/code><br \/>\n<code>blueutil off<\/code><br \/>\n<code># Turn Bluetooth off for the iMac<\/code><br \/>\n<code>ssh bill@home-imac '\/usr\/local\/bin\/blueutil on'<\/code><\/li>\n<\/ol>\n<p>If everything went well, you should see your iMac&#8217;s desktop and you should see keyboard and trackpad\u00c2\u00a0working with the iMac.<\/p>\n<p>This is obviously way more low-level work than you&#8217;d expect with an all-Apple setup, but I think Apple is unlikely to fix something like this\u00c2\u00a0since it&#8217;s relevant to a very small number of people and I suspect it would be expensive and complicated to come up with an elegant solution. I would love to be proven wrong on this, of course \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s my ideal setup: Use the same computer in all situations so that I only have to manage one configuration Use a large display for improved productivity My family has an all-in-one computer that&#8217;s easy to use As few devices and\u00c2\u00a0wires as possible Here&#8217;s my computer situation: I use a 13&#8243; MacBook Pro as my [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-439","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/billhiggins.us\/blog\/wp-json\/wp\/v2\/posts\/439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/billhiggins.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/billhiggins.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/billhiggins.us\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/billhiggins.us\/blog\/wp-json\/wp\/v2\/comments?post=439"}],"version-history":[{"count":3,"href":"https:\/\/billhiggins.us\/blog\/wp-json\/wp\/v2\/posts\/439\/revisions"}],"predecessor-version":[{"id":442,"href":"https:\/\/billhiggins.us\/blog\/wp-json\/wp\/v2\/posts\/439\/revisions\/442"}],"wp:attachment":[{"href":"https:\/\/billhiggins.us\/blog\/wp-json\/wp\/v2\/media?parent=439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/billhiggins.us\/blog\/wp-json\/wp\/v2\/categories?post=439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/billhiggins.us\/blog\/wp-json\/wp\/v2\/tags?post=439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}