Closed BrunnerLivio closed 6 years ago
The file is to be found here: https://github.com/DexterInd/Raspbian_For_Robots/tree/master/Scratch_GUI
Can you tell me more about your setup? I'm curious to know as you seem to be taking a path that we didn't plan for. Thanks!
Hey @BrunnerLivio first thanks for offering a pr? We're a little confused by what you're trying to accomplish here: are you trying to initiate Scratch from your ssh connection, and have it open up in LXE on the Pi?
Basically login in from another PC with X forwarding requires the DISPLAY variable to be set accordingly. When calling scratch this DISPLAY variable will not be set in the sub shell environment meaning you get the error described by Livio.
man sudo
...
-E, --preserve-env
Indicates to the security policy that the user
wishes to preserve their existing environment
variables. The security policy may return an
error if the user does not have permission to
preserve the environment.
This will ensure the DISPLAY environment variable will be available and you will be able to use your application remotely.
@BrunnerLivio will propose the quick fix in a PR.
@erickeller
Can you confirm the following steps in setting up the X11 forwarding:
/etc/ssh/sshd_config
you've set X11Forwarding
variable to yes
.which xauth
command to see if xauth
package is installed.xhost +
command on Raspberry Pi
.Xming
on the client machine.X11
in client terminal and set the address to localhost:0
.Putty
for connecting to the Raspberry Pi
.Cause these steps worked on mine.
Thanks!
ssh -Y pi@dex01 scratch
Ensure your /etc/ssh/sshd_config on the remote has X11 forwarding enabled...
Cheers
On Mon, Jul 31, 2017, 16:41 Robert Lucian Chiriac notifications@github.com wrote:
@erickeller https://github.com/erickeller
I see what you're trying to do. Can you also tell us what steps have you followed in order to allow connecting to the X11 server?
And also, what terminal are you using on your machine?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DexterInd/BrickPi3/issues/71#issuecomment-319087646, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOw0rOii2CJuEXKMln_TdsYIDLW4QFUks5sTeeVgaJpZM4Olass .
Thanks @erickeller What are you setting your $DISPLAY variable to? Mine still says it's not set.
The 1st steps look good. On your default install there is for sure xauth installed and you most probably do not need any xhost command.
As for step 4. I am not familiar with running xming on the client machine as I use a Linux client.
Maybe it makes sense to split the instructions depending on the Operation system.
Kind regards
On Mon, Jul 31, 2017, 16:49 Robert Lucian Chiriac notifications@github.com wrote:
@erickeller https://github.com/erickeller
Can you confirm the following steps in setting up for X11 forwarding:
- In /etc/ssh/sshd_config you've set X11Forwarding variable to yes.
- Checked with which xauth command to see if xauth package is installed.
- Ran xhost + command on Raspberry Pi.
- Installed and ran Xming on the client machine.
- Enabled X11 in client terminal and set the address to localhost:0.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DexterInd/BrickPi3/issues/71#issuecomment-319090022, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOw0nXmkVWtGZsFwUNB8GSY3zuivycKks5sTelsgaJpZM4Olass .
For me, it didn't work without Xming
on my client machine.
It's said that for:
Xming
.XQuartz
.@CleoQc can you also try the steps I've posted? It seems like on yours, it doesn't work yet.
When I try to connect to the RaspberryPI with the BrickPI image from you on it, using
ssh x.x.x.x -Y
, and runscratch
, the display won't get forwarded.I get the error:
After some investigation, we fixed this by editing your scratch-wrapper script in
/usr/bin/scratch
, by adding-E
parameter to the sudo command when startingclick_scratch.py
so the environment variables get transfered. So the command will besudo -E python $SCRATCH_PATH/click_scratch.py
.I did not find this script in this repository, so it might be in another? Can you send me the link and I'll create a pull request
@erickeller