Sharing the Pi Screen on a Mac
You have set up VNC, but would like to share the screen on your Raspberry Pi as if it were another Mac on your network.
First, follow Recipe 2.8 to install VNC. You will also need to complete Recipe 2.9.
Then enter the command:
$ sudo nano /etc/avahi/services/rfb.service |
and paste the following into the editor:
<?xml version=”1.0″ standalone=’no’?> <!DOCTYPE service-group SYSTEM “avahi-service.dtd”> <service-group> <name replace-wildcards=”yes”>%h</name> <service> <type>_rfb._tcp</type> <port>5901</port> </service> </service-group> |
Now enter the command:
$ sudo /etc/init.d/avahi-daemon restart |
You should now be able to see the Share Screen option shown in Figure 2-9. When prompted for a password, use the password you set up for VNC, not your general Raspberry Pi password.
Discussion
This recipe just adds a little convenience to the process of sharing the screen of your Raspberry Pi.
If you have more than one Raspberry Pi on your network, you need to give them different names so that you can identify them on the network (Recipe 2.4).
If you are a Windows or Linux user, you can still connect to a Raspberry Pi using VNC (Recipe 2.8).
See Also
The instructions here were adapted from this tutorial, which credits Matt Richardson and Shawn Wallace’s book Getting Started with Raspberry Pi (O’Reilly) as the original source.