-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mention Windows Bash? #199
Comments
Given that this feature is only in the current insiders preview and it's totally unsupported at this point (though awesome that Mono just works!) I don't want to put a prominent note on the download page. We can certainly add a note at the bottom of the Windows install page with a link to this GitHub issue though :) Want to send a PR? |
Done ;-) |
Addendum 1: Set up a X server for Windows FormsYes. It is indeed possible to run (Mono) GUI applications in Windows Bash. All you need is a X server on the native-Windows side. I used Xming for this. You can install Xming without PuTTY, since you don't need a SSH client anymore - just use bash's SSH. After installing and starting your X server do this:
That's it. I've tested it using this simple boilerplate Form:
Code: import System;
import System.Windows.Forms;
import System.Drawing;
import Accessibility;
class MonoBashGUITest extends Form {
var btn : Button;
function MonoBashGUITest() {
btn = new Button;
btn.Text = "Fire Event";
Controls.Add(btn);
btn.add_Click(FoobarEvent);
}
function FoobarEvent(sender, e : EventArgs) {
MessageBox.Show("Boom! Event was fired!");
}
}
Application.Run(new MonoBashGUITest); Compile and run: turbo gui_test.js -s w
mono gui_test.exe And it works: This is only a very basic test, but you shouldn't run into any problems with more complex Windows Forms applications. |
I'm not sure if I'm excited about this or confused (windows forms on X on windows) |
@txdv it should be Windows Forms on Mono/X on Ubuntu on Windows 10. Well it bloats my mind. |
Build 14367There's a problem with mkbundle on WSL running on Build 14367. Not all of my tests succeed. Either there has been a change in Mono or in WSL. I'm investigating. To reproduce (clean WSL, no gcc, mono or git): wget -qO- git.io/ubuntu.sh|sh
turbo Trace:
|
There's definitely something wrong here. I can repro this on WSL, Ubuntu and even Travis CI agrees. I'm also not the only one running into this issue. It's a regression, the last working build is Mono 4.2.4. There are some less than helpful other bug reports about this. I've included them and the Travis Logs (contain stacktraces) in Bug No. 42169. To repro on a clean Ubuntu system:
Or, if Mono is already installed: 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 .."
turbo This seems to be a mkbundle issue, @akoeplinger, is there a bugtracker somewhere specifically for mkbundle, or is the above bug report sufficient? |
Regression Bug confirmed by others. Use Mono 4.2 as a workaround. Stay away from Mono 4.4 if you're going to use embedding at all. See Please take a look @akoeplinger, @alexrp, @vargaz (, @lambdageek ?). This applies to ubuntu/debian systems and affects multiple users. |
@minxomat Thanks, sorry for the delay. I think 42169 and 42058 are ultimately the same underlying problem. Please file any issues with Mono on Bugzilla, as this GitHub repo is only used for the website. |
I'm aware, I just needed a place to ping (and a point of reference for the WSL list) :-) |
Just installed WSL, but I cant setup the mono apt-get repos. I get following error (looks like certificates missing?) |
Well, first off, that's not a mono error. Read the actual error description:
Means your network config for apt is not setup correctly. Most likely cause for this is a proxy that is not setup correctly within bash or a mangled apt sources list. In any case, it's not related to Mono. Google the error and you'll get many threads troubleshooting this, e.g. this one. I've just setup a WSL instance and tried the same: |
You're right, it's not a mono error, I just wrote this here, because I was coming to this site when googling the error. I'm not behind a proxy, and this error happens on my machine on a fresh installed WSL. I don't get the error in my VirtualBox Ubuntu on the same machine. |
Uups, probably windows firewall. |
Yep, it was my antivirus program's firewall. |
@simonegli8 If in the future you have problems with Mono in WSL, I'd ask you to open an issue here and ping me. |
Also, Update: WSL now fully supports X server communication. See above for how to setup an X server on the Windows side. That means (among other things), that you can now run any GUI ubuntu application. E.g. firefox, monodevelop, your favorite terminal etc. Specifically you can now have completely separate monodevelop instances running (one on Windows, one on WSL), both at the same time. Linux applications and Windows applications can even access the same directory on disk at the same time. |
Followed the instructions to install mono and I can run console based applications without any problems, but trying to run a WinForms app yields the following error:
Using Windows 1607 and mono (under WSL) version 4.8.1 |
Notes updated 2018.05.29
# 16.04
sudo sh -c 'echo "deb http://download.mono-project.com/repo/ubuntu xenial main">>/etc/apt/sources.list.d/mono-xamarin.list;apt-get -qq update;apt-get -qq install git gcc mono-complete'
# 18.04
sudo sh -c 'echo "deb http://download.mono-project.com/repo/ubuntu bionic main">>/etc/apt/sources.list.d/mono-xamarin.list;apt-get -qq update;apt-get -qq install git gcc mono-complete' Debian repo seems do not compatible with the latest WSL on Win10 1803. The debian repo in first thread will give dependency unmet error when |
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
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:
waiting for headers
). Rerunning the command will fix this.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:
Let's run the tests:
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.
The text was updated successfully, but these errors were encountered: