This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 267478 - [Terminal] - Ubuntu on Windows 10, Netbeans can't use terminal from the Linux subsystem
Summary: [Terminal] - Ubuntu on Windows 10, Netbeans can't use terminal from the Linux...
Status: CLOSED INVALID
Alias: None
Product: cnd
Classification: Unclassified
Component: Terminalemulator (show other bugs)
Version: 8.1
Hardware: PC Windows 10
: P2 normal (vote)
Assignee: ilia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-08 09:36 UTC by Christian Lenz
Modified: 2017-12-06 14:33 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Lenz 2016-08-08 09:36:31 UTC
With the upgrade of windows 10 (1607, Build: 14393.10) windows added Ubuntu as a subsystem to windows natively. So I have to activate the feature Linux subsystem for windows (beta) to get a shell. I thought that Netbeans is intelligent enough to detect such subsystem and I can use the bash shell inside the terminal of netbeans. But when I open the terimal and click on the first icon I got the normal message: Unable to start pty process. Bash is available global in the windows system via the command "bash". Is there smth that I have to do, to use it with netbeans?


Cheers

Chris
Comment 1 ilia 2016-08-08 09:54:23 UTC
Hi Chris,

I haven't tested "native" windows bash yet, as you correctly said, it's beta. I'll take a look on this issue soon. NetBeans' Terminal behavior differs on Unix/Windows systems and most likely NetBeans doesn't expect to find bash.exe not as a part of Cygwin/Msys.
Comment 2 Christian Lenz 2016-08-08 11:22:28 UTC
Nice to hear. Thx.
Comment 3 Christian Lenz 2017-05-11 07:43:27 UTC
I think it should be easy, because the code already looks for bash or bash.exe insight the code of the dlight.terminal module. The bash.exe for ubuntu on windows is located here: C:\Windows\System32\bash.exe so I played a bit around, but no effect atm.
Comment 4 Christian Lenz 2017-05-11 07:44:03 UTC
Would be great to see it soon maybe. Will be a great enhancement. Makes work easier.
Comment 5 Christian Lenz 2017-05-11 07:45:36 UTC
The folders are located to here: C:\Users\[username]\AppData\Local\lxss
Comment 6 soldatov 2017-07-07 22:10:19 UTC
WSL can be used as a remote host. Step in order to  prepare "host".

1) install WSL
2) update Ubuntu
3) fix ssh server (https://superuser.com/questions/1111591/how-can-i-ssh-into-bash-on-ubuntu-on-windows-10)
----------------------------------------------
sudo apt-get remove --purge openssh-server
sudo apt-get install openssh-server
sudo vi /etc/ssh/sshd_config # Change Port from 22 to 2222
sudo service ssh --full-restart
----------------------------------------------
4) apt-get install unzip (I can't create Welcome sample without 'unzip' utility)
5) add localhost:2222 remote host in NetBeans
6) check build, run, debug, terminal
Comment 7 ilia 2017-07-10 08:34:49 UTC
valera,

What Windows version do you use?
I tried to investigate this feature in the most naive way: to use WSL's bash.exe as a Shell/login shell for Windows' local host.

But I faced this issue:
https://github.com/Microsoft/BashOnWindows/issues/2
https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13425768-allow-windows-programs-to-spawn-bash

and had to upgrade to 14926+ version of Windows Insider program.
Haven't got a chance to test it on this version yet.

Btw, it's great that WSL can work as a remote host!
Comment 8 Christian Lenz 2017-07-10 08:39:02 UTC
I use latest Windows 10 stable version and it worked. Thx. The only problem is, that I have to leave the bash open to use it. It is ok but it should work without having the bash open.
Comment 9 ilia 2017-07-10 08:57:37 UTC
As a workaround you can try to add bash.exe to autorun.
Also you can connect to a remote host as Valera (soldatov) described, and then "pin" this remote terminal session (right click -> Pin Tab). This will open the remote session every time you start IDE.

I will try Windows Dev build to see if it's possible to start bash.exe without an issue described here https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13425768-allow-windows-programs-to-spawn-bash and will get  back with results.
Comment 10 Christian Lenz 2017-07-10 09:01:08 UTC
I did what soldatov said, it worked fine. I have a remote host inside netbeans, but this is only working, when the bash.exe is open, outside netbeans. I wondered, I closed the bash and the terminal window went away. So of course it is all a quite workaround, but native implemetation inside NB would be better. Because now I have to open both, the terminal and the bash (outside). But my intention is not to open the bash extra for that.
Comment 11 soldatov 2017-07-10 11:38:01 UTC
(In reply to ilia from comment #7)
> What Windows version do you use?
Usual Windows 10 (not a "Windows Insider program")

> https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-
> ubuntu-on-windo/suggestions/13425768-allow-windows-programs-to-spawn-bash
Already fixed

My biggest problem, 'bash' doesn't start SSH server by default, because WSL is not a real Linux. Therefore I need to use "sudo service ssh start" command every time.
Comment 12 Christian Lenz 2017-12-06 14:28:01 UTC
I will close it, because it will handled now at the JIRA board: https://issues.apache.org/jira/browse/NETBEANS-181. Please feel free to change the state of the ticket.