Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screen sharing between Raspberry PI and Mac OSx [closed]

Tags:

I want to use the Screen Sharing OSx built-in App to manipulate the actual X session open in my Raspberry PI.

Just to be clear I want to see in my VNC session the same image the Raspberry is sending through the HDMI. So I can move the mouse in my computer and the cursor is also moving in the Raspberry screen.

I have tried several combinations of vnc-servers and configs but neither have worked.

like image 673
fguillen Avatar asked Sep 02 '15 19:09

fguillen


People also ask

How do I get my Raspberry Pi screen to show on my Mac?

Open the Screen Sharing App and enter your Raspberry Pi's IP Address on your Mac. Click Connect when done. The Screen Sharing App will ask you for a password, enter the password you set for the VNC Server's Standard User. Click Sign In!

How do I enable screen sharing on OSX?

Turn on screen sharing on your Mac On your Mac, choose Apple menu > System Preferences, then click Sharing . If Remote Management is selected, deselect it. You can't have both Screen Sharing and Remote Management on at the same time. Select the Screen Sharing checkbox.

Can I use Raspberry Pi with MacBook?

Plug one end of your ethernet cable into the ethernet port on the Raspberry Pi, and the other into your computer ethernet port. On your MacBook Air you may need and ethernet cable adapter. Next, power the BrickPi up. You should see the “PWR” LED solid, and the “ACT” LED on the Raspberry Pi begin to blink (not solid).

Can you share screens with Mac and PC?

Make sure all your Mac and Windows PC are connected to the same wi-fi network. Step 1 Open System Preferences - Display on your Mac. Check "Show mirroring options in the menu bar when available". Click blow icon on the top right corner of your Macbook and choose the Windows you want to mirror to from the list.


1 Answers

As I have spent several hours solving this I so answer my self in case someone needs the instructions as I would wanted to find them.

First, the most popular vnc-server (tightvncserver) is not fullfilling my specification that the X-session has to be the same in my VNC client App and in the Raspberry screen.

The vnc-server that does the work is x11vnc

Install x11vnc

sudo apt-get install x11vnc 

Looks like it requires you to set up a password:

x11vnc -storepasswd 

Test installation and connection

You can already start the vnc-server:

x11vnc -forever -usepw -display :0 -ultrafilexfer 

Check the service is active and listening

$ sudo netstat -nlp | grep vnc tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      2575/x11vnc   

And connect from your Mac just opening Screen Sharing and introducing the Raspberry's ip:

enter image description here

Make x11vnc to start on boot

Config:

# ~/.config/autostart/x11vnc.desktop [Desktop Entry] Encoding=UTF-8 Type=Application Name=X11VNC Comment= Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer StartupNotify=false Terminal=false Hidden=false 

Be sure there is not problems to access to this file:

sudo chmod a+r ~/.config/autostart/x11vnc.desktop 

Make the Raspberry to be visible in the sharing network of the Mac

sudo apt-get install netatalk sudo apt-get install avahi-daemon sudo update-rc.d avahi-daemon defaults 

Config:

# /etc/avahi/services/afpd.service <?xml version="1.0" standalone='no'?><!--*-nxml-*--> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group>    <name replace-wildcards="yes">%h</name>    <service>       <type>_afpovertcp._tcp</type>       <port>548</port>    </service> </service-group> 

Config 2:

# /etc/avahi/services/rfb.service <?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>5900</port>   </service> </service-group> 

Restart service:

sudo /etc/init.d/avahi-daemon restart 

Finding the Raspberry from your Mac

Using Finder into the section Shared > All... should be your Raspberry. From there you can click in the button Share Screen...

enter image description here

like image 130
fguillen Avatar answered Oct 14 '22 20:10

fguillen