CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.com] starting problem on mac: "xhost: command not found" (https://www.cfd-online.com/Forums/openfoam-installation/169099-starting-problem-mac-xhost-command-not-found.html)

k13113y May 6, 2016 09:51

[root@eba8e7f5a175 cavity]# echo $FOAM_RUN
/root/OpenFOAM/ofuser-v3.0+/run

[ofuser@eba8e7f5a175 cavity]$ echo $FOAM_RUN
/home/ofuser/OpenFOAM/ofuser-v3.0+/run

...It worked? I'm sorry for the confusion I literally don't know why its working all of a sudden.

k13113y May 6, 2016 09:54

It seems to have happened when I downloaded the new version of virtual box

pgh May 6, 2016 10:08

1 Attachment(s)
Launch docker terminal box i)delete old container by running following command "docker rm -f of_v3.0_plus"

ii) run this command "docker ps -a " to see there is no container now

iii) unzip the latest script that i have provided and put in /C/Users
and use this command
docker-machine ssh default $HOME/installOpenFOAM_MAC_pgh $HOME

You will be login as docker (There is no ofuser involved in it)
then follow rest of instruction

k13113y May 6, 2016 10:41

Here's what happened when I followed your last comment.

taylor:~ myusername$ ./startOpenFoam+_MAC
of_v3.0_plus
bash-4.1$ whoami
whoami: cannot find name for user ID 1000
bash-4.1$ mkdir -p $FOAM_RUN
bash-4.1$ run

//so it was able to make the directory

bash-4.1$ export DISPLAY=my.ip
bash-4.1$ export LIBGL_ALWAYS_INDIRECT=y
bash-4.1$ paraFoam
Created temporary 'cavity.OpenFOAM'
paraview: cannot connect to X server my.ip

But it couldn't open the graphical interface like before for some reason

pgh May 6, 2016 10:49

I am not using paraFOAM from docker container. I will suggest to download paraview seprately for MAC and then work on it .

http://www.paraview.org/download/

Also did you add display variable as suggested earlier in your command i.e in script (Note just need to add -e DISPLAY=${displayVar} in script . and rerun it after deleting old container

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

k13113y May 6, 2016 11:14

I've now installed paraview and made the change to the script. My script reads:

docker run -it -d --name ${containerName} --user=${user} -e USER=${username} -e DISPLAY=${displayVar} --workdir -e QT_X11_NO_MITSHM=1 -e HOME=/home/docker/Users --workdir="/home/docker/Users" --volume="${home}:/home/docker/Users" -v=/tmp/.X11-unix:/tmp/.X11-unix ${imageName} /bin/bash --rcfile /opt/OpenFOAM/OpenFOAM-v3.0+/etc/bashrc

However now I can't even run the container:

taylor:~ myusername$ ./startOpenFOAM+_MAC
Error response from daemon: No such container: of_v3.0_plus
Error: failed to start containers: of_v3.0_plus
Error: No such container: of_v3.0_plus

pgh May 6, 2016 11:31

docker run -it -d --name ${containerName} --user=${user} -e USER=${username} -e DISPLAY=${displayVar} --workdir -e QT_X11_NO_MITSHM=1 -e HOME=/home/docker/Users --workdir="/home/docker/Users" --volume="${home}:/home/docker/Users" -v=/tmp/.X11-unix:/tmp/.X11-unix ${imageName} /bin/bash --rcfile /opt/OpenFOAM/OpenFOAM-v3.0+/etc/bashrc


remove --workDir that is highlightred above

k13113y May 6, 2016 12:01

Andd we have lift off! Thank you my friend, I am now running programs as user1000 and not as root:D

azaria May 7, 2016 14:58

Dear ugh,

I am back again, I used your latest script but I get the password incorrect. See below:

Merons-MacBook-Pro:~ ban$ ./startOpenFOAM+
of_v3.0_plus
bash-4.1$ su user
su: user user does not exist
bash-4.1$ su ofuser
Password:
su: incorrect password
bash-4.1$

I used the password ofuser2015 and Ofuser2015. Both did not work.

When I used the latest attached script I do not need to change users "Name".
any clue?

thanks,
Azaria

pgh May 7, 2016 15:39

Hi Azaria

1)Before launching script, make sure to run command docker rm -f of_v3.0_plus

to make sure you have deleted old container.


2. )please note that with latest script you do not need to login as ofuser..

3) command "echo $USER", will throw user name as docker.. check this please

4) run this command "mkdir -p $FOAM_RUN" and see whether there is permission issue .

5)Login as root ie su root and use password 0fuser2015 ...

azaria May 8, 2016 11:13

Dear pgh,

I have run the cavity tutorial successfully. Thank you so much.

Azaria

bbita May 13, 2017 18:26

Hi Pawan,

I am new to OpenFoam. I installed OPENFOAM for windows-v1612+. I am trying to run the first tutorial. I am in workingDir but when I enter" cp -ar $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity ." I receive the error of permission denied. Please advise.

Thanks

bbita May 14, 2017 22:32

I finally solved the issue. uninstall the whole thing, activate windows module installer, check for updates for windows and reinstall the openFoam and the problem resolved.


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