Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

etaleb

macrumors 6502a
Original poster
Apr 7, 2012
651
33
Maine
folks - I'm on the same wifi network as my laptop. From my Mac mini, I can ping the laptop even if it's asleep. However, connect to computer (vnc) doesn't work. I checked the laptop's wake for network access setting and it's set to Always. How do I troubleshoot this?

I tried to do a nc -p 10.3.3.88 5900 which is my laptop IP address but the syntax seems incorrect

Thanks
 
The value following -p must be a port number. Your example shows an IPv4 address. See 'man nc' for details.

I think the correct syntax should look something like:
Code:
nc -p 6789 10.3.3.88 5900
This contacts the host at 10.3.3.88 on its port 5900, using the port 6789 on the originating host (the Mac mini, if I understand your description correctly).
 
Not sure about Macs, but other computers a require special "wake-on-LAN" network packet to get a computer to wake up from the network. Google for "ethernet wake on LAN" to get possible programs that can send this special packet.
 
So what's the use of the wake for network access setting?

Also do I need the -p 6789 in nc command (I don't care about the source port, just destination)
 
I can ping the laptop even if it's asleep. However, connect to computer (vnc) doesn't work.
What software are you using to connect with? Are you using macOS's built-in Screen Sharing (from Finder), or a third-party VNC client?

I'm not sure this is the problem, but I wouldn't be surprised if Apple's ScreenSharing.app does something that assists with the wake up of the target Mac. For example, it uses Bonjour to discover the "rfb" services available on the network, and that might play a role in waking the target computer.
 
Also do I need the -p 6789 in nc command (I don't care about the source port, just destination)
If you don't care about a source port, leave out the -p and its immediately following port number.


If you're trying to wake the target machine using the command-line, there's an example using Python 3 code in the Wikipedia page about Wake on LAN:

The given source is Python 3, which may or may not be present on a Mac by default, depending on the OS version.

Here's an example using bash, sed, and netcat (nc):
I found this by searching for: wake on lan using netcat

You could probably find more examples. Just using wake on lan showed a lot of results.
 
Last edited:
What software are you using to connect with? Are you using macOS's built-in Screen Sharing (from Finder), or a third-party VNC client?

I'm not sure this is the problem, but I wouldn't be surprised if Apple's ScreenSharing.app does something that assists with the wake up of the target Mac. For example, it uses Bonjour to discover the "rfb" services available on the network, and that might play a role in waking the target computer.
Just using Finder -> Go - > Connect to server and then typing vnc://x.x.x.x - btw, I have simply gotten vnc://x.x.x.x from spotlight to make the connection but on my Mac mini, it doesn't accept that, wonder why. I can easily do that from the MacBook Air M2
 
Just using Finder -> Go - > Connect to server and then typing vnc://x.x.x.x
Yeah, that should work.

This might be handy for troubleshooting, if it's reliable:
Also, fun tip: You can easily check if a Mac on the network is sleeping or not based on its ping response TTL. While awake it uses a TTL of 64 but while sleeping it uses a TTL of 32.
I found it here. I'd never heard that before. It seems to be true on my network, but no guarantees.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.