{"id":12,"date":"2009-02-24T09:08:15","date_gmt":"2009-02-24T14:08:15","guid":{"rendered":"http:\/\/developer.casgrain.com\/?p=12"},"modified":"2009-02-24T09:08:46","modified_gmt":"2009-02-24T14:08:46","slug":"quickie-remote-desktop-ip-address","status":"publish","type":"post","link":"http:\/\/developer.casgrain.com\/?p=12","title":{"rendered":"Quickie: Remote Desktop IP address"},"content":{"rendered":"<p>Microsoft&#8217;s <a href=\"http:\/\/www.microsoft.com\/mac\/products\/remote-desktop\/\">Remote Desktop for Mac<\/a> is a great piece of software (Remote Desktop on Windows is way ahead of the Mac, which is slow and based on <a href=\"http:\/\/en.wikipedia.org\/wiki\/Vnc\">VNC<\/a>).<\/p>\n<p>\nBecause VNC is so slow, I often ssh into my work system when I work remotely. But I want to use Remote Desktop for my Windows work as well.<\/p>\n<p>\nMy Windows system has a dynamically-attributed IP address and no fixed name (it&#8217;s not &#8220;on the domain&#8221;). I also have a Remote Desktop session running on my work Mac.<\/p>\n<p><h3>lsof<\/h3>\n<p><code>lsof<\/code> (list open files) not only lists open files by all processes, it also lists open ports. Once you know that the Windows Remote Desktop port is called <code> ms-wbt-server<\/code>, all you need to do is:<\/p>\n<pre>\n    % lsof | grep ms-wbt-server\n    <i>-> Remote      220 philippec    9u    IPv4 0x8977e64       0t0       TCP 120.151.251.57:49161->120.151.248.213:ms-wbt-server (ESTABLISHED)<\/i>\n<\/pre>\n<p>Voil&agrave;! The address of the remote Windows system is <code> 120.151.248.213 <\/code>.<\/p>\n<p>\n<i>Parsing this through awk to extract the IP address for scripting purposes is left as an exercise to the reader&#8230;<\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft&#8217;s Remote Desktop for Mac is a great piece of software (Remote Desktop on Windows is way ahead of the Mac, which is slow and based on VNC). Because VNC is so slow, I often ssh into my work system when I work remotely. But I want to use Remote Desktop for my Windows work [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-quickie"],"_links":{"self":[{"href":"http:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/developer.casgrain.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12"}],"version-history":[{"count":0,"href":"http:\/\/developer.casgrain.com\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions"}],"wp:attachment":[{"href":"http:\/\/developer.casgrain.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/developer.casgrain.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/developer.casgrain.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}