With the release of SP13 it is now finally possible to run CODESYS on Wine. The whole procedure is not very straight forward, but still easily possible.
You can download CODESYS from the CODESYS store (use 32bit version). You need an account for that, before you can download it, but all is for free.
At the time of writing this, I needed to install the development version of wine.
sudo apt-get install wine64-development cabextract
You will need to download winetricks, which helps you in installing Dot Net, as well as several Visual C++ Runtimes:
wget -c https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod 755 winetricks
Like already mentioned above, you should install some packages using winetricks. I recommend ot use an own wine directory for that:
WINEPREFIX=~/.wine.codesys ./winetricks vcrun2005 vcrun2008 vcrun2013 vcrun2015 dotnet46
The emulated windows has to be configured to Windows 7. You can do so by using winecfg:
WINEPREFIX=~/.wine.codesys winecfg-development
WINEPREFIX=~/.wine.codesys wine-development ~/Downloads/CODESYS\ 3.5.13.0.exe
Just click through the first part of the setup, and always ignore errors, if s.th. could not be installed.
Do not cancel the installer, just deselect every component of the Codemeter Setup, as this will fail.
This is a dialog, which takes a long time. Just wait, it will finish.
In the custom setup you should deselect all, except CODESYS itself (no OPC DA, no CODESYS Control Services, ...)
Codesys Gateway works on 32bit and 64bit edition.
After the installation finished successfully, you need to add a registry key. Without this, I got an error of wine, saying "The specified user does not have a valid profile".
WINEPREFIX=~/.wine.codesys wine-development reg add "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\S-1-5-21-0-0-0-1000"
CODESYS should now be ready to start...
WINEPREFIX=~/.wine.codesys wine-development ~/.wine.codesys/dosdevices/c\:/Program\ Files\ \(x86\)/CODESYS\ 3.5.13.0/CODESYS/Common/CODESYS.exe
You can install the Linux RTE and login with your Codesys IDE to this PLC.