techforay
Posts: 47
Joined: Thu Dec 27, 2012 1:28 am
Location: Puyallup Wa. USA

Remote to Pi from Mackbook

Sun Jan 19, 2014 4:28 am

It would be very appreciated if someone could give me instructions for remote access from my macbook to the PI.

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Remote to Pi from Mackbook

Sun Jan 19, 2014 5:55 am

Take a look at this guide for using VNC to get remote access from a Mac.

Quinny
Posts: 14
Joined: Wed Jan 15, 2014 4:48 am
Location: Launceston, Tasmania, Australia

Re: Remote to Pi from Mackbook

Sun Jan 19, 2014 7:12 am

AndyD wrote:Take a look at this guide for using VNC to get remote access from a Mac.
You could also use SSH,
here is a link to help you out. This tutorial is set in Windows, i think i should be nearly the same on you mac;
http://cplus.about.com/od/raspberrypi/a ... ry-Pi.html
after you read through that, if your wanting a desktop enviroment, install Xming and type startx to open the Desktop Environment,
heres a link to Xming;
http://www.straightrunning.com/XmingNotes/
click on the checkerboard screen on the Xming program (or whatever you get) and experience remote access to your raspberry pi.
after this, you RPi is now officially a 'Headless System' meaning it does not need a monitor connected to it for it to work.
i would recommend to use your Pi this way, It takes up less time and you will also be able to research on your project while your working on it.
Hope this helps! :)

techforay
Posts: 47
Joined: Thu Dec 27, 2012 1:28 am
Location: Puyallup Wa. USA

Re: Remote to Pi from Mackbook

Mon Jan 20, 2014 5:16 am

Thank you both so much

techforay
Posts: 47
Joined: Thu Dec 27, 2012 1:28 am
Location: Puyallup Wa. USA

Re: Remote to Pi from Mackbook

Tue Jan 21, 2014 4:39 am

I am trying to use ssh to remote into pi. This is the error I got. Can someone help.


Host key verification failed.
Rays-MacBook-Pro:~ Ray$ ssh 192.168.2.41 -l pi
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
7f:86:95:9a:d3:da:21:08:b1:80:0b:6d:7f:45:c4:fe.
Please contact your system administrator.
Add correct host key in /Users/Ray/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/Ray/.ssh/known_hosts:1
RSA host key for 192.168.2.41 has changed and you have requested strict checking.
Host key verification failed.
Rays-MacBook-Pro:~ Ray$

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Remote to Pi from Mackbook

Tue Jan 21, 2014 4:46 am

techforay wrote:I am trying to use ssh to remote into pi. This is the error I got. Can someone help.
Don't panic it happens to me all the time. The simplest way to fix this is to remove the offending entry in known_hosts and then try to ssh again. So just edit /Users/Ray/.ssh/known_hosts and remove the first line.

techforay
Posts: 47
Joined: Thu Dec 27, 2012 1:28 am
Location: Puyallup Wa. USA

Re: Remote to Pi from Mackbook

Tue Jan 21, 2014 4:53 am

Is this on the pi or the macbook?

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Remote to Pi from Mackbook

Tue Jan 21, 2014 4:55 am

techforay wrote:Is this on the pi or the macbook?
On the macbook. Your macbook is complaining that the RSA key sent by your Raspberry Pi has changed. This can happen if you reinstall your OS.

techforay
Posts: 47
Joined: Thu Dec 27, 2012 1:28 am
Location: Puyallup Wa. USA

Re: Remote to Pi from Mackbook

Tue Jan 21, 2014 6:53 am

I was able to remote in but not I can't seem to get the GUI working with starts. can you help again


pi@raspberrypi ~ $ startx


X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-2-mx5 armv7l Debian
Current Operating System: Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1136 bcm2708_fb.fbheight=592 bcm2708.boardrev=0xf bcm2708.serial=0x37c3562d smsc95xx.macaddr=B8:27:EB:C3:56:2D sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait
Build Date: 18 December 2013 05:20:52PM
xorg-server 2:1.12.4-6+deb7u2 (Julien Cristau <jcristau@debian.org>)
Current version of pixman: 0.29.3
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Tue Jan 21 06:48:01 2014
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
FATAL: Module g2d_23 not found.
X.Org

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Remote to Pi from Mackbook

Tue Jan 21, 2014 7:17 am

Hi techforay,
I am glad you sorted out your problem with SSH.

I am guessing that you are using ssh to get access to your Raspberry Pi and then running startx. When you run startx it starts the X server and displays it on the monitor/tv connected to the Raspberry Pi. Are you trying to get the desktop to display on you macbook?

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Remote to Pi from Mackbook

Tue Jan 21, 2014 9:27 am

It really doesn't make any sense to run "starts" unless you are logged in on a "virtual console" - i.e., where your tty device is something like /dev/tty1 (where 1 is some simple number).

Typical of Linux (which I love dearly, don't get me wrong) that they've never fixed this - and by "fixed", I mean so that you get a simple error message like "You are not on a virtual console" and a clean exit. Instead, you get a bunch of cryptic error messages and an abort.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

techforay
Posts: 47
Joined: Thu Dec 27, 2012 1:28 am
Location: Puyallup Wa. USA

Re: Remote to Pi from Mackbook

Tue Jan 21, 2014 2:08 pm

Yes sir I am indeed trying to get my Pi to display on my Mac so I can eliminate using a monitor, keyboard and mouse. Thank you for all your help.


techforay
Posts: 47
Joined: Thu Dec 27, 2012 1:28 am
Location: Puyallup Wa. USA

Re: Remote to Pi from Mackbook

Wed Jan 22, 2014 5:20 am

Just to be clear I am an absolute rookie trying to learn something. I am trying to bring up a GUI after I remote in to pi. I can not get the to happen. Here is what i tried

Last login: Tue Jan 21 21:13:15 on ttys000
Rays-MacBook-Pro:~ Ray$ ssh -X pi@192.168.2.41
pi@192.168.2.41's password:
Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jan 22 05:11:16 2014 from 192.168.2.29
pi@raspberrypi ~ $ lxsession&
[1] 2427
pi@raspberrypi ~ $ Only one lxsession can be executed at a time

tvjon
Posts: 769
Joined: Mon Jan 07, 2013 9:11 am

Re: Remote to Pi from Mackbook

Wed Jan 22, 2014 9:56 am

"Just to be clear I am an absolute rookie trying to learn something"

That's fine, we all have to learn......

I've just logged into a RPi running the same 3.10.25+ as you from a macbook fine, but typing:

/etc/X11/Xsession

from Terminal in OS X, rather than:

lxsession.

You can also type the name of a program you want to run instead of the full desktop.

You don't point out which flavour of OS X your macbook is using? I access RPi's from mac's running 10.7.5 (Lion) & Snow Leopard, 10.6.x.

I don't yet have Mountain Lion, or Mavericks, so if you're running either of those, read through that thread because you may need to download another piece of software which is perhaps absent on the most recent OS X's.

I also sometimes do the same when a mac isn't available, but from an iPad running iSSH. It's not quite as fast though navigating via the touch interface.

I hope you get it running, as I find it much better than using VNC, almost the same speed as directly using the RPi, even from an old mac mini, & (in my case) no extra software to install on either machine.

techforay
Posts: 47
Joined: Thu Dec 27, 2012 1:28 am
Location: Puyallup Wa. USA

Re: Remote to Pi from Mackbook

Wed Jan 22, 2014 4:26 pm

Thank you again. I will try what you suggested. I an running mavericks. I tried reading through the thread but most of it is beyond my current understanding. I hope to improve that.

techforay
Posts: 47
Joined: Thu Dec 27, 2012 1:28 am
Location: Puyallup Wa. USA

Re: Remote to Pi from Mackbook

Thu Jan 23, 2014 4:18 pm

We'll thanks to you all i got it working by installing XQuartz on my Mac. I can now work from the GUI but the progra "scratch" gets locked up when try to use it. It never loads. My memory max's out and I have to kill the program with task manager. When I first booted the OS before I reconfigured it booted into scratch and it worked fine. How can I fix this. Not sure how to remove and reinstall programs.

JRod3000
Posts: 1
Joined: Thu Jun 26, 2014 6:16 pm

Re: Remote to Pi from Mackbook

Thu Jun 26, 2014 6:26 pm

In regards to the error:

"Only one lxsession can be executed at a time"


I kept getting this error when entering ssh -x pi@192.168.2.2 to access the Raspberry Pi via Xwindow on OSX. Entering -x disables X11, where as -X enables it. The correct code is

Code: Select all

ssh -X pi@192.168.2.2 
To a more experienced programmer I am sure this would have been obvious, but It took me about an hour to find this solution. I hope this helps.

RiPi
Posts: 1
Joined: Sun Oct 26, 2014 10:59 am

Re: Remote to Pi from Mackbook

Sun Oct 26, 2014 11:09 am

If you want a GUI then you don't need SSH, that is command line, you need VNC installed :)

1. Open LX terminal
2. In LX terminal type in "sudo apt-get update" to update the operating system to the latest version
3. When prompted to update type in "y" and press enter
4. After updating is complete type in "sudo install tightvncserver". Press "y" and hit enter when prompted
5. Once tight VNC server has completed installation you can start it by typing in "vncserver:1"
6. It will prompt you to create a password. Keep in mind passwords can be at MOST 8 characters long.
7. Once you have entered a password you are done! The VNC server is now running in the background of your Raspberry Pi's operating system. Now you can use any computer on your network with a VNC client to remotely access the Raspberry Pi

Now to start it on bootup of Pi,

Log into a terminal on the Pi as root:
sudo su
Navigate to the directory /etc/init.d/:
cd /etc/init.d/
Create a new file here containing the following script:
### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO

#! /bin/sh
# /etc/init.d/vncboot

USER=root
HOME=/root

export USER HOME

case "$1" in
start)
echo "Starting VNC Server"
#Insert your favoured settings for a VNC session
/usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565
;;

stop)
echo "Stopping VNC Server"
/usr/bin/vncserver -kill :0
;;

*)
echo "Usage: /etc/init.d/vncboot {start|stop}"
exit 1
;;
esac

exit 0
Save this file as vncboot (for example)

Make this file executable:
chmod 755 vncboot
Enable dependency-based boot sequencing:
update-rc.d /etc/init.d/vncboot defaults
If enabling dependency-based boot sequencing was successful, you will see this:
update-rc.d: using dependency based boot sequencing
But if you see this:
update-rc.d: error: unable to read /etc/init.d//etc/init.d/vncboot
then try the following command:
update-rc.d vncboot defaults
Reboot your Raspberry Pi and you should find a VNC server already started.

Now on your Mac/Tablet/Windows laptop/Phone download a VNC Client. Connect to 192.****.*.***:1 with the password and you have your GUI on any device

Return to “Beginners”