Skip to content

Instantly share code, notes, and snippets.

@andreibosco
Last active August 21, 2022 22:34
Show Gist options
  • Save andreibosco/7cc4547771be28ad3e3db3f9a03ff9f8 to your computer and use it in GitHub Desktop.
Save andreibosco/7cc4547771be28ad3e3db3f9a03ff9f8 to your computer and use it in GitHub Desktop.
running CPNtools 4.0.1 on MacOS

Running CPN Tools on MacOS Mojave

Based on the linux (Ubuntu) instructions by Sebastiaan J. (Bas) van Zelst available at https://www.win.tue.nl/~svzelst/misc/

  1. Download CPN Tools (for windows) from: http://cpntools.org/download
  2. Install wine: brew install wine
  3. Install CPN Tools using wine and make sure to include the MacOS simulator: wine cpntools_4.0.1.exe
  4. If this does not work due to a missing java version, download OpenJDK JRE installer from https://adoptopenjdk.net/
    • Remember that you have to download the Windows version and install it using wine
    • To install the .msi version, use wine start $installer, replacing $installer with the actual filename
  5. Download this bash script and place it in: ~/.wine/drive_c/Program Files (x86)/CPN Tools (or wherever you installed CPN Tools)
  6. Run the bash script
  7. The CPN Tools simulator will not be able to start yet; Go to: Options > Simulator Process. There, enable the Remote option and fill out the following details:
    • Host: localhost
    • Port: 2098
    • Runtime: ./cpnsim
    • Image path: cpn.ML.x86-darwin
  8. Restart CPN Tools using the bash script
    • If the simulator started correctly then you should see a CPN tools icon on your status bar. Double-click on item to open the CPN Tools Simulator Extension Server.
    • If the simulator is still not working, and, in the file ~/.wine/drive_c/Program Files (x86)/CPN Tools/sim_out.log it is mentioned that java is not recognized as a program, then, run wine regedit. Within the regedit HKEY_CURRENT_USER/Environment, add a String value, named PATH and the value must be the location of your java binaries. E.g., C:\Program Files (x86)\AdoptOpenJDK\jre-8.0.232.09-hotspot\bin\
  9. CPN Tools should now be working properly
@lucassm
Copy link

lucassm commented Jan 31, 2020

Thanks Andrei! This tutorial works for Linux too! You just need to change the 'darwin' word to 'linux' in all commands, and works for Linux!
Thank you for share!

@andreibosco
Copy link
Author

Thanks Andrei! This tutorial works for Linux too! You just need to change the 'darwin' word to 'linux' in all commands, and works for Linux!
Thank you for share!

De nada Lucas :)

O tutorial original era para linux mas resolvi criar uma versão para mac e atualizar o passo sobre java para usar o OpenJDK.

@robwalton
Copy link

Thanks for sharing this @andreibosco. Am running the 64bit only macOS Catalina and so wine won't work directly with CPN Tools. I've tried using Crossover which does support 32 bit apps, but am getting "Access violation" errors. You haven't got VPN tools running on Catalina have you!?

@andreibosco
Copy link
Author

andreibosco commented Aug 15, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment