WSL Windows subsystem for Linux
No edit summary
(Adding page to Category:TOC because it contains a TOC.)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
To get started with Linux you may use WSL. WSL is the Windows SubSystem for Linux that is built into Windows10.
To get started with Linux, you may use WSL. WSL is the Windows SubSystem for Linux that is built into Windows 10.


Make sure you have the feature on ; Turn windows features on or off -> Windows Subsystem for Linux
Make sure you have the feature on; Turn Windows features on or off -> Windows Subsystem for Linux


Once you have it on you need a Linux install; we use Ubuntu (20.10 at the time of writing)
Once you have it on, you need a Linux install; we use Ubuntu (22.04 at the time of writing).
  wget <nowiki>https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb</nowiki> -O packages-microsoft-prod.deb
  wget <nowiki>https://packages.microsoft.com/config/ubuntu/22.04/packages-microso</nowiki> ft-prod.deb -O packages-microsoft-prod.deb
  sudo dpkg -i packages-microsoft-prod.deb
  sudo dpkg -i packages-microsoft-prod.deb
You then install .net core (we use .net core 3.1)
Then, install .net core (we use .net core 5.0):
  sudo apt-get update; \   
  sudo apt-get update; \   
   sudo apt-get install -y apt-transport-https && \
   sudo apt-get install -y apt-transport-https && \
   sudo apt-get update && \
   sudo apt-get update && \
   sudo apt-get install -y dotnet-sdk-3.1
   sudo apt-get install -y dotnet-sdk-5.0
This is a good overview: https://weblog.west-wind.com/posts/2017/apr/13/running-net-core-apps-under-windows-subsystem-for-linux-bash-for-windows
This is a good overview: https://weblog.west-wind.com/posts/2017/apr/13/running-net-core-apps-under-windows-subsystem-for-linux-bash-for-windows


Remember that your c disk is found here  /mnt/c/
Remember that your c disk is found here: /mnt/c/


====== WSL2 ======
====== WSL2 ======
WSL2 offers better interaction between Visual Studio and WSL; read more here https://docs.microsoft.com/en-us/visualstudio/debugger/debug-dotnet-core-in-wsl-2?view=vs-2019
WSL2 offers better interaction between Visual Studio and WSL. Read more here: https://docs.microsoft.com/en-us/visualstudio/debugger/debug-dotnet-core-in-wsl-2?view=vs-2019


Had to install the “.Net Core Debugging with WSL 2” component in Visual Studio Installer (Visual Studio Edition->Modify->Individual Components->.Net Core Debugging with WSL 2
Had to install the “.Net Core Debugging with WSL 2” component in Visual Studio Installer (Visual Studio Edition->Modify->Individual Components->.Net Core Debugging with WSL 2


====== Build MDrivenServer ======
====== Build MDrivenServer ======
You need to register a nuget package source to find the VistaDB packages not available on nuget site, this is needed only once:
You need to register a Nuget package source to find the VistaDB packages not available on the Nuget site - this is only needed once:
  sudo dotnet nuget add source /mnt/c/capableobjectswush/Xternal/VistaDB --name  XternatVistaDB     
  sudo dotnet nuget add source /mnt/c/capableobjectswush/Xternal/VistaDB --name  XternatVistaDB     
Build the a sln; navigate to the directory, then:  
Build the sln, navigate to the directory, then:  
  sudo dotnet build
  sudo dotnet build
To start MDrivenServer project, navigate to directory:  
To start the MDrivenServer project, navigate to the directory:  
  sudo dotnet run -port=5001 -nohttps
  sudo dotnet run -port=5001 -nohttps -host=ip/domain


====== What issues have been identified on MDrivenServer: ======
====== What issues have been identified on MDrivenServer: ======
# CompactCE is a windows only embedded database - we are looking to replace with a license version of VistaDB. If file App_Data/UseVistaDBIfThisFileExists.xml exists we will now use VistaDB instead of CompactCE
# CompactCE is a Windows-only embedded database - we are looking to replace it with a license version of VistaDB. If file App_Data/UseVistaDBIfThisFileExists.xml exists, we will now use VistaDB instead of CompactCE.
# All backslashes in filepaths replaced with Path.DirectorySeparatorChar
# All backslashes in filepaths are replaced with Path.DirectorySeparatorChar
# CompactCE connection reads registry and fails on WSL
# CompactCE connection reads registry and fails on WSL
# Model checksum is built on modelcontent with a stringbuilder that use \r\n on windows and \n on linux - causing checksum diff
# Model checksum is built on modelcontent with a stringbuilder that uses \r\n on Windows and \n on Linux - causing checksum diff
# Issues with localhost cert forces all tests to be done over http
# Issues with localhost cert force all tests to be done over HTTP
# Issues with sending parameters via WSL2-VS-Start ; workaround: program checks for environmentvariable "mdrivenserverport" - if found we use it over http
# Issues with sending parameters via WSL2-VS-Start; workaround: program checks for environmentvariable "mdrivenserverport" - if found, we use it over HTTP.


====== Issues on Turnkey: ======
====== Issues on Turnkey: ======
# Path.DirectorySeparatorChar
# Path.DirectorySeparatorChar
# Issues with sending parameters via WSL2-VS-Start ; workaround: program checks for environmentvariable "mdriventurnkeyport" - if found we use it over http
# Issues with sending parameters via WSL2-VS-Start; workaround: program checks for environmentvariable "mdriventurnkeyport" - if found, we use it over HTTP.


=== Deploy on linux ===
=== Deploy on Linux ===
The deploy on linux works much the same as described in the [[LocalServers]] description. The reason is that Linux and LocalServers both use the same .net core editions of MDrivenTurnkey and MDrivenServer.
The deployment on Linux works much the same as described in the [[LocalServers]] description. The reason is that Linux and LocalServers both use the same .net core editions of MDrivenTurnkey and MDrivenServer.


Dlls are platform independant - but exe's are not: https://docs.microsoft.com/en-us/dotnet/core/deploying/ - this leads to a separate publish being needed to get the linux distribution:
Dlls are platform independent - but exe's are not: https://docs.microsoft.com/en-us/dotnet/core/deploying/ - this leads to a separate publish being needed to get the Linux distribution:
  dotnet publish -r linux-x64 --self-contained false
  dotnet publish -r linux-x64 --self-contained false
You can download the Linux distributions from here:
You can download the Linux distributions from here: [https://mdriven.net/PublicDownloads/MDrivenServerCoreLinux__ https://mdriven.net/PublicDownloads/MDrivenServerCoreLinux_]<version>.zip.


[https://mdriven.net/PublicDownloads/MDrivenServerCore_ https://mdriven.net/PublicDownloads/MDrivenServerCoreLinux_]<version>.zip.
The current version is found here: https://mdriven.net/PublicDownloads/MDrivenServerOnCoreVersion.xml
 
The current version is found here https://mdriven.net/PublicDownloads/MDrivenServerOnCoreVersion.xml


https://mdriven.net/PublicDownloads/MDrivenTurnkeyCoreLinux_<version>.zip.
https://mdriven.net/PublicDownloads/MDrivenTurnkeyCoreLinux_<version>.zip.


The current version is found here [https://mdriven.net/PublicDownloads/MDrivenServerOnCoreVersion.xml https://mdriven.net/PublicDownloads/MDrivenTurnkeyOnCoreVersion.xml]
The current version is found here: [https://mdriven.net/PublicDownloads/MDrivenServerOnCoreVersion.xml https://mdriven.net/PublicDownloads/MDrivenTurnkeyOnCoreVersion.xml]


You download the server-zip's as described above. In these 2 zips you will find StreaminAppCoreWebApp.dll (TurnkeyServer as dll), and AppCompleteGenericCore.dll (MDrivenServer as dll).
Download the server-zips as described above. In these 2 zips, you will find StreaminAppCoreWebApp.dll (TurnkeyServer as dll), and AppCompleteGenericCore.dll (MDrivenServer as dll).


Expand the zips to your desired locations on linux - in two different directories.
Expand the zips to your desired locations on Linux - in two different directories.


====== Starting on Linux ======
====== Starting on Linux ======
In order to start the applications you need to install at least dotnet core 3.1 on your linux machine
To start the applications, install at least dotnet core 3.1 on your Linux machine.


Start the applications - MDrivenServer first by navigating to the directory of the app and:  
Configure [https://wiki.mdriven.net/index.php/MDrivenServerOverride MDrivenServerOverride] to set the address and port to MDriven Server.
 
Start the applications - MDrivenServer first - by navigating to the directory of the app and:  
  dotnet AppCompleteGenericCore.dll -port=5010 -nohttps
  dotnet AppCompleteGenericCore.dll -port=5010 -nohttps
Then navigate to the TurnkeyApp directory and:
Then, navigate to the TurnkeyApp directory and:
  dotnet StreaminAppCoreWebApp.dll -port=5011 -nohttps
  dotnet StreaminAppCoreWebApp.dll -port=5011 -nohttps
[[File:2021-05-18 15h34 54.png|none|thumb|626x626px]]
[[File:2021-05-18 15h34 54.png|none|thumb|626x626px]]
After start you can navigate to the MDrivenServer by using the chosen url - you can log in with user a and pwd 123456
After starting, navigate to the MDrivenServer by using the chosen URL - log in with user "a" and password "123456".


The MDrivenServer does not yet have a model - you [[Upload model in MDrivenDesigner|upload a model with MDrivenDesigner]] - after this step you can run the application in the MDrivenTurnkey.
The MDrivenServer does not yet have a model - [[Upload model in MDrivenDesigner|upload a model with MDrivenDesigner]]. After this step, you can run the application in the MDrivenTurnkey.


====== Tips and Tricks ======
=== Tips and Tricks ===
This is no Linux-expert-wiki - but I noticed that the WorkInfo page of MDrivenServer ran into problems while creating bitmaps. It turned out that there was some graphics lib missing on the server, the following fixed it:
This is no Linux-expert-wiki - but I noticed that the WorkInfo page of MDrivenServer ran into problems while creating bitmaps. It turned out that there was some graphics lib missing on the server - the following fixed it:
  sudo apt-get install libgdiplus  
  sudo apt-get install libgdiplus  
  cd /usr/lib  
  cd /usr/lib  
  sudo ln -s libgdiplus.so gdiplus.dll
  sudo ln -s libgdiplus.so gdiplus.dll
[[Category:MDriven Turnkey]]
[[Category:MDriven Server]]
{{Edited|July|12|2024}}
[[Category:TOC]]

Latest revision as of 14:14, 26 March 2024

To get started with Linux, you may use WSL. WSL is the Windows SubSystem for Linux that is built into Windows 10.

Make sure you have the feature on; Turn Windows features on or off -> Windows Subsystem for Linux

Once you have it on, you need a Linux install; we use Ubuntu (22.04 at the time of writing).

wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microso ft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

Then, install .net core (we use .net core 5.0):

sudo apt-get update; \  
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-5.0

This is a good overview: https://weblog.west-wind.com/posts/2017/apr/13/running-net-core-apps-under-windows-subsystem-for-linux-bash-for-windows

Remember that your c disk is found here: /mnt/c/

WSL2

WSL2 offers better interaction between Visual Studio and WSL. Read more here: https://docs.microsoft.com/en-us/visualstudio/debugger/debug-dotnet-core-in-wsl-2?view=vs-2019

Had to install the “.Net Core Debugging with WSL 2” component in Visual Studio Installer (Visual Studio Edition->Modify->Individual Components->.Net Core Debugging with WSL 2

Build MDrivenServer

You need to register a Nuget package source to find the VistaDB packages not available on the Nuget site - this is only needed once:

sudo dotnet nuget add source /mnt/c/capableobjectswush/Xternal/VistaDB --name  XternatVistaDB    

Build the sln, navigate to the directory, then:

sudo dotnet build

To start the MDrivenServer project, navigate to the directory:

sudo dotnet run -port=5001 -nohttps -host=ip/domain
What issues have been identified on MDrivenServer:
  1. CompactCE is a Windows-only embedded database - we are looking to replace it with a license version of VistaDB. If file App_Data/UseVistaDBIfThisFileExists.xml exists, we will now use VistaDB instead of CompactCE.
  2. All backslashes in filepaths are replaced with Path.DirectorySeparatorChar
  3. CompactCE connection reads registry and fails on WSL
  4. Model checksum is built on modelcontent with a stringbuilder that uses \r\n on Windows and \n on Linux - causing checksum diff
  5. Issues with localhost cert force all tests to be done over HTTP
  6. Issues with sending parameters via WSL2-VS-Start; workaround: program checks for environmentvariable "mdrivenserverport" - if found, we use it over HTTP.
Issues on Turnkey:
  1. Path.DirectorySeparatorChar
  2. Issues with sending parameters via WSL2-VS-Start; workaround: program checks for environmentvariable "mdriventurnkeyport" - if found, we use it over HTTP.

Deploy on Linux

The deployment on Linux works much the same as described in the LocalServers description. The reason is that Linux and LocalServers both use the same .net core editions of MDrivenTurnkey and MDrivenServer.

Dlls are platform independent - but exe's are not: https://docs.microsoft.com/en-us/dotnet/core/deploying/ - this leads to a separate publish being needed to get the Linux distribution:

dotnet publish -r linux-x64 --self-contained false

You can download the Linux distributions from here: https://mdriven.net/PublicDownloads/MDrivenServerCoreLinux_<version>.zip.

The current version is found here: https://mdriven.net/PublicDownloads/MDrivenServerOnCoreVersion.xml

https://mdriven.net/PublicDownloads/MDrivenTurnkeyCoreLinux_<version>.zip.

The current version is found here: https://mdriven.net/PublicDownloads/MDrivenTurnkeyOnCoreVersion.xml

Download the server-zips as described above. In these 2 zips, you will find StreaminAppCoreWebApp.dll (TurnkeyServer as dll), and AppCompleteGenericCore.dll (MDrivenServer as dll).

Expand the zips to your desired locations on Linux - in two different directories.

Starting on Linux

To start the applications, install at least dotnet core 3.1 on your Linux machine.

Configure MDrivenServerOverride to set the address and port to MDriven Server.

Start the applications - MDrivenServer first - by navigating to the directory of the app and:

dotnet AppCompleteGenericCore.dll -port=5010 -nohttps

Then, navigate to the TurnkeyApp directory and:

dotnet StreaminAppCoreWebApp.dll -port=5011 -nohttps
2021-05-18 15h34 54.png

After starting, navigate to the MDrivenServer by using the chosen URL - log in with user "a" and password "123456".

The MDrivenServer does not yet have a model - upload a model with MDrivenDesigner. After this step, you can run the application in the MDrivenTurnkey.

Tips and Tricks

This is no Linux-expert-wiki - but I noticed that the WorkInfo page of MDrivenServer ran into problems while creating bitmaps. It turned out that there was some graphics lib missing on the server - the following fixed it:

sudo apt-get install libgdiplus 
cd /usr/lib 
sudo ln -s libgdiplus.so gdiplus.dll
This page was edited 44 days ago on 03/26/2024. What links here