Page 1 of 1

How to startx from remote machine?

Posted: Sat Jun 08, 2013 2:15 am
by liudr
Total noob question: to access my raspberry pi I installed Debian on my spare machine. I thought I could SSH to pi and startx to see graphical interface of the pi. The terminal window just hangs with the following message and no graphical interface came up :lol:

So how do I bring up the GUI on my remote machine? Thanks.
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708.boardrev=0xe bcm2708.serial=0x674abdd4 smsc95xx.macaddr=B8:27:EB:4A:BD:D4 sdhci-bcm2708.emmc_clock_freq=100000000 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/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Build Date: 10 December 2012 05:45:57AM
xorg-server 2:1.12.4-4 (Julien Cristau <jcristau@debian.org>)
Current version of pixman: 0.29.1
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: Fri Jun 7 20:49:26 2013
(==) Using system config directory "/usr/share/X11/xorg.conf.d"

Re: How to startx from remote machine?

Posted: Sat Jun 08, 2013 4:11 am
by malakai
I like Xming but the more popular would probably be MobaXTerm so the short answer is you need something beyond an SSH client instructions can be found here Moba is as the very bottom http://www.raspians.com/knowledgebase/h ... and-putty/

Re: How to startx from remote machine?

Posted: Sat Jun 08, 2013 6:10 am
by liudr
Thanks malakai. I downloaded mbaxterm on my pc and it does exactly what you said. On the other hand, I originally wanted to remote login from a Debian machine to pi. I couldn't startx. Should I do lxsession& instead? That machine is turned off so I will try tomorrow. What is the difference between startx and lxsession?

Re: How to startx from remote machine?

Posted: Sat Jun 08, 2013 8:00 am
by redhawk
Startx runs locally on the Pi it cannot provide X-Windows support remotely which is why you need an X11 emulator like MobaXTerm or Xming.
Running Pi apps on the Debian box should be possible and I'm sure such information is documented on the internet somewhere.
You basically need to run startx on your Debian box, tweak your security settings (xhosts??) since normally X-Windows rejects incoming connections from a remote machine.
Then open a terminal window and login to the Pi machine followed by the following command: export DISPLAY=192.168.1.100:0.0 (assuming your Debian box is 192.168.1.100).
Now you can enter the program name from your terminal window and hopefully you won't get "cannot open display" error messages.

Richard S.

Re: How to startx from remote machine?

Posted: Sat Jun 08, 2013 8:31 am
by Joe Schmoe
Actually, the real answer to this question is either:

1) simple version - allows you to run individual X apps and have them displayed locally:

Code: Select all

ssh -X pi@pisIPaddr
or

2) Complicated version that makes you think you're actually running something like Microsoft Windows (i.e., gives you that "desktop feeling"):

Install "x11vnc" (not "tightvnc") on the Pi, then use vncviewer from either Windows or Linux to "see the desktop".

P.S. In any case, yes, the real point is that running "startx" from anything other than a virtual console is a "non-starter".

Re: How to startx from remote machine?

Posted: Sat Jun 08, 2013 8:44 am
by WebPi
You could use the Windows Remote Desktop Client. To install the Remote Desktop protocol on your Pi, open a terminal and type

Code: Select all

sudo apt-get install xrdp 
Then go to the Start menu on your Pc, all programs, accessories, and click on Remote Desktop Connection. You can see full instructions here: http://webpi.tumblr.com/post/4886638816 ... to-your-pi

Re: How to startx from remote machine?

Posted: Sat Jun 08, 2013 3:28 pm
by liudr
Thank you everyone. I tried in my Debian box to ssh with -X option to open X11 forwarding and then ran Arduino IDE by typing:

Code: Select all

arduino&
The process was pretty slow to start but once it started it was alright. Opening another program in Arduino was acceptable in speed.

Re: How to startx from remote machine?

Posted: Sat Jun 08, 2013 3:38 pm
by liudr
The blink example code in arduino compiles in 30 seconds (compared with 3 seconds on my Debian box with Core 2 Duo 2.4GHz and 3GB RAM). It uploads just fine and Arduino is blinking an LED :)

I think I will now be able to develop code, both arduino and c/c++ on Debian, on my Debian box, and then copy c/c++ code to pi to compile. I have heard of crosscompiling that can compile binary that runs on a different architecture. I don't know how to set that up yet. Will ask at a later time. Now to look for a suitable c/c++ IDE for debian :)

Re: How to startx from remote machine?

Posted: Sat Jun 08, 2013 4:22 pm
by liudr
I used ssh -X to connect to pi and did lxsession. It kind of works. A task bar shows up on my Debian box, blocking its original task bar (annoying) I can do everything except showing the "start menu" or seeing the pi desktop. I could do file manager and find the desktop though :)

Some error messages:
Openbox-Message: A window manager is already running on screen 0
tray: another systray already running

(pcmanfm:5422): Gtk-WARNING **: Radio group does not contain an action with value '0'
** (lxsession-logout:5453): WARNING **: dbus-interface.c:94: DBUS: The name org.freedesktop.UPower was not provided by any .service files

I think the LXDE must be managing my Debian desktop somehow. I created a second desktop on Debian and now the pi's LXDE taskbar also shows two screens. Clicking them switches my Debian desktops. I'm going to need more reading and learning. But for now I can run applications on pi. I just need to know the names to the applications I can't yet access since the "start menu" doesn't work.

Re: How to startx from remote machine?

Posted: Sun Feb 02, 2014 11:00 am
by Killertechno
[quote="Joe Schmoe"]Actually, the real answer to this question is either:

1) simple version - allows you to run individual X apps and have them displayed locally:

Code: Select all

ssh -X pi@pisIPaddr
/quote]


"locally": do you mean on my Rasp display?

Re: How to startx from remote machine?

Posted: Sun Feb 02, 2014 12:24 pm
by Joe Schmoe
"locally": do you mean on my Rasp display?
No. "locally" means on the machine on which you are running ssh - i.e., the machine you are looking at.

And that, of course, is assuming that when *you* say "Rasp display", *you* mean the HDMI monitor connected to your Pi (via an HDMI cable). Which, of course, is "local", in the sense of being local to the Pi itself, but not "local" to you (assuming that you are ssh'ing in from far away).

Aren't words fun???