Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to VNC into a Mac OSX machine. I can SSH in fine. The VNC server is misbehaving, and I'm tempted to restart it. However I don't want to do that if someone is using it now. Is there any way to see from the command line if anyone else is logged in in VNC? Doing w shows no-one else logged in over SSH. Is there something like that for VNC?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You could see who is connected via VNC by using netstat on the machine in question:

netstat -a | grep vnc

If any connections are established, the 5th column gives you the remote IP address of the connection.

share|improve this answer
    
Ah yes, very clever, that would do it. –  Rory Jun 29 '09 at 11:34

VNC mirrors an existing desktop. It does not constitute a login that would show up.

You can check with ps auxc whether a VNC instance is running. Some VNC servers start a process if a user is logged in, I think.

Or you can VNC to the box and see if the mouse pointer moves.

The only way someone can be using VNC in the background is if the machine is using fast user switching and the user himself has a VNC server running. But then you don't want to restart his VNC server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.