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

[OpenFOAM.org] X Server does not work on WSL2

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By olesen
  • 1 Post By Yann
  • 1 Post By alexvaleije

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2023, 17:06
Default X Server does not work on WSL2
  #1
Member
 
Luca
Join Date: Mar 2021
Location: Italy
Posts: 46
Rep Power: 5
xisluke is on a distinguished road
Hi guys, I'm trying to install OpenFOAM 10 on Ubuntu 22.04 LTS, I'm running Linux on the WSL2, Windows 10.
I followed the exact instructions enlighted at the official link from The OpenFOAM Foundation (https://openfoam.org/download/windows/). Everything is fine until the enabling of graphical application; as I stated before, I followed exactly the same procedure by installing VcXsrv, but if I try to run gedit or paraFoam, basically nothing is working. XLaunch is running in the background but the only thing I see is the pointer blinking on the terminal without any window opening. I already used OpenFOAM few times ago with WSL1 but I didn't experienced this issue.
The .bashrc file has these two strings at the end:

Code:
. /opt/openfoam10/etc/bashrc
export DISPLAY=<IP ADDRESS>:0
Some suggestions? I tried to search out on the web but I really didn't find something that really helped me, I am not used to work with Linux nor WSL.
Thanks!
xisluke is offline   Reply With Quote

Old   April 20, 2023, 03:45
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Related topics:
You are better to use a Windows installation of ParaView.
Yann likes this.
olesen is offline   Reply With Quote

Old   April 20, 2023, 04:07
Default
  #3
Member
 
Luca
Join Date: Mar 2021
Location: Italy
Posts: 46
Rep Power: 5
xisluke is on a distinguished road
Ok, let's say to install ParaView directly on Windows and solving the problem. How can I manage the issue with gedit?
xisluke is offline   Reply With Quote

Old   April 20, 2023, 04:46
Default
  #4
Member
 
Alejandro Valeije
Join Date: Nov 2014
Location: Spain
Posts: 52
Rep Power: 11
alexvaleije is on a distinguished road
Quote:
Originally Posted by xisluke View Post
Ok, let's say to install ParaView directly on Windows and solving the problem. How can I manage the issue with gedit?
Hi Luca,

I do not get the question. Install paraview in Windows, and in the case folder generate a blank file with a ".openfoam" termination. For example, "case.openfoam".

Then, open that file with paraView and when it asks for the reader type, select OpenFoam Reader, and then your case will be loaded.

Much easier and better display than depending on the parafoam command and X acceleration

Hope that helps. Best regards,
alexvaleije is offline   Reply With Quote

Old   April 20, 2023, 05:26
Default
  #5
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Quote:
Originally Posted by xisluke View Post
Ok, let's say to install ParaView directly on Windows and solving the problem. How can I manage the issue with gedit?
You can directly access your files from windows explorer and edit it using something like notepad++ or any other editor you like to use.

Quote:
Originally Posted by alexvaleije View Post
Install paraview in Windows, and in the case folder generate a blank file with a ".openfoam" termination. For example, "case.openfoam".

Then, open that file with paraView and when it asks for the reader type, select OpenFoam Reader, and then your case will be loaded.
I would even say: create a blank file with the ".foam" extension rather than ".openfoam". It will be recognized by ParaView who will automatically use the OpenFOAM reader. (so you skip the part where you have to manually select the OpenFOAM reader in paraview when opening the case)

Cheers,
Yann
olesen likes this.
Yann is offline   Reply With Quote

Old   April 20, 2023, 06:30
Default
  #6
Member
 
Luca
Join Date: Mar 2021
Location: Italy
Posts: 46
Rep Power: 5
xisluke is on a distinguished road
Thank you guys, as I mentioned before I used OpenFOAM few times ago mainly at the university, professors told us to go with X Server and since I did not experienced any issues my intention was to go in the exact same way.

Quote:
You can directly access your files from windows explorer and edit it using something like notepad++ or any other editor you like to use.
I would say that at that time I tried to modify directly in Windows some scripts, but I often got problems in the readability of the files in WSL, I do not remember the reason but the only way was gedit... It is also true that I was using Windows Notepad, not a more advanced editor like Notepad++ or Sublime Text
xisluke is offline   Reply With Quote

Old   April 20, 2023, 07:11
Default
  #7
Member
 
Alejandro Valeije
Join Date: Nov 2014
Location: Spain
Posts: 52
Rep Power: 11
alexvaleije is on a distinguished road
Without further information, I would say that those problems might have been caused by the carriage return that Windows Notepad does.

With Notepad++, or using nano in the terminal you should be safe. I know some people that likes vim, but I hate it so much hahaha

@Yann Nice trick the .foam instead .openfoam extension, I hadn't noticed so far

Quote:
Originally Posted by xisluke View Post
Thank you guys, as I mentioned before I used OpenFOAM few times ago mainly at the university, professors told us to go with X Server and since I did not experienced any issues my intention was to go in the exact same way.



I would say that at that time I tried to modify directly in Windows some scripts, but I often got problems in the readability of the files in WSL, I do not remember the reason but the only way was gedit... It is also true that I was using Windows Notepad, not a more advanced editor like Notepad++ or Sublime Text
Yann likes this.
alexvaleije is offline   Reply With Quote

Old   April 20, 2023, 07:36
Default
  #8
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Quote:
Originally Posted by alexvaleije View Post
Without further information, I would say that those problems might have been caused by the carriage return that Windows Notepad does.

With Notepad++, or using nano in the terminal you should be safe. I know some people that likes vim, but I hate it so much hahaha

@Yann Nice trick the .foam instead .openfoam extension, I hadn't noticed so far
I agree with that. In notepad++ you can convert End Of Line characters to maintain the Linux format when editing the file from windows.
I've been doing this on a daily basis for years, no issues with it, as long as you remember to check it and convert from Windows to Linux if needed.

Notepad++ maintain the original format of the file so if you open OpenFOAM files with it it will be fine. You just need to be careful when creating a new file from windows.

Cheers,
Yann
Yann is offline   Reply With Quote

Reply


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
[solids4Foam] elasticWallPressure no work in parallel. BC robin. Neb OpenFOAM CC Toolkits for Fluid-Structure Interaction 13 June 6, 2023 08:49
Home PC, Play, Work (CFD) - AMD7950x or i9-13900K without complicated settings? Mr.ZIMULAXION Hardware 3 March 7, 2023 07:20
parallel InterFoam solving does not work (single core does work) jordy OpenFOAM Running, Solving & CFD 0 February 2, 2023 07:11
Viscous Adjoint does not work AndreaMichelotti SU2 0 November 29, 2021 05:59
Installing SGE and getting CFX to work with it shreyasr Hardware 1 September 8, 2012 03:17


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