Skip to content

Instantly share code, notes, and snippets.

@warp1337
Last active July 13, 2019 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save warp1337/bca69096ed3716baaa30c74de904a48d to your computer and use it in GitHub Desktop.
Save warp1337/bca69096ed3716baaa30c74de904a48d to your computer and use it in GitHub Desktop.
Running Margin Linux on Windows 10

DISCLAIMER This is no official margin support channel/document. Use at your own risk.

HowTo (must be done only once)

  • This gist will show you how to run margin-linux on Windows 10. Well, this sounds really odd, but it is an interesting alternative.

  • First install the WSL. Before installing any Linux distros for "Windows Subsystem for Linux" (WSL), you must ensure that the WSL optional feature is enabled. Open PowerShell as Administrator and run:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

    Restart your computer when/if prompted.

  • Now, install Ubuntu 18.04 using the Microsoft Store by searching for Ubuntu. You need to download and install it. If you encounter any problems, maybe check this link

  • Once you have set up the Windows Subsystem and installed Ubuntu, click "Start" and enter bash. Click the first option (the bash run command) to start using Linux. Now, continue by running update and upgrading your Ubuntu:

    sudo apt update && sudo apt upgrade

  • While this upgrade is running, go to Sourceforge to download and install the VcXsrv Windows X Server on Windows. This tool is used to actually run GUI applications, such as margin, in your WSL (Ubuntu).

  • Once VcXsrv is installed, go back to your Linux bash and install the following:

    sudo apt-get install -y lxde lxterminal libfontconfig1 mesa-common-dev gedit \
    libglu1-mesa-dev libasan4 libubsan0 gdb nano libxcb-xkb-dev libxkbcommon-* firefox unzip
    
  • Following the installation of LXDE etc, input these commands in the terminal (bash).

    export DISPLAY=:0
    export LIBGL_ALWAYS_INDIRECT=1
    

    This is a temporary solution, to persist the settings see below (gedit command).

  • We installed VcXsrv above which features the XLaunch tool. Click "Start" search for XLaunch and run it to view the display settings. Select One large window or One large window without titlebar. Look for the display number and set it to 0. See image

  • Click next, then select start no client. Now, click next — DONE! You might first like to click save configuration to save it. See image

  • WOW. Now go back to your initial linux bash and run startlxde You should see a full Linux desktop on Windows! 🤯 You can start a browser, e.g., firefox, go to margin.de and download the latest version or beta (posted in Telegram). You might want to remember the download folder, e.g., "Downloads".

  • Unzip (right click: extract here) the linux download and run the following command in a terminal. To open a Terminal in Linux press CTRL+ALT+T or use the menu, search for terminal.

    cd ~/Downloads/margin-linux
    ./run-margin.sh
    

    Awe- wait for it -some.

  • Once you are at it: close margin and run gedit ~/.bashrc in the terminal. You will see a text editor. Please append the following at the end of the file and save it.

    export DISPLAY=:0
    export LIBGL_ALWAYS_INDIRECT=1
    

Daily Use

The steps above only need to be run once. For daily use just start the bash (click "Start" ...) in windows then go to the folder where you downloaded margin, e.g., cd ~/Downloads/margin-linux, ./run-margin.sh This assumes you added the DISPLAY settings to your .bashrc (see above) otherwise, input the commands above before running margin.

THAT'S IT margin should appear in a XWindow on your Windows Desktop.

Final Notes

  • Please note that your margin settings are separate from the ones you use with your native windows margin installation.
  • Images credit: https://static.makeuseof.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment