The -L 34567:localhost:5900 ssh option will create an encrypted ssh tunnel connecting the local Mac's port 34567 to the remote Mac's port 5900 (the remote Mac's VNC port). At no time will your remote Mac's VNC port be exposed to the internet, as you will not have opened 5900 on your router. VNC is a graphical desktop sharing system that allows you to remotely control the desktop interface of one computer (running VNC Server) from another computer or mobile device (running VNC Viewer). VNC Viewer transmits the keyboard and either mouse or touch events to VNC Server, and receives updates to the screen in return. Enable VNC viewers may control screen with password.; Enter a strong password. Click OK to save your settings.; Your Mac is now running a VNC server and can be connected to from other computers using the standard VNC port (TCP/IP port 5900). Apr 05, 2020 Tap the icon to the right of your Mac's name in Jump. Edit the auth row on iOS or VNC Authentication row on Android make sure it says: vnc password. Save your settings and try connecting again. This time you should be prompted for your VNC Password. Enter it to connect.
The -L 34567:localhost:5900 ssh option will create an encrypted ssh tunnel connecting the local Mac's port 34567 to the remote Mac's port 5900 (the remote Mac's VNC port). At no time will your remote Mac's VNC port be exposed to the internet, as you will not have opened 5900 on your router.
Accessing your Mac remotely isn’t really that difficult, if it weren’t for your resident IT-Department. You could simply open System Preferences / Sharing, enable ARD (Apple Remote Desktop) and check the VNC viewer checkbox. By doing so, your Mac starts listing on port 5900 and you could access it via any VNC viewer, like Chicken of the VNC (for the Mac), or RealVnc, or TightVnc (on Windows).
VNC is one of the very few – if not the only – cross platform solutions, allowing to access a Mac from a Windows box or vice versa. However, opening a server port is usually unacceptable and not tolerated by your IT folks – for a good reason, I might add.
OSXvnc to the rescue
Fortunately, there is the OSXvnc open source project, while providing only a subset of Apple’s ARD, it has the nice feature, allowing the server to make the initial communication request.
Usually, you open port 5900 on the machine you would like to remotely control. That machine starts to listen for request from a vncviewer, on the predefined port. In this case, like with almost all clients, the viewer initiates the communication.
OSXvnc allows you to enter an IP address and by clicking the Add button, let the vnc server call the client (the vncviewer). Obviously, to make this work, the vncviewer would have been started in listening mode on the machine with the given IP.
Now, there is a little problem that still needs to be resolved: OSXvnc needs user interaction (clicking the add button), to make it initiate the connection. A really short shell script installed as a daemon however helps us to work around this issue.
To make it clear how this all works, lets create a common scenario:
A PowerMac G5 that we want to remotely control is located in the office, behind a tight corporate firewall.
A laptop we want to use as the controlling machine, runs OS X with Chicken of the VNC installed, or Windows with a VNC Viewer.
Lets start on the server-side by installing OSXvnc on the G5.
The next things we need to do is find a port that is open for outbound traffic. Some companies have all ports above 1024 open for outbound, outhers are more restrictive. However, usually there are some ports left open. E.g., if you can browse the Internet, port 80 is open for outbound traffic. To continue with our common scenario, let’s assume port 8200 would be open for outbound traffic.
The remaining part of the information-gathering phase is to find out about your IP address at home. This IP and the outbound port will have to be configured in this shell script:
The script simply checks if there is currently an established connection on the predefined port, in which case it would do nothing. If there isn’t a connection going, it first kills any previously started OSXvnc processes and then trys to initiate a connection on the predefined port to the predefined IP address.
We install the script in a place like /Library/SysScripts
on the G5 and don’t want to forget to give it execute rights.
The last thing that remains to be done on the server, is to deploy this script as a daemon and make it execute frequently. Tools like lingon are great for doing this. Here is the descriptor I ended up with in /Library/LaunchDaemons
, which polls for a client every 15 seconds.
Find out more about launchd, what it does and where to deploy the descriptors here: http://developer.apple.com/macosx/launchd.html
After this is done, OSXvnc trys to call your home IP address on the defined port every couple of seconds. All what is left to do now is forward the request from your Router at home to your laptop and start your vncviewer in listing mode.
How to forward a port (8200 in our example) to your Laptop, depends pretty much on your router. In any case, since OSXvnc sends the connection request, we need to make sure the calls arrive at machine running the vncviewer. Last thing left is starting the vncviewer. Windows folks do this via the command line, likevncviewer -listen 8200
Vnc Port For Mac Osx
Mac users using Chicken for the VNC, use the GUI.
Outlook for mac updates. No later than 15 seconds after starting the viewer in listening mode, you will look at your office-computer’s screen …
Connecting to the built-in Mac VNC server from a Windows machine
A little-known fact about Mac versions 10.4 (Tiger) and over, is that they come with a built-in VNC server. This feature is included in a couple of the “Sharing” options and can be accessed with a regular VNC viewer/client.
However, when connecting from a Windows machine (particularly when running TightVNC as the viewer), I found I had to configure a few extra settings to make it work without constant freezes on my Mac, forcing me to hard reset. Here are some of the tweaks I had to make to ensure I could connect without issues. Adapter for mac. I am running 10.7.5 (Lion), so your steps may vary slightly.
Vnc Port Forwarding Mac
Firstly, you need to allow VNC connections. The two options are either Screen Sharing or Remote Management. Screen Sharing is what the “average” VNC user may need, while the latter is helpful if you need more permissions and control over the host machine.
Allowing VNC connections:
- Step 1 – Go to your System Preferences and under the Internet and Wireless heading, click on Sharing.
Step 2 – Enable either the Screen Sharing or the Remote Management checkboxes.
Step 3 – Click on Computer Settings and enable “VNC viewers may control screen with password.”
Step 4 – Provide a password and click “OK”.
(Only for Remote Management)
Step 5 – Click on Options and enable any other permissions you may need.
Vnc Port For Mac Os
You should now have a VNC server running on the standard port 5900 of your machine. You should (in theory) be able to connect to your Mac with any viewer using your machine’s IP address and the port. As I mentioned before, I had some issues connecting from Windows, and had to take a few precautions. I’m using TightVNC, so these changes may or may not be necessary on other viewers.
Tweaks for Windows:
- To prevent receiving a patterned, gray screen after the login, be sure to logout of your current user on your Mac first. The viewer will prompt for a password, but once connected, will not display the actual desktop unless no users are logged in on the host.
- In the Options menu:
- Enable “Disable clipboard transfer.” This was a major issue that would cause freezing immediately upon on connect unless enabled. Of course, you will not be able to share the clipboard across the host and client machines, but at least the host machine will continue running properly.
- Set the “Preferred Encoding” to either “Raw” or “ZRLE”. The other options appeared to work, but seemed to cause some minor freeze-ups on the Mac.
- Oftentimes after closing the viewer, the Mac would freeze yet again, requiring a reset. One workaround is to click the “Pause” button (double red bar) in the active Viewer before closing the connection. Have not yet gotten a chance to look into why this works, but it seems to solve the problem for the time being.
Following these steps should help ensure you can connect to your Mac from a Windows machine. Just enter <host IP>:5900
as the Remote Host and enter the password from before to connect.
Of course, another option is to simply user a third-party VNC server, but if you don’t feel like installing more software, hopefully this should help in preventing a few headaches.
Vnc Port For Mac High Sierra
Igor Shults