CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.com] starting problem on mac: "xhost: command not found"

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2016, 12:02
Default starting problem on mac: "xhost: command not found"
  #1
New Member
 
Florida
Join Date: Jun 2015
Posts: 10
Rep Power: 10
azaria is on a distinguished road
I followed the installation instruction for OpenFOAM binaries on mac. I followed and completed all the steps and seems all run successfully. Then I got stuck on the following step.

I attempted to run the following command:
Merons-MacBook-Pro:~ ban$ ./startOpenFOAM+

And I get the following message that I do not understand?
./startOpenFOAM+: line 8: xhost: command not found
of_v3.0_plus
bash-4.1$

May be the terminal is expecting me to enter "some command". I don't know what it is expecting or what is wrong.

your help is highly appreciated.

Thanks,
azaria is offline   Reply With Quote

Old   April 4, 2016, 10:12
Default
  #2
pgh
Senior Member
 
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10
pgh is on a distinguished road
Hi..
You have done it right . Enter command blockMesh , to check whether you have openfoam environment set i.e in bash-4.1$ . You can remove line xhost + from startOpenFOAM+ scripts and launch scripts again
pgh is offline   Reply With Quote

Old   April 6, 2016, 22:07
Default
  #3
New Member
 
Florida
Join Date: Jun 2015
Posts: 10
Rep Power: 10
azaria is on a distinguished road
I did the following per your suggestion:

I removed the line xhost + from startOpenFOAM+ scripts and launch command again. And then run the command blockMesh at bash-4.1$ terminal and I got the following message:
Build : v3.0+-e941ee6c15e9
Exec : blockMesh
Date : Apr 07 2016
Time : 01:43:39
Host : "cbd5124db144"
PID : 190
Case : /Users/ban
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time



--> FOAM FATAL IO ERROR:
cannot find file

file: /Users/ban/system/controlDict at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting

It appears the blockMesh did not run successfully, however, I went ahead and run the following command: "run" per the installation instruction as follows, and I got the following error message:

bash-4.1$ run
bash: cd: /home/docker/OpenFOAM/docker-v3.0+/run: No such file or directory

Still went ahead and run the following command per the install instruction, and again run to Permission denied problem:

bash-4.1$ mkdir -p $FOAM_RUN
mkdir: cannot create directory `/home/docker': Permission denied

Since the blockMesh command did not run clean. There must be some problem or steps I missed.

Please any help is appreciated.

Thanks,
Azaria
azaria is offline   Reply With Quote

Old   April 7, 2016, 03:41
Default
  #4
pgh
Senior Member
 
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10
pgh is on a distinguished road
Hi Azaria
Running BlockMesh was to make sure that you were getting openfoam executables in path . Since you run outside any actual case , it was suppose to throw error.
For permission related issue and other see this thread.(see 1April post by pgh)
http://www.cfd-online.com/Forums/ope...tml#post593444
pgh is offline   Reply With Quote

Old   April 7, 2016, 22:38
Default
  #5
New Member
 
Florida
Join Date: Jun 2015
Posts: 10
Rep Power: 10
azaria is on a distinguished road
Dear All,

I tried both options but I run to the old problem "Permission Denied". Below is the message I get.

Merons-MacBook-Pro:~ ban$ docker-machine ssh default $HOME/installOpenFOAM+ $HOME
sh: /Users/ban/installOpenFOAM+: Permission denied
exit status 126

My problem circles back to the original problem I started with.

Thanks,
Azaria
azaria is offline   Reply With Quote

Old   April 7, 2016, 23:09
Default
  #6
New Member
 
Florida
Join Date: Jun 2015
Posts: 10
Rep Power: 10
azaria is on a distinguished road
Dear All:

I have comeback to this problem again:

Merons-MacBook-Pro:~ ban$ ./startOpenFoam+
of_v3.0_plus
bash-4.1$ mkdir -p $FOAM_RUN
mkdir: cannot create directory `/home/docker': Permission denied
bash-4.1$

I must be missing some thing here. I cannot get past this point.

Thanks,
Bereket
azaria is offline   Reply With Quote

Old   April 8, 2016, 03:29
Default
  #7
pgh
Senior Member
 
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10
pgh is on a distinguished road


Problem :

Issue : sh: /Users/ban/installOpenFOAM+: Permission denied
exit status 126

i) Make the install script executable chmod +x installOpenFOAM+

ii) mkdir -p $FOAM_RUN . Will not work directly . (Use attached script and follow instruction to install and use openfoam

Here is the solution :
i) Open the docker terminal via clicking on "Docker Quick Start" short cut .
ii) Delete old container: docker rm -f of_v3.0_plus
iii)Open installOpenFOAM_MAC scripts (attached here. unzip it before using )
in line 25, replace strings NAME with your user name as appears in mac i.e /Users/Name to /Users/alex assuming alex is user name
iv) run installOpenFOAM_MAC script as done earlier i.e
docker-machine ssh default $HOME/installOpenFOAM_MAC $HOME
v) Now run startOpenFOAM.sh script (http://openfoam.com/download/install-binary.php)
and you will be login as root.
vi) run following command to login as ofuser
su ofuser
Always work as ofuser to work on OpenFOAM

vii) Go inside the folder /home/ofuser/workingDir and follow following steps
a) mkdir OpenFOAM/ofuser-v3.0+/run
b) cd ..
c)ln -s workingDir/OpenFOAM (creating soft link to OpenFOAM/ofuser-v3.0+)

You can copy tutorial in /home/ofuser/workingDir
cd
/home/ofuser/workingDir
cp -ar $FOAM_TUTORIALS/incompressible/icoFoam/cavity .
run tutorial

Note: Please note that all changes inside container will be lost once you delete the container by command "docker rm -f contName" except content in /home/ofuser/workingDir . So if you are making changes in /opt/OpenFOAM better be careful .


Attached Files
File Type: gz installOpenFOAM_MAC.gz (642 Bytes, 43 views)
pgh is offline   Reply With Quote

Old   April 8, 2016, 21:17
Default
  #8
New Member
 
Florida
Join Date: Jun 2015
Posts: 10
Rep Power: 10
azaria is on a distinguished road
I managed to follow the instruction up until step vi as shown below but again I could not create the "OpenFOAM/ofuser-v3.0+/run" directory. See below the error message

Merons-MacBook-Pro:~ ban$ ./startOpenFOAM+
of_v3.0_plus
bash-4.1# su ofuser
[ofuser@c00e0cd0d15c ~]$ ls
workingDir
[ofuser@c00e0cd0d15c ~]$ cd workingDir
[ofuser@c00e0cd0d15c workingDir]$ mkdir OpenFOAM/ofuser-v3.0+/run
mkdir: cannot create directory `OpenFOAM/ofuser-v3.0+/run': No such file or directory
[ofuser@c00e0cd0d15c workingDir]$ mkdir OpenFOAM
mkdir: cannot create directory `OpenFOAM': Permission denied
[ofuser@c00e0cd0d15c workingDir]$

Your help is appreciated.

Thanks,
Azaria
azaria is offline   Reply With Quote

Old   April 9, 2016, 06:05
Default
  #9
pgh
Senior Member
 
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10
pgh is on a distinguished road
go inside folder

cd /home/ofuser/workingDir

and then follow steps. workingDir is same as C:\Users\ban . Even if permission is denied . change permission of folder
pgh is offline   Reply With Quote

Old   April 10, 2016, 14:32
Default
  #10
New Member
 
Florida
Join Date: Jun 2015
Posts: 10
Rep Power: 10
azaria is on a distinguished road
I am in the workingDir but still I run into the same problem "Permission Denied". See below:

[ofuser@c00e0cd0d15c workingDir]$ mkdir OpenFOAM
mkdir: cannot create directory `OpenFOAM': Permission denied
[ofuser@c00e0cd0d15c workingDir]$

The directory has the permission to rwx. See below:

[ofuser@c00e0cd0d15c workingDir]$ cd ..
[ofuser@c00e0cd0d15c ~]$ ls
workingDir
[ofuser@c00e0cd0d15c ~]$ ls -l
total 0
drwxr-xr-x 1 1000 ftp 1054 Apr 9 00:40 workingDir

Can any one tell me why I am having "Permission Denied" error message. I as user have read, write and execute privilege.

Thanks,
Azaria





[ofuser@c00e0cd0d15c ~]$
azaria is offline   Reply With Quote

Old   April 11, 2016, 04:05
Default
  #11
pgh
Senior Member
 
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10
pgh is on a distinguished road
I am assuming , you are inside this directory /home/ofuser/workingDir
and then you are being denied permission . Please do ls -lhtr inside directory.
You can login as root (password : 0fuser2015) and change permission of directory
chmod 750 workingDir . See if this works for you
pgh is offline   Reply With Quote

Old   May 5, 2016, 21:10
Default Exact Same Problem
  #12
New Member
 
Evan
Join Date: May 2016
Posts: 23
Rep Power: 9
k13113y is on a distinguished road
Hey, I am having the exact same problem and am pretty new to programming in general.

I followed your steps verbatim and this is what I got:

[root@eba8e7f5a175 workingDir]# whoami
root
[root@eba8e7f5a175 workingDir]# pwd
/home/ofuser/workingDir
[root@eba8e7f5a175 workingDir]# chmod 750 workingDir
chmod: cannot access `workingDir': No such file or directory
[root@eba8e7f5a175 workingDir]#

I'm running on el Capitan, my professor is too, and we're both having permissions issues. Any help would be greatly appreciated
k13113y is offline   Reply With Quote

Old   May 6, 2016, 08:21
Default
  #13
pgh
Senior Member
 
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10
pgh is on a distinguished road
Hi .. use this script and it should work fine .

i)delete old container
docker rm -f of_v3.0_plus

ii) run new script attached here (unzip the script first)
Please place script in home folder and then run command from docker terminal as

docker-machine ssh default $HOME/installOpenFOAM+ $HOME


It will login as docker user and you can run openfoam and there will be no permission issue
Also you can login as root now . password for root : 0fuser2015

Let me know if it works or you face any issue
Attached Files
File Type: gz installOpenFOAM_MAC_pgh.gz (677 Bytes, 17 views)

Last edited by pgh; May 6, 2016 at 08:23. Reason: file attached now
pgh is offline   Reply With Quote

Old   May 6, 2016, 08:27
Default
  #14
New Member
 
Evan
Join Date: May 2016
Posts: 23
Rep Power: 9
k13113y is on a distinguished road
Thats great!

I managed to make a new directory as root,
mkdir -p $FOAM_RUN

But I am using socat to watch for my DISPLAY variable, and I am unsure of which IP it needs.

Is there a command I can type into docker that will show me this?

I want to make a variable, export DISPLAY=xxx.xxx.xx.x:x
k13113y is offline   Reply With Quote

Old   May 6, 2016, 08:53
Default
  #15
pgh
Senior Member
 
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10
pgh is on a distinguished road
i)You do not need root permission to run this command

mkdir -p $FOAM_RUN

can you please delete that folder and again run same command as normal user (no root)

ii) DISPLAY variable was removed from my script ..Please in line docker run etc as shown below
add this variable and rerun the script after deleting the container

docker run -ti -d .... -e DISPLAY=${displayVar} --workdir

(When you launch docker terminal box , the ip is shown that time .

Message read something like this ..

"docker is configured to use the default machine with IP 192.169.99.100" "
pgh is offline   Reply With Quote

Old   May 6, 2016, 09:27
Default
  #16
New Member
 
Evan
Join Date: May 2016
Posts: 23
Rep Power: 9
k13113y is on a distinguished road
Great thanks I just ran the cavity simulation
k13113y is offline   Reply With Quote

Old   May 6, 2016, 09:33
Default
  #17
pgh
Senior Member
 
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10
pgh is on a distinguished road
Hi
Can you confirm this
do you need to login as root to run command , mkdir -p $FOAM_RUN or
you were able run as normal user i.e docker
pgh is offline   Reply With Quote

Old   May 6, 2016, 09:36
Default
  #18
New Member
 
Evan
Join Date: May 2016
Posts: 23
Rep Power: 9
k13113y is on a distinguished road
Yes this is the last issue I have...

I have to be root. I have made: su ofuser ...but he cannot make that directory. Maybe its an el Capitan issue?
k13113y is offline   Reply With Quote

Old   May 6, 2016, 09:37
Default
  #19
New Member
 
Evan
Join Date: May 2016
Posts: 23
Rep Power: 9
k13113y is on a distinguished road
And likewise the user: docker can't do it either.
k13113y is offline   Reply With Quote

Old   May 6, 2016, 09:43
Default
  #20
pgh
Senior Member
 
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10
pgh is on a distinguished road
That's strange..
In my case, i can login as docker user directly . and then can type this command i.e mkdir -p $FOAM_RUN which make OpenFOAM/docker-v3.0+ folder in /C/Users i.e in home directory..

Can you do echo $FOAM_RUN and send the output
pgh is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
big difference between clockTime and executionTime LM4112 OpenFOAM Running, Solving & CFD 21 February 15, 2019 03:05
Gmsh installation on terminal help spitfire Main CFD Forum 4 July 27, 2017 15:11
[Other] How to create an MRF zone ? aminem OpenFOAM Meshing & Mesh Conversion 2 December 8, 2014 10:45
injection problem Mark New FLUENT 0 August 4, 2013 01:30
8x icoFoam speed up with Cufflink CUDA solver library kmooney OpenFOAM Running, Solving & CFD 42 November 6, 2012 11:37


All times are GMT -4. The time now is 11:08.