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] Accessing the root account via Docker (https://www.cfd-online.com/Forums/openfoam-installation/181981-accessing-root-account-via-docker.html)

garumple December 27, 2016 04:47

Accessing the root account via Docker
 
Hi,

I am having some issues trying to mount storage located outside the default workingDir path on a Windows 10 OF installation. Storage limitations prevent me from storing my project in "My Documents". In order to mount the new Virtualbox shared drive, I need to access the root account.

It isn't as simple as using 'su', as I don't know the password.

If I open the Virtualbox instance, it gives me a root account, I can change the password - but it doesn't affect the OF instance at all. This is obvious when listing users (cat /etc/passwd), as "ofuser" is not listed. I can see the Virtualbox share I am interested in from here.

I can log into root by starting a new docker instance (docker run -i -t of_v1606plus_centos66_win /bin/bash), but these changes do not seem to apply to the current instance of OF. I can't see the Virtualbox share here.

Additionally, I have tried using a Windows 10 symbolic link, but CentOS crashes complaining of too many levels of symbolic links.

Is there a way of accessing the root account, or some magical way I can mount another windows partition?

pgh December 27, 2016 15:35

Hi ,
The root password is 0fuser2016 . However you cannot mount the directory in this way. I will send detailed instruction and script tomorrow.

Thanks
pgh

pgh December 28, 2016 08:50

1 Attachment(s)
To access other drive , new scripts is needed and which will create a new container. Please download tar file from following location .

I have attached a tar file which has 4 files in it .
https://ftpbox.esi-group.com/?u=Nwpg...th=/window.tgz


What you need to changed
i) Open the Virtual Machine and then close the default which is running



ii) Go to setting and add new drive which you want to share. As shown in attached image

i shared new drive E i.e e:\ to e/ folder in virtual box . Please do same with your drive



iii) Open the file of_start_container.ps1

and edit 4th line

docker-machine.exe ssh default "sudo mount -t vboxsf -o uid=1000,gid=50 e/ /root/../mountedDrive
(This is used by me . You need to replace e/ with your drive name (see attached image i.e for me e/ e:\ i.e e:\ is my directory which i mount)





Launching and creating container.

i) Click on the create_OF_plus.bat and it will create a new container

Close the terminal when process end

ii) Click on the startOF_plus . It will open container and now you can see two folder there
workingDir_mounted and workingDir . You need to use this script to launch openfoam .

You can click it multiple times and it will open the new terminal and you can work in multiple terminal with openfoam environment set.

garumple December 28, 2016 18:36

Thank you pgh - this worked perfectly!

chia87 January 30, 2017 09:10

Hi pgh,

Im having the same problem, and I tried clicking the link to log in to download the file, but could not access the link due to invalid password https://ftpbox.esi-group.com/?u=Nwpg...th=/window.tgz

Could you assist again, thanks in advance for any help

pgh February 2, 2017 06:04

Quote:

Originally Posted by chia87 (Post 635159)
Hi pgh,

Im having the same problem, and I tried clicking the link to log in to download the file, but could not access the link due to invalid password https://ftpbox.esi-group.com/?u=Nwpg...th=/window.tgz

Could you assist again, thanks in advance for any help

Try this link
https://ftpbox.esi-group.com/?u=AR8E...fv1606plus.rar

HosamAlrefaie September 26, 2021 09:37

hi

how to access the folders where they have the source files of OpenFOAM in version of Windows-Docker. i want to add WSGGM model to absorptionEmission radiation submodels.
I got the WSGGM model files from:
https://github.com/arvindjp/OpenFOAM...rptionEmission

olesen October 9, 2021 05:22

Quote:

Originally Posted by HosamAlrefaie (Post 813026)
hi

how to access the folders where they have the source files of OpenFOAM in version of Windows-Docker. i want to add WSGGM model to absorptionEmission radiation submodels.
I got the WSGGM model files from:
https://github.com/arvindjp/OpenFOAM...rptionEmission

If you are using the updated openfoam-docker methods (the openfoam.com version) than you need to have the "dev" or "default" image instead of the bare-bones "run" image https://hub.docker.com/r/opencfd/openfoam2106-dev

There you have all the source code etc.
However you cannot and should not be trying to add additional code into the docker image. Instead you should be taking the models that you cited and compile them as a user library. It means that you will subsequently need a "libs" entry in your controlDict later, but keeps your personal modifications outside of the OpenFOAM source tree, which means they will survive an upgrade.


All times are GMT -4. The time now is 10:02.