Gambas on Windows
Posted
#1
(In Topic #368)
Guru

<IMG src="http://www.cogier.com/gambas/GambasinMS.png">
</IMG>
Posted
Administrator

Posted
Regular

Posted
Guru

I followed instructions on the Gambas mailing list, copied below, thanks go to 'Admin' in Russia for this work.
Ok, so what you basically do is go to Microsoft Store which is in a start menu under the letter M obviously.
You probably already have an account if you got Windows installed, but if not, it will ask you to register, it's simple - just provide any email and password.
There just type Ubuntu in search bar and install Ubuntu app in one (or maybe two) click(s)
What will happen is you will have compact distribution of Ubuntu installed in Windows, it's a standard feature there nowadays. There's also Debian and it already has Gambas in repo, but it doesn't work, qt5 dependency is broken.
Now, when Ubuntu is installed, you will have Ubuntu app icon in Start menu, wich is basically a bash shell chrooted to Programm Files directory where your Ubuntu infrastructure is installed. When it would be first run it'll ask you to enable Windows Subsystem For Linux (WSL) and tell you exactly how to do it, also one click more or less.
Everything else is just installing Gambas (or anything else) in Ubuntu, so you add a PPA, then "apt-get update" then "apt install gambas3" and you are ready to go, console Gambas apps will now work if you run them from this bash console or by typing "wls <programm>.gambas" in windows cmd or anywhere else in Windows, even from .bat or .cmd file, or another program capable of "shell" operator.
Gambas in Ubuntu (at lease in Windows' repository) seems to be linked to QT4, and GTK3 is also there by default, so you can create and run those types of apps. And, as I've already said, you can run cli apps without any additional moves.
To run any graphical Linux program in Windows 10 you need an X server. Just google, download and install Xming, it's free and easy to install. There's also an X server in Microsoft Store but it's 50 bucks so no thanks.
When XMing is installed what I do is run a configurator that creates an Xlaunch file. So I tell it to not create a root window, just to be ready to serve apps without authentication, and then i put this xlauch file in Autorun in Start menu
So now you can either specify DISPLAY=:0 in bash cli and run any program from now on, or just create a basic windows shortcut with a line that I already provided before.
For example I have a app icon for Gambas on my desktop. The command it executes on double click is:
C:\Windows\System32\wsl.exe DISPLAY=:0 LANG=ru_RU.UTF-8 gambas3
it sets DISPLAY environment to work with Xmin and it sets my native locale, so I can see Gambas IDE in my native language.
That's it. Any software then written in gambas is run from such shortcuts with the same scheme: C:\Windows\System32\wsl.exe DISPLAY=:0 LANG=ru_RU.UTF-8 myprogramm.gambas
BTW the very same way you can ran, say, Firefox, or Chrome, or any other Linux version of graphical software that you install with apt in your pseudo Ubuntu. It works in Windows 10 just like that.
RedHat's Cygwin did this for years, but now Windows 10 just officially supports Linux binaries through WSL, so no need for any additional software. If you want to, say, run Apache or any other Linux non-graphical software - you don't even need Xming? just install Ubuntu, apt install your app and you are good to go. Even sshd works, but you have to remember that Windows 10 also has it's own SSH, so you have to disable it first.
Oh, and keep in mind that you can't mount anything and /dev is just empty, but your Windows drives are already in /mnt, so you still see all your Windows infrastructure and you can run Windows software from inside of this Linux chroot if you will
My experience with MS Shop was not good and I had to search the web to get MS Shop to point to the correct page. You will need to switch Win 10 to Developers Mode. It is Ubuntu that gives you Linux and Xming that gives you the X server. If you look at the picture above you will see a big 'X' on the taskbar which is Xming. Once Xming is running you can add a 'Shortcut' to the Win 10 Desktop to run Gambas or whatever Linux program you like. I discovered that if you need a special font, as I did, just create a '.fonts' folder in your Home folder and drop the font in there and the system will pick it up. Not everything is going to work, Nemo (file manager) does not do much. Some clever Linux man needs to create a distro with all the necessary included and I am sure someone will.
Posted
Regular

In Ubuntu do this
Code
$ cd ~
$ nano .bashrc
Go to the last line and write this :
Code
export DISPLAY=:0.0
Restart ubuntu, start Xlaunch from Windows (chose client), and then type gambas3.
Posted
Regular

Posted
Guru

Posted
Regular

Posted
Guru

Did you manage to create a shortcut to start Gambas directly from Win Desktop with VcXsrv, as described in your post with Xming?
It works the same way, once VcXsrv is running (Big 'X' in the System Tray). My shortcut to Gambas3 is: -
Code
C:\Windows\System32\wsl.exe DISPLAY=:0 gambas3
Posted
Regular

With me I just get a terminal window making a millisecond appearance…
Posted
Regular

Posted
Regular

What am I missing?
Bill
Retired 20-year USN veteran. In IT field since 1961.
Posted
Guru

1/. Follow the instruction here to install WSL and Ubuntu on Win 10 (The following instructions may not work if you choose a distro other than Ubuntu. I am fairly sure that the other distros wont like apt-get and adding a ppa.)
2/. In Terminal enter the following to install Gambas: -
For Gambas stable: -
Code
sudo add-apt-repository -y ppa:gambas-team/gambas3 && sudo apt-get update && sudo apt-get -y install gambas3OR
For Gambas daily build: -
Code
sudo add-apt-repository -y ppa:gambas-team/gambas-daily && sudo apt-get update && sudo apt-get -y install gambas33/. Install Xming X Server from here: -
4/. Launch XLaunch and accept all the defaults.
5/. Open Ubuntu from the main menu and type gambas3
That’s it.
<IMG src="http://www.cogier.com/gambas/Win10Gambas.PNG">
Posted
Regular

Bill
Retired 20-year USN veteran. In IT field since 1961.
Posted
Guru

See if the Gambas daily tips are on a hidden window behind all the others.
Posted
Regular

Task Manager shows no CPU activity for either the app or the container window at all that I can see. Very strange. I'm going over all the x-window settings to see if there's something there I missed. The Ubuntu command terminal works just fine, though.
Bill
Retired 20-year USN veteran. In IT field since 1961.
Posted
Trainee
Windows 10 is Getting Support for GUI Linux Apps - OMG! Ubuntu
I wonder what this means for gambas applications?
Posted
Guru

I wonder what this means for gambas applications?
We will have to wait and see but it does work reasonably now.
1 guest and 0 members have just viewed this.

