Wednesday, November 17, 2010

Screen Sharing from Ubuntu to OSX

OXS has a great feature where all the local (and remote macs if you use Back to My Mac) appear in the finder on the left side bar. If the Mac supports screen sharing, you can connect to it there, along with the normal file sharing options.

Well Mac screen sharing is just VNC will Bonjour. Ubuntu supports both VNC natively and Bonjour through Avahi.

So how do we get an Ubuntu system listed in OSX's sidebar and connect with screen sharing? Well its pretty easy, but not obvious.

1. As su edit the /etc/avahi/avahi-daemon.conf:
sudo vi/etc/avahi/avahi-daemon.conf
change the line:
#domain-name=local
to:
domain-name=local

OSX uses the domain local out of the box for mdns/bonjour/zeroconfig. Linux uses what ever domain you use when you set up your host. Changing the avahi-daemon file overides your domain, and puts you on the local domain with your Macs.

2. Enable VNC.
In Ubuntu goto System | Preferences | Remote Desktop
Check the box for "Allow other users to view your Desktop."
Uncheck (if you wish) "You must confirm each access to this machine."
Check "Require the user to enter this password."
Set the password.
Close the Window.
This is what it should look like:


3. Test!
On OSX open up a finder window. You should see under the shared heading on the lefthand side USERS's remote desktop on UBUNTUHOST, where USER is the name of your user account in ubuntu, and UBUNTUHOST is the name of your ubuntu system.
Here is what it looks like on my system:


Now hit the Share Screen button at the top right of Finder. You will get a log in prompt. Enter the password you used when you set up Remote Desktop in ubuntu:


You should then get a screen sharing window showing your ubuntu desktop:


4. Limitations.
Screen sharing on ubuntu is a tad different the OSX. In OSX the screen is shared by the OS before any user logs in, so you can connect to your OSX system and then log in as any user. OSX also uses User authentication for screen sharing. Your OSX username is your screen sharing username. The same is true for your password.
In ubuntu, the screen is shared by VNC after the user logs into the system. This means that a user must be logged into ubuntu before connecting with screen sharing. It also means that after you are connected the screen sharing, and you log out of your user account in ubuntu the screen sharing connection will be dropped. Also, authentication is handled by VNC, not ubuntu. There is no username, just the password you set in the Remote Desktop settings.h


No comments: