windows-subsystem-for-linux

Kicking off a WSL bash-based build from Visual Studio 2015

ε祈祈猫儿з 提交于 2019-11-29 11:02:09
I recently started using the Windows Subsystem for Linux (WSL) to see if my Linux Makefile & arm-none-eabi-gcc based microcontroller project would build "natively" in Windows. To my surprise, the tool chain and Linux based development tools installed and worked perfectly on first go, without any modifications to the Makefile. So that got me thinking to try doing all my code editing in Visual Studio using the IDE features while doing the actual build in the Linux & bash environment provided in WSL. Unfortunately, when specifying a "Build Command Line" in the NMake options for my Visual Studio

How to Add Linux Compilation to Cmake Project in Visual Studio

瘦欲@ 提交于 2019-11-29 04:31:45
Visual Studio has added lots of new features for C++ in the past year. CMake With the CMake support, I can do "Open Folder" and select a folder with a CMakeLists.txt file in it. Visual Studio does a lot of nice work in discovering and building it automatically. Linux Compilation Visual studio now supports remote compilation on Linux over SSH. Several tutorials show how users can create a new "Linux Console Application" in Visual Studio, and it will automatically ask to setup an SSH connection to be used for building it. I don't see any instructions for how to do this on an existing project of

Exec format error 32 bit executable Windows Subsystem for Linux?

夙愿已清 提交于 2019-11-29 04:22:40
When I try to execute a 32bit file compiled with gcc -m32 main.c -o main on Windows Subsystem for Linux , I get the following error: bash: ./main: cannot execute binary file: Exec format error . If I compile it without -m32 it runs. Any solution for running 32 bit executable on WSL ? Thanks. 32-bit ELF support isn't provided by WSL (yet). There doesn't seem to be any progress since the UserVoice was raised - you are out luck. See UserVoice: Please add 32 bit ELF support to the kernel and Support for 32-bit i386 ELF binaries . If possible, switch to a real Linux ;-) QEMU and binfmt support

Windows Bash and Visual Studio Code: How can I launch bash as a run task?

两盒软妹~` 提交于 2019-11-29 02:18:02
how can I run the Windows Bash from Visual Studio code as a run task? Here are some of my many attempts at tasks.json to do this. { "version": "0.1.0", "command": "cmd", "isShellCommand": true, "args": [ "RunShellScript.bat" ], "showOutput": "always" } RunShellScript.bat has only this line: bash myShellScript.sh . Which if you just open cmd from start, and type that line, it will execute. It also runs perfectly if you just double click the file as well. However, when launched from VSCode, this output just hangs until I terminate it. Attempt number 2: { "version": "0.1.0", "command": "cmd",

How can a run Windows executable from WSL (Ubuntu) Bash

こ雲淡風輕ζ 提交于 2019-11-28 19:13:48
Along with Windows 10 Anniversary update for summer 2016, came the possibility to run ubuntu binaries inside the new Windows Subsystem for Linux (WSL) , a "lightweight" virtualized subsystem. Unfortunately, launching C:\Windows\System32\bash.exe , another bash ELF binary starts a process inside the WSL, from where you cannot escape! You may launch only other ELF binaries. So how can I execute *.exe files from Windows Bash?[1] [1] Question asked also in Microsoft's "official" GH support repo . In the Windows 10 Creators Update (build 1703, April 2017), this is natively supported. So you can now

Detect “Ubuntu on Windows” vs native Ubuntu from bash script [duplicate]

你离开我真会死。 提交于 2019-11-28 19:11:39
This question already has an answer here: How to check if a program is run in Bash on Ubuntu on Windows and not just plain Ubuntu? 6 answers Can a bash script detect if it's running in "Ubuntu on Windows" vs native Ubuntu? If so, how? I ran env on both machines and didn't see any obvious environmental variable differences. I could test for the existence of the /mnt/c directory, but that is not foolproof because that directory could potentially also be present on native Ubuntu. It looks like /proc/version in Ubuntu on Windows contains: Linux version 3.4.0-Microsoft (Microsoft@Microsoft.com)

Is usb supported on Bash on Ubuntu on Windows 10?

旧街凉风 提交于 2019-11-28 17:21:11
问题 I have no files or paths about usb on dev/ When I plug in a flash disk, nothing appears on dev/ or mnt/ or media/ about it. sudo lsusb returns: unable to initialize libusb: -99 What should i do to enable usb access on bash? 回答1: Good news, it is now possible to mount USB media (including FAT formated) and network shares with drvfs on Windows 10: Mount removable media: (e.g. D:) $ sudo mkdir /mnt/d $ sudo mount -t drvfs D: /mnt/d To safely unmount $ sudo umount /mnt/d You can also mount

How to use X Windows with Emacs on Windows 10 Bash?

那年仲夏 提交于 2019-11-28 17:17:52
I am using the Bash on Ubuntu on Windows program to use Emacs for C++. Right now, I can code everything using the keyboard shortcuts, however, I want to select text with my mouse or set the mark with my mouse instead of always having to use my keyboard. To get the X Windows System, I already did sudo apt-get install xserver -xorg but emacs still runs in a terminal editor. I don't know what other commands to use or how to get X Windows to start running. Windows bash does not support X Server. However, using a Windows X Server port such as MobaXTerm, XMing or vcXsrv in conjunction with Windows

Getting PyCharm to recognize python on the windows linux subsystem (bash on windows)

╄→гoц情女王★ 提交于 2019-11-28 15:46:34
问题 While running Linux versions of python, pip etc. "natively" on windows is amazing, I'd like to do so using a proper IDE. Since SSHD compatibility has not been implemented yet, I'm trying get PyCharm to recognize Linux python as a local interpreter. After installing the Windows Linux subsystem, typing bash -c python from the windows command line will drop you into a python shell. bash -c "echo \"print 'hello world'\" | python" works as well, producing "hello world" as output in the windows

How to remove the Win10's PATH from WSL

天大地大妈咪最大 提交于 2019-11-28 09:20:10
I use Windows Subsystem Linux(Ubuntu 18.04) in my Win10, and I install a Maven in it. Besides, I install a maven in Win10 before. Now when I used mvn compile in WSL, it told me that maven compile fail. I use which mvn and find that it references to the Maven installed in Win10. Besides, I run env and find that Win10's Path is added to the WSL's Path. I don't want to use any thing in Win10's Path when I use WSL, how should I do? Biswapriyo For Windows build LOWER than 17713: WSL uses WSL_DISTRIBUTION_FLAGS Enumeration to configure its behavior and interoperability between Windows and Linux side