Easy access to your Pi from Windows using MobaXterm


40 posts   Page 1 of 2   1, 2
by billb » Tue Oct 30, 2012 4:21 pm
There are a number of ways to access the terminal and/or "desktop" of your Raspberry Pi from Windows over your local network. This method requires no setup at all on the Pi side, and an application -- MobaXterm -- that doesn't require installation on the Windows side.

Requirements:

- A recent version of Raspbian (2012-09-18 or newer. May require additional steps on older versions or other distros.)
- Windows XP, Vista, or 7 on the Windows machine (haven't tried this with Windows 8 yet)
- Both the Pi and the Windows machine connected to the same local network

0. You need to know the IP address of your Raspberry Pi. It's possible to determine the IP address without having a display connected to your Pi, but to keep this simple I'm going to assume you have a display connected. Enter this command at the terminal prompt on the Pi:

Code: Select all
ip address show

(if you really don't like typing, just ip a will work)

Assuming you're not using wireless on the Pi, you want the address listed under eth0 right after inet. It will look something like this:

inet 192.168.1.12/24

In this case, the ip address is: 192.168.1.12

This will vary depending on your router and how your network is set up.

This is all you need to do on the Raspberry Pi -- there's no need to install anything else or change anything.


1. Download MobaXterm personal/home edition from:

http://mobaxterm.mobatek.net/download-home-edition.html


2. Extract the MobaXterm_Personal_6.0.exe file from the zip archive. I would recommend saving it to it's own folder because it creates a MobaXterm.ini file in the same folder as the exe file. You can save it to your Desktop, a flash drive, or wherever you want. The MobaXterm.ini file stores your settings.


3. Launch MobaXterm by double-clicking the MobaXterm_Personal_6.0 icon (there's no install process -- it runs straight from the exe).


4. In the MobaXterm window, click on Sessions -> New session.


5. In the Session settings window, it will say "Choose a session type..." Click on SSH.

On the SSH settings tab that shows after you click on SSH, enter the IP address for your Raspberry Pi from Step 0 above. Click OK.

5a. On Windows 7, you'll most likely have a window pop up and say:

"Windows Firewall has blocked some features of this program"
Name: Xwin

You'll need to click on Allow access (for private networks).

5b. On Windows XP, you'll most likely have a window pop up and say:

"Do you want to keep blocking this program?
Name: XWin"

You'll need to click on Unblock.


6. You should be back at the main MobaXterm window with a new tab showing the IP address of your Pi and [SSH]. Enter your username and password to login. The default on Raspbian is username pi, password raspberry

If all went well you should be at a command prompt: pi@raspberrypi ~$


7. To bring up the desktop, enter this command at the prompt:

Code: Select all
lxsession&


You can also launch applications separately without running the whole desktop. For example, try opening the text editor:

Code: Select all
leafpad&

(the & on the end launches the application in the background so you can continue using the terminal)

That should be it. Note that by default this is multi-window, so whenever you launch a new program it runs in a new window. In addition to the ability to show the "desktop" or various applications in their own windows, you also have the ability to drag/drop files to and from your Pi in the bottom left corner of the MobaXterm window.

What you're actually doing is forwarding X11 over an ssh tunnel to MobaXterm's X server, and using sftp for file transfers. But that sounds too complicated. ;)

See the MobaXterm documentation for more info:

http://mobaxterm.mobatek.net/support/documentation.html
User avatar
Posts: 175
Joined: Wed Sep 19, 2012 10:27 pm
by Forrrge » Tue Oct 30, 2012 5:34 pm
Brilliant program, love it.

For info I use "Advanced IP Scanner" which shows me everything connected to my network, its easy to spot the RPi as it will show in the manufacturer column as "Raspberry Pi Foundation". You can then right click on that line, copy the ip address and paste it into your SSH session.
User avatar
Posts: 72
Joined: Fri Apr 27, 2012 6:07 am
Location: Gateshead, UK.
by bgirardot » Tue Oct 30, 2012 6:40 pm
Very helpful. I had just downloaded MobaXterm based on the another forum members comment about it.

I have a dumb question: How do you cleanly close the session?

Logging out and/or clicking the close button on the main pi desktop window didn't seem to do the job.
Posts: 517
Joined: Wed Oct 10, 2012 6:20 am
Location: Switzerland
by billb » Tue Oct 30, 2012 7:08 pm
bgirardot wrote:I have a dumb question: How do you cleanly close the session?


Not a dumb question -- I'm still trying to work that out, myself! :mrgreen: I think what's happening is the desktop is automatically restarting every time you close it. :?: From what I've read in another tutorial, I'm guessing we may need to edit /etc/lightdm/lightdm.conf to change this behavior so it gives you a greeter screen on logout. Haven't tried it yet, though. For now I've just been closing the MobaXterm window when done.

Also, in practice, I'm finding it useful to just launch whatever application I need from the MobaXterm terminal (as with the leafpad example) instead of running the whole desktop.
User avatar
Posts: 175
Joined: Wed Sep 19, 2012 10:27 pm
by sanjaysy » Wed Oct 31, 2012 8:26 am
hello,

is it mandatory to set a static IP in raspberry Pi or it can connect to a dynamic IP if we know Raspberry Pi IP somehow.

regards,
Sanjay
Posts: 7
Joined: Sat Jul 28, 2012 4:08 pm
by Forrrge » Wed Oct 31, 2012 9:06 am
sanjaysy wrote:hello,

is it mandatory to set a static IP in raspberry Pi or it can connect to a dynamic IP if we know Raspberry Pi IP somehow.

regards,
Sanjay

You can use "Advanced IP Scanner" to get the IP address, thats what I do, my RPi does not have a static address.
User avatar
Posts: 72
Joined: Fri Apr 27, 2012 6:07 am
Location: Gateshead, UK.
by toxibunny » Wed Oct 31, 2012 10:10 am
Mobaxterm is what I'm using. It's good stuff.
note: I may or may not know what I'm talking about...
Posts: 1120
Joined: Thu Aug 18, 2011 9:21 pm
by sumith » Sat Nov 03, 2012 1:10 pm
wow! amazing! Thanks a lot
Posts: 11
Joined: Tue Sep 11, 2012 12:23 pm
by ghans » Sat Nov 03, 2012 4:03 pm
I forgot to mention that MobaXTerm has a little inbuilt
SFTP explorer ...
Yes , this is really a nice freeware gem.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4536
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by omiez » Sun Nov 04, 2012 3:02 am
Nice thing accessing without using vnc or similar.

Is there a way to access the pi from remote, ex. from the office,using this program and a redirect service?
Nr.1 Raspberry Pi Mod.B Rev.2 256Mb Ram (Raspbian)

Raspberry Pi Mod.B Rev.2 512Mb Ram (Maybe i´ll get one)
Posts: 134
Joined: Sun Sep 30, 2012 10:10 pm
Location: Brasil
by billb » Sun Nov 04, 2012 4:35 am
omiez wrote:Is there a way to access the pi from remote, ex. from the office,using this program and a redirect service?


I don't see why not, although it gets more complicated. You'd probably want a static ip address set on the Pi and tell your router to forward port 22/tcp (used by ssh) to that address. And probably deal with more firewall settings. And make sure you use something other than the default username/password (pi/raspberry). And you may need to use some sort of dynamic dns service since you're not likely to have a static ip address for your home internet connection (some routers have this capability included).
User avatar
Posts: 175
Joined: Wed Sep 19, 2012 10:27 pm
by sumith » Mon Nov 05, 2012 10:48 am
Hi,

I can access my raspberry pi with image 18-09-2012 with MobaXterm. I can see live video using MobaXterm on windows system. But for a program which requires root permission, the program exits with a message showing *can not open gtk -display*. It exits after the command cvNamedWindow("OUT", 0);

I would like to know how I can solve this?

Thanks in advance.
Posts: 11
Joined: Tue Sep 11, 2012 12:23 pm
by tomexx » Mon Nov 05, 2012 6:18 pm
How about PuTTY?
It's simple to use and there's no installation. I'm running my pi without mouse, kb or monitor.
http://www.putty.org Try it!

Tom
Posts: 106
Joined: Thu Nov 01, 2012 4:58 pm
Location: Kitchener, ON, Canada, Earth
by ghans » Mon Nov 05, 2012 8:31 pm
AFAIK Putty has no integrated X server , which I believe is wanted for this use-case.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4536
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by billb » Mon Nov 05, 2012 10:06 pm
sumith wrote: But for a program which requires root permission, the program exits with a message showing *can not open gtk -display*. It exits after the command cvNamedWindow("OUT", 0);

I would like to know how I can solve this?


Use gksudo when launching a graphical program that requires root permission. For example, if you wanted to launch leafpad with root permission you would enter this command:

Code: Select all
gksudo leafpad &
User avatar
Posts: 175
Joined: Wed Sep 19, 2012 10:27 pm
by sumith » Tue Nov 06, 2012 4:41 am
Thank you very much
Posts: 11
Joined: Tue Sep 11, 2012 12:23 pm
by dlonceveau » Thu Nov 08, 2012 10:33 am
Thank you very much billb! This tutorial should be pinned to the top of this forum, it is really helpful!
Thank you for pointing out this excellent MobaXterm tool!
Posts: 3
Joined: Thu Nov 08, 2012 10:25 am
by billb » Sat Nov 10, 2012 3:39 pm
MobaXterm has some other nice features in addition to the X11 forwarding and SFTP explorer -- there's a built-in Remote Desktop Protocol (RDP) client as well.

0. To connect to your Pi's desktop using RDP you'll need to install a Remote Desktop Protocol server on the Pi.

At the terminal on the Pi, enter this command to install xrdp:

Code: Select all
sudo apt-get install xrdp


There's no need to reboot when that's finished -- you should be ready to create a new RDP session from MobaXterm. Note that once you install xrdp, it will automatically load at startup from that point on.


1. In the MobaXterm window, click on Sessions -> New session.


2. In the Session settings window, it will say "Choose a session type..." Click on RDP.


3. On the RDP (terminal services) settings tab that shows after you click on SSH, enter the IP address of your Raspberry Pi in the Host box, and your username in the User box (default is pi). Click OK to connect.


Notes:

* When you exit make sure you actually log out of the LXDE session. If you just close the RDP tab on MobaXterm the Pi will still be running the desktop, screen saver, etc.

* I haven't figured out how to get back out of fullscreen mode. The default shortcut key is F11 and I can get that to work for entering fullscreen mode, but short of pressing Ctrl+Shift+Esc to bring up the task manager and manually shutting down the MobaXterm process, I can't get back out of fullscreen mode.
User avatar
Posts: 175
Joined: Wed Sep 19, 2012 10:27 pm
by dlonceveau » Wed Jan 09, 2013 9:33 pm
It seems that it is now easier to connect to the Pi using the new MobaXterm 6.1: in the SSH session settings (step 5), just choose "LXDE desktop" for the "Remote environment" setting: when launching the session, it will show the full Pi desktop in a frame!
Posts: 3
Joined: Thu Nov 08, 2012 10:25 am
by ghans » Thu Jan 10, 2013 8:06 am
They seem to have noticed where new users come from ...


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4536
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by sblar » Mon Jan 14, 2013 10:12 pm
Great tutorial and a nice feature with RDP. What I actually would like to do is to remote control the console itself, ie. have the output via HDMI to my TV. I have tried with RDP, X-tunneling and VNC without any luck, they all transfer the output to my PC.
Any ideas?
Posts: 11
Joined: Sun Dec 02, 2012 7:08 pm
by ghans » Tue Jan 15, 2013 8:58 am
AFAIK x11vnc lets you connect to Display :0 (physical desktop).


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4536
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by warwound » Tue Jan 15, 2013 9:05 am
I tried MobaXterm and it works, i ran lxsession& and that works too BUT it i have a triple monitor setup on my PC and the PI desktop is displayed spanning all three monitors.

Any idea how i'd configure the lxsession to use just one of my PC's monitors?

Martin.
Posts: 5
Joined: Thu Jan 03, 2013 7:30 pm
by allend66 » Tue Jan 15, 2013 8:49 pm
I tried this on my Rasbmc distro and I get "no session managers, no terminal managers, no window managers and no terminal emulators found.. aborting". I chose raspbmc because I want to connect it to my xbox360 and media usb-hdd to stream. Should I change distro or can someone enlighten me please?
Posts: 3
Joined: Tue Jan 15, 2013 8:10 pm
by ghans » Wed Jan 16, 2013 7:48 am
Well , the message says it : Those things are not installed by
default on Raspbmc. You could install them easily ,
but AFAIK it's impossible to remotely get what the Pi sends to the
physical screen connected to it , because XBMC directly interacts
with the video hardware or something. If somebody has
any other knowledge about this , i'd be interested.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4536
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany