X server

W

wiz561

Guest
Hi!

I'm new to the mac os and I know that this is probably a really simple answer, but it's really bugging me now since I've been trying to fix it for two days!

OK, I have a mac os 10.3.6. My whole goal is to open a terminal session (not go into apps/utils/x11), but a terminal session. Then I was to run X apps from within the terminal session. A great example is ssh'ing over to another machine and running a X interface from the machine I ssh'ed into on my mac.

However, for now, I thought I would start simple and start local. I have installed xcode_tools from the apple web site, and it looks like it installed the X components because I can start the X11 program from apps/utils/x11. From within the X11 terminal, I can start xclock with no problems and it works just fine. However, when I open the terminal and run it from there, I get...

$ xclock
Error: Can't open display: :0.0
$

It's really frustrating because I've read numerous FAQ's on how to fix this but really nothing works for me! I believe I'm running bash (the terminal window goes "text - bash". One faq said to add this to your rc file. I plopped it in /etc/bashrc

---
# do display thing to open X
if [ ${#DISPLAY} -eq 0 ]; then
export DISPLAY=':0.0'
fi
---

However, this does not work. I also tried to "export display" and a bunch of different commands from :0.0 to the ip.0, but again, none of this works.

Since nothing works in the terminal and everything works in the x11 session terminal, am I doing something wrong? Oh, also, if I have the X11 program running and then execute xclock from the terminal (not the x11 terminal but the bash one), it works fine. Is this just how it works?


Thanks in advance!
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
There is two things you need to do. First on your system you need to give permission for another system to display anything on your screen. issue the command xhost + will allow any other system to display any thing on your swcreen. You can limit access by using xhost ip address. Next you issue the command set DISPLAY ip address:0. I am not sure of the syntax in the bash shell.

So the order is a follows:

On your system issue either xhost + or xhost ip address of other system
log on to other system
on other system set the DISPLAY variable to your system (.i.e DISPLAY=your ip address:0)

I tend to work with c-shell and korn shell most of the time.

Just a side note DISPLAY=0.0 means the display is set to your local system.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top