Can't run PceEmacs! - SOLVED

181 views
Skip to first unread message

Pal Csanyi

unread,
Aug 22, 2015, 10:51:25 AM8/22/15
to swi-p...@googlegroups.com
Hello,

I just installed Swi-Prolog on my Gentoo linux system.

In swi-prolog, I can't run emacs:
b2 ~ # swipl
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 6.6.6)
Copyright (c) 1990-2013 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.

For help, use ?- help(Topic). or ?- apropos(Word).

?- emacs.
ERROR: toplevel: Undefined procedure: emacs/0 (DWIM could not correct goal)

What is the solution?

Pal Csanyi

unread,
Aug 22, 2015, 11:26:00 AM8/22/15
to swi-p...@googlegroups.com
Well the machine is a headless power pc box on which I can't run PceEmacs. The headless box doesn't has graphics card, so maybe this is why can't run XPCE on it. If so, which editor can I use instead? GNU emacs? Because this is only a console environment, without X Window System.

Douglas Miles

unread,
Aug 23, 2015, 12:08:54 AM8/23/15
to SWI-Prolog
I only run headless Linux as well.. but I always install Xming and Samba on the windows machine .

export DISPLAY=windows-machine:0.0
swipl 

Douglas Miles

unread,
Aug 23, 2015, 12:23:55 AM8/23/15
to SWI-Prolog

On Saturday, August 22, 2015 at 9:08:54 PM UTC-7, Douglas Miles wrote:
I only run headless Linux as well.. but I always install Xming and Samba on the windows machine .

export DISPLAY=windows-machine:0.0
swipl 




(Also my answer doesn't directly address your question .. and this answer still not)

But somehow you've got the devil on your machine (version 6.6.6 and not 7.2.2) but this might be a Gentoo release cycle issue. (someone will know more about)  

But why I bring up the version is it seems almost like it was  the  "swi-prolog-nox"  No X version.    Which would have seemed to make sense on a headless machine, right?.    But most of my development use-cases ((such as ones I'd run Pce-Emacs on))  are headless machines are accessed from machines where eventually I *am* using a graphics card.   So I make sure I am runing the  Non-nox packages.
 
I imagine scenario for "swi-prolog-nox" are for cases of a deployed web server where having the X tools might pose a security risk.  Or for testing what a true "headless deployment" is going to be like.

Pal Csanyi

unread,
Aug 23, 2015, 2:58:04 PM8/23/15
to SWI-Prolog

2015. augusztus 23., vasárnap 6:23:55 UTC+2 időpontban Douglas Miles a következőt írta:

On Saturday, August 22, 2015 at 9:08:54 PM UTC-7, Douglas Miles wrote:
I only run headless Linux as well.. but I always install Xming and Samba on the windows machine .

export DISPLAY=windows-machine:0.0
swipl 
 
(Also my answer doesn't directly address your question .. and this answer still not)

But somehow you've got the devil on your machine (version 6.6.6 and not 7.2.2) but this might be a Gentoo release cycle issue. (someone will know more about)  

But why I bring up the version is it seems almost like it was  the  "swi-prolog-nox"  No X version.    Which would have seemed to make sense on a headless machine, right?.    But most of my development use-cases ((such as ones I'd run Pce-Emacs on))  are headless machines are accessed from machines where eventually I *am* using a graphics card.   So I make sure I am runing the  Non-nox packages.
 
I imagine scenario for "swi-prolog-nox" are for cases of a deployed web server where having the X tools might pose a security risk.  Or for testing what a true "headless deployment" is going to be like.

 OK, I just installed on this headless powerpc box the newest version of swi-prolog, and
connect to the headless box with:


from my desktop Gentoo linux system:

b2 ~ # swipl
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 7.3.4)
Copyright (c) 1990-2015 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.

For help, use ?- help(Topic). or ?- apropos(Word).

?- emacs.
[PCE fatal: @display/display: Failed to connect to X-server at `': no DISPLAY environment variable
*********************************************************************
* You MUST be running the X11 Windowing environment.  If you are,   *
* check the setting of your DISPLAY environment variable as well    *
* the access rights to your X11 server.  See xauth(1) and xhost(1). *
*********************************************************************
        in:     <No exception goal>
]
Host stack:
 [15] pce_principal:send(@emacs_mark_list/emacs_bookmark_editor, append(new(_G993, dialog)))
 [14] Send-method on @emacs_mark_list/emacs_bookmark_editor: emacs_bookmark_editor->initialise
 [13] '$c_call_prolog'
 [12] pce_principal:new(@emacs_mark_list/emacs_bookmark_editor, emacs_bookmark_editor)
 [11] Send-method on @emacs/emacs: emacs->initialise(@emacs_buffers/dict)
% The following threads wouldn't die: [main]

Because of the -X ssh option I think this should works, but it does not. Why?

I tried to export DISPLAY environment variable:

b2 ~ # export DISPLAY=192.168.50.163:0.0

b2 ~ # swipl
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 7.3.4)
Copyright (c) 1990-2015 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.

For help, use ?- help(Topic). or ?- apropos(Word).

?- emacs.
[PCE fatal: @display/display: Failed to connect to X-server at `192.168.50.163:0.0': No permission to contact X-server?
*********************************************************************
* You MUST be running the X11 Windowing environment.  If you are,   *
* check the setting of your DISPLAY environment variable as well    *
* the access rights to your X11 server.  See xauth(1) and xhost(1). *
*********************************************************************
        in:     <No exception goal>
]
Host stack:
 [15] pce_principal:send(@emacs_mark_list/emacs_bookmark_editor, append(new(_G993, dialog)))
 [14] Send-method on @emacs_mark_list/emacs_bookmark_editor: emacs_bookmark_editor->initialise
 [13] '$c_call_prolog'
 [12] pce_principal:new(@emacs_mark_list/emacs_bookmark_editor, emacs_bookmark_editor)
 [11] Send-method on @emacs/emacs: emacs->initialise(@emacs_buffers/dict)
% The following threads wouldn't die: [main]

What am I missing here?

Douglas Miles

unread,
Aug 24, 2015, 6:11:55 PM8/24/15
to swi-p...@googlegroups.com

I personally never tunnel my X thru ssh.. but just rely only on the   export DISPLAY=192.168.50.163:0.0

Make sure you can at least run  "xeyes"  from the headless host to your non headless desktop.

what i mean by that is  the command line "xeyes &"  (the & to background it) .. On your desktop a pair of eyeballs should now be following your mouse around
If you can get that to happen all you'll need it to do is type "swipl" to make SWI-Prolog to work.

This will help you trouble shoot all the security issues you'l have to solve with xhost  (myself i disable all security since it is just over my local network)

Here is a random OK artical off the web that wshould get you going http://www.cyberciti.biz/tips/how-to-display-remote-applications-on-my-local-linux-x-server.html



(Most Xservers are set up to allow only local host until you relax the security)

Here is an artical showing someone having to relax that security http://www.softpanorama.org/Xwindows/Troubleshooting/can_not_open_display.shtml




On Saturday, August 22, 2015 at 7:51:25 AM UTC-7, Pal Csanyi wrote:

Jan Wielemaker

unread,
Aug 25, 2015, 5:46:20 AM8/25/15
to Douglas Miles, SWI-Prolog
Seems minimal X11 installations typically do not come with the `xauth`
program, which is needed by ssh to setup the tunnel with proper
security. In my experience, just install `xauth` and `ssh -X` works
fine. At least, this applies for Ubuntu LXC containers. `ssh -X` is
not only secure, but also works if your display is on a machine that
is behind a firewall, NAT networking, etc.

Cheers --- Jan

On 08/25/2015 12:11 AM, Douglas Miles wrote:
>
> I personally never tunnel my X thru ssh.. but just rely only on the
> export DISPLAY=192.168.50.163:0.0
>
> Make sure you can at least run "xeyes" from the headless host to your
> non headless desktop.
>
> what i mean by that is the command line "xeyes &" (the & to background
> it) .. On your desktop a pair of eyeballs should now be following your
> mouse around
> If you can get that to happen all you'll need it to do is type "swipl"
> to make SWI-Prolog to work.
>
> This will help you trouble shoot all the security issues you'l have to
> solve with xhost (myself i disable all security since it is just over
> my local network)
>
> Here is a random OK artical off the web that wshould get you
> going http://www.cyberciti.biz/tips/how-to-display-remote-applications-on-my-local-linux-x-server.html
>
>
>
> (Most Xservers are set up to allow only local host until you relax the
> security)
>
> Here is an artical showing someone having to relax that
> security http://www.softpanorama.org/Xwindows/Troubleshooting/can_not_open_display.shtml
>
>
>
> Make sure on the the machine with graphics card you have
>
>
>
>
> On Saturday, August 22, 2015 at 7:51:25 AM UTC-7, Pal Csanyi wrote:
>
> Hello,
>
> I just installed Swi-Prolog on my Gentoo linux system.
>
> In swi-prolog, I can't run emacs:
> b2 ~ # swipl
> Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 6.6.6)
> Copyright (c) 1990-2013 University of Amsterdam, VU Amsterdam
> SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
> and you are welcome to redistribute it under certain conditions.
> Please visit http://www.swi-prolog.org for details.
>
> For help, use ?- help(Topic). or ?- apropos(Word).
>
> ?- emacs.
> ERROR: toplevel: Undefined procedure: emacs/0 (DWIM could not
> correct goal)
>
> What is the solution?
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/swi-prolog.
> For more options, visit https://groups.google.com/d/optout.

Pal Csanyi

unread,
Aug 25, 2015, 5:55:41 AM8/25/15
to SWI-Prolog, logi...@gmail.com
2015. augusztus 25., kedd 11:46:20 UTC+2 időpontban Jan Wielemaker a következőt írta:
Seems minimal X11 installations typically do not come with the `xauth`
program, which is needed by ssh to setup the tunnel with proper
security.  In my experience, just install `xauth` and `ssh -X` works
fine.  At least, this applies for Ubuntu LXC containers.  `ssh -X` is
not only secure, but also works if your display is on a machine that
is behind a firewall, NAT networking, etc. 
 
I think I find the cause of the problem.
On the headless server where I can't use ssh with -X option, there was installed ssh without X support.
This is a Gentoo linux, so I change the USE flag for openssh to X.
Now I'm being reinstalling the openssh out there:
emerge --ask --changed-use net-misc/openssh

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] net-misc/openssh-6.9_p1-r2  USE="X*" 

Would you like to merge these packages? [Yes/No]
Yes

I'm waiting to completed this reinstallation and then I try it out again.

Pal Csanyi

unread,
Aug 25, 2015, 7:25:40 AM8/25/15
to SWI-Prolog, logi...@gmail.com
2015. augusztus 25., kedd 11:55:41 UTC+2 időpontban Pal Csanyi a következőt írta:
I think I find the cause of the problem.
On the headless server where I can't use ssh with -X option, there was installed ssh without X support.
This is a Gentoo linux, so I change the USE flag for openssh to X.
Now I'm being reinstalling the openssh out there:
emerge --ask --changed-use net-misc/openssh

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] net-misc/openssh-6.9_p1-r2  USE="X*" 

Would you like to merge these packages? [Yes/No]
Yes

I'm waiting to completed this reinstallation and then I try it out again.

I find the solution!
I had already installed  x11-apps/xauth.
Now I have installed x11-apps/xhost too.

In sshd_conf on headless server I have now:
PermitRootLogin yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

I connect to headless server with command: 'ssh -Y root@serverIPaddress' from now on .

This way I can run 'emacs.' in swipl on headless server too.

Thank you all for help.

--
Best, Pali

Pal Csanyi

unread,
Aug 25, 2015, 7:34:05 AM8/25/15
to SWI-Prolog, logi...@gmail.com
I find the solution!
I had already installed  x11-apps/xauth.
Now I have installed x11-apps/xhost too.

In sshd_conf on headless server I have now:
PermitRootLogin yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

The last line is unnecessary. 
Reply all
Reply to author
Forward
0 new messages