Gambas on Windows

Post

Posted
Rating:
#1 (In Topic #368)
Avatar
Guru
cogier is in the usergroup ‘Guru’
Gambas running in Windows 10 next to Visual Studio
<IMG src="http://www.cogier.com/gambas/GambasinMS.png"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Administrator
sholzy is in the usergroup ‘unknown’
 How'd you manage that? Were you using a VM?

sholzy
Gambas One Site Director

To report bugs in the Gambas IDE:
Official Gambas Bug Tracker
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Regular
jornmo is in the usergroup ‘Regular’
Cygwin

Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Guru
cogier is in the usergroup ‘Guru’
No this is not done with a VM or Cygwin.

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.
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Regular
jornmo is in the usergroup ‘Regular’
Thanks! I had a lot of success with VcXsrv too. This seems to be more up to date than xmings, and it is free too. (The up to date versions of xming is £10 per year.)

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.

Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Regular
jornmo is in the usergroup ‘Regular’
I tried Gambas under Cygwin many times before, but it always chrashed. This seems stable so far.

Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Guru
cogier is in the usergroup ‘Guru’
Yes VcXsrv is better as it allows windows to resize in real time.
Online now: No Back to the top

Post

Posted
Rating:
#8
Avatar
Regular
jornmo is in the usergroup ‘Regular’
Did you manage to create a shortcut to start Gambas directly from Win Desktop with VcXsrv, as described in your post with Xming?

Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Guru
cogier is in the usergroup ‘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
Online now: No Back to the top

Post

Posted
Rating:
#10
Avatar
Regular
jornmo is in the usergroup ‘Regular’
Hmm <EMOJI seq="1f914" tseq="1f914">🤔</EMOJI>

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

Online now: No Back to the top

Post

Posted
Rating:
#11
Avatar
Regular
Technopeasant is in the usergroup ‘Regular’
Could you link to the original mailing list post?
Online now: No Back to the top

Post

Posted
Rating:
#12
Avatar
Regular
issboss is in the usergroup ‘Regular’
 Perhaps I am misunderstanding something, but I followed all the instructions and now can bring up Gambas3 (latest version) on my Windows 10 machine in an X-window. My problem is the startup screen where I am to create, choose, or search for a project. I absolutely cannot get beyond that screen. Once the dialogue window showing me my directory tree appears there is NO way to move it, remove it, or move on to the project. There is no "X" at the title bar of the dialogue box, nor any known keystrokes to make that box go away and let me get on with it. All I can do is go to the X-window and use the "X" to kill the window, which kills Gambas and everything else.

What am I missing?

Bill

Retired 20-year USN veteran. In IT field since 1961.
Online now: No Back to the top

Post

Posted
Rating:
#13
Avatar
Guru
cogier is in the usergroup ‘Guru’
I have had the opportunity to reinstall Window 10 so I thought I would make a note of how to install WSL and Gambas.

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 gambas3

OR

For Gambas daily build: -

Code

sudo add-apt-repository -y ppa:gambas-team/gambas-daily && sudo apt-get update && sudo apt-get -y install gambas3

3/. 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"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#14
Avatar
Regular
issboss is in the usergroup ‘Regular’
 Sorry. Same results as I originally posted. The dialogue window for choosing the project opens, but that is as far as I can get. There is NO way to actually open that project, nor is there a way to get out of that dialogue box. Clicking various projects only causes the dialogue box to refresh, not take me to that project.

Bill

Retired 20-year USN veteran. In IT field since 1961.
Online now: No Back to the top

Post

Posted
Rating:
#15
Avatar
Guru
cogier is in the usergroup ‘Guru’
Hi Bill,

See if the Gambas daily tips are on a hidden window behind all the others.
Online now: No Back to the top

Post

Posted
Rating:
#16
Avatar
Regular
issboss is in the usergroup ‘Regular’
 That's part of the problem. The windows cannot be moved because they are modal to the top-level window. The dialogue window seems to be insensitive to any operator input. It's like the app suddenly ceases to exist as far as the OS is concerned.

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.
Online now: No Back to the top

Post

Posted
Rating:
#17
Trainee
Windows 10 is Getting Support for GUI Linux Apps via WSL 2

Windows 10 is Getting Support for GUI Linux Apps - OMG! Ubuntu


I wonder what this means for gambas applications?
Online now: No Back to the top

Post

Posted
Rating:
#18
Avatar
Guru
cogier is in the usergroup ‘Guru’
Hi  twinsonian and welcome to the forum.

I wonder what this means for gambas applications?

We will have to wait and see but it does work reasonably now.
Online now: No Back to the top
1 guest and 0 members have just viewed this.