Description
Windows 10 recently received Bash. This is made possible through a Ubuntu subsystem, which means commands executed in bash (bash.exe instead of cmd.exe) will run in the Ubuntu context. Since APT is enabled, Mono installation works.
I tested this on Windows 10 Enterprise (non-LTSB), Build 14316.1. These are the commands I used:
Installing Mono
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
Works as expected, no warnings/errors.
sudo sh -c 'echo "deb http://download.mono-project.com/repo/debian wheezy main">>/etc/apt/sources.list.d/mono-xamarin.list;apt-get -qq update;apt-get -qq install git gcc mono-complete'
No warnings / errors. Known issues:
- APT likes to get stuck in Windows Bash (
waiting for headers
). Rerunning the command will fix this. - APT complains about systemd et al. This can be safely ignored.
Both these issues are unrelated to Mono and don't have any impact on Mono or it's components as far as I can tell.
Testing
As a trivial test, I compile Turbo from source. This will test Mono, XBuild and mkbundle:
sudo sh -c "git clone http://github.com/turbo/src;cd src;xbuild *.sln /v:q;cp *.dll /usr/lib/;mkbundle -o /usr/bin/turbo *.exe;cd .."
Compiles fine:
XBuild Engine Version 12.0
Mono, Version 4.2.3.0
Copyright (C) 2005-2013 Various Mono authors
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: warning : Reference 'System.ComponentModel.Composition.Registration' not resolved
OS is: Linux
Sources: 1 Auto-dependencies: False
embedding: /root/src/turbo.exe
Compiling:
as -o temp.o temp.s
cc -ggdb -o /usr/bin/turbo -Wall temp.c `pkg-config --cflags --libs mono-2` temp.o
Done
Let's run the tests:
root@localhost:~# ls
src
root@localhost:~# turbo src/Tests/tests.js -o ./foobar.exe
Warning in file <src/Tests/tests.js> at (80,6): (TC1187) Variable might be uninitalized.
Warning in file <src/Tests/tests.js> at (407,9): (TC1187) Variable might be uninitalized.
root@localhost:~# mono foobar.exe
> Tests passed: 980/980
> Tests failed: 0/980
> Total time: 309 ms
Splendid. Everything works as one would expect. The only thing that doesn't work (yet) is the binfmt integration, i.e. mono foobar.exe
will succeed, but ./foobar.exe
will fail. This contradicts the default behavior in Ubuntu, but IMO this is a minor issue.
Adding a hint
My suggestion: Adding a hint somewhere, either on the install page for Windows or Linux that Mono also works in Windows Bash.
Personally, I find this to be quite exciting, as one can now have Mono running both natively on Windows and in the Ubuntu subsystem.