07 April 2012

Remote Desktop/VNC To Mac from PC and Visa Versa

You can use Virtual Network Computing (VNC) or RDP (Remote Desktop Protocol) for this purpose. RDP is proprietary Microsoft software and whilst it is arguably faster VNC is more widely supported. Personally I use RDP to connect to the PC and VNC to connect to the Mac.

Mac from a PC via VNC
  1. On the Mac:
    1. Apple Logo top left: System Preferences
    2. Internet & Wireless, Sharing:
      1. Tick Screen Sharing
      2. Note the IP address: “Other users can access your computer at vnc://192.168.0.3”
      3. Click Computer Settings and select “VNC viewers may control screen with password” then enter a password (this is for VNC only and does not have to be your Mac username password).
      4. Select which users have access
      5. Optionally click the lock at the bottom to prevent accidental changes.
  2. On the PC
    1. Install a VNC client e.g. TightVNC
    2. Run the viewer and enter the IP address noted above (NB no vnc:// prefix or port number suffix).  
    3. It should challenge you for a password (not username). If you get "Server did not offer supported security type!" then you have not ticked “VNC viewers may control screen with password” mentioned above.
    4. (Optional) Create a shortcut: right click and hold down on the Viewer in the Start menu, dragging it onto the desktop then select '”Create Shortcut here”. Right click on the created shortcut and select Properties then change the target: remove everything but the program name (e.g. tightvnc.exe) then add a suffix afterwards of a space followed by the ip address or host (Mac) computer name.
PC from a Mac via RDP
In my opinion this is by far the easiest method of connecting to a PC from a Mac.
  1. Install Microsoft Remote Desktop Connection Client for Mac from here
  2. Type the IP or host (computer) name.
  3. If you need to "Press Ctrl Alt Del to log on" the keys are Ctrlm Apple/Cmd and Forward Del. 
  4. You should be challenged for username, password and domain. Enter them and click connect.
PC from a Mac via VNC
  1. On the PC
    Windows doesn’t have an inbuilt VNC server, relying instead on the MS Remote Desktop functionality, so first you need to install and configure a VNC server to connect to:
    1. Install a VNC Server
      1. Install a VNC server e.g. TightVNC
      2. Start the VNC server as a service. This is slightly different depending on which server you choose but for TightVNC it is:
        1. Start Menu, All Programs, TightVNC, TightVNC Server (Service Mode), Register TightVNC Service
        2. Start Menu, All Programs, TightVNC, TightVNC Server (Service Mode), Start TightVNC Server
      3. Open the VNC Server configuration to set the password for access and the display port number: For TightVNC this is: Start Menu, All Programs, TightVNC, TightVNC Server (Service Mode), TightVNC Service - Control Interface
      4. Open the firewall for your VNC server (just for local connections i.e. not internet):
        1. Click Start and type firewall [return]. This should bring up Windows Firewall with Advanced Security.
        2. Select Inbound Rules and look for TightVNC in the list. There should be entries
    2. Find your IP address:
      1. Click start and type cmd [return] A black command line window should appear.
      2. Type: ipconfig [return]
        A whole stream of information should come up about each network connection. Windows has multiple “adapters” so there will be more listed than physically on your machine.
      3. Get the IP: If you are on wireless you are looking for “Wireless LAN adapter Wireless Network Connection”, if you are wired then “Ethernet adapter Local Area Connection”. The IP address is the number listed after “IPv4 Address…”
    3. Take a deep breath.
  2. On the Mac
    1. Go to Finder, Go, Connect to server.
    2. Type vnc://192.168.0.3:10 i.e. vnc://[IP address of the PC]:[port number set above] 
    3. i.e. vnc is the protocol, the IP address then a colon, then the port number set in the VNC server configuration.
    4. Type your password set above and you should be able to connect.

Troubleshooting
Remote connections can be a pain to troubleshoot because they either work or they don’t, often providing little or no information about why they fail. Some things to check or try are:
  • LAN connection: are both machines connected to the same LAN and have IP addresses: they shoudl be the same except for the last digit e.g. 192.168.1.5 and 192.168.1.6
  • Firewalls: if you are behind an internet firewall on a small known (e.g. home) network  it is OK to temporarily disable your firewall whilst you try and get it working, being sure to turn it back on afterwards.
  • Port number for VNC: Double check the port number of your viewer: when connecting from Mac to PC you need to enter a colon after the IP address and then a port number e.g. 5900 When connecting the other way round you do not.
  • Protocol for VNC: when connecting from Mac to PC you need to enter vnc:// before the IP address, when doing it the other way round you do not.
  • If the screen looks fuzzy it’s probably being reduced in size: increase the window size or select 100% on your viewer.
  • If the connection is slow then check your LAN connection and or hub.

3 comments:

  1. Hi,
    Great post! I would like to do this (control a mac through a PC) but I'd like to do it locally. So, not through the internet but through a direct ethernet connection. Would that be possible?
    Cheers

    ReplyDelete
  2. Very good article in regards to establishing remote connection between MAC and PC and vice versa. In addition to above, one may even consider deploying on premise RHUB or Bomgar remote support appliances in order to remotely access computers from anywhere.

    ReplyDelete
  3. Very good post. In addition to above, on premise RHUB remote support appliances can also be deployed for establishing remote connection between PC and MAC computers.

    ReplyDelete