microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.46k stars 821 forks source link

Way around limitations of using `/mnt/c/Windows/System32/cmd.exe /C <app.exe>` #2754

Closed blsingh closed 6 years ago

blsingh commented 6 years ago

SORRY,

This is not the appropriate forum for my inquiry.. I had posted a question under 'WSL' tag in stackoverflow and did get much help so..

I use the command such as : /mnt/c/Windows/System32/cmd.exe /C R or /mnt/c/Windows/System32/cmd.exe /C TERR.exe

to run my R installed in windows & use tmux/vim its quite useful and I am adopting to it, time permitting reading about this-or-that to get the most out of it.

There are issues I have noticed such as I cannot scroll the past commands with the up-arrow or use history( ) with R launched in WSL with /mnt/c/Windows/System32/cmd.exe /C R --vanilla

My question is if I want to run R that is installed in windows (I know I can install R on WSL-Bash with apt-get install but If I want to run a app installed on windows using /mnt/c/Windows/System32/cmd.exe /C <app> after giving its path in windows - this dose not seem to be the intended way of doing this, so is there a better way that I am missing?

Again sorry for posting a question here but if there is a better forum than stackoverflow WSL thread please share.

Thanks.

gwojan commented 6 years ago

Is R in your Windows path and what version of Windows 10/WSL are you running? I don't remember when it was added but later versions of WSL inherit the Windows path. If your executable is in the path just call it directly, ie: R.exe.

blsingh commented 6 years ago

Let me also try different window 10 install. I am not sure if something is up with my "version". I have just got a new laptop(GREY laptop) with Windows 10 on it and in that one I yesterday installed WSL, the Ubuntu was 16.04 release, while the laptop I have been using, and I constantly update it too, still has Ubuntu 14.04(RED Laptop).

The the Red laptop that I have been using for some time now, that has been/is my primary laptop is:: Windows 10 Home Version 1709 OS Build 16299.125

Yes R is in my path(RED laptop), I can start it from command Prompt by typing R, and in WSL/Bash prompt I have to call it with /mnt/c/Windows/System32/cmd.exe /C R if I wish to use the R install on windows, but more importantly when it starts its not like the one that gets started in the Command prompt (the auto complete is not working, nor the the history function, etc)

To clarify my inquiry again :: I need to know if I can Run applications that I can run in windows (cmd prompt) from WSL/Bash without reinstalling them with apt-get (app name) WSL. Specifically R and Python. (side note: I have Xming that I use and can run firefox or other graphical apps/displays from Bash.)

Thanks for the reply.

WSLUser commented 6 years ago

@blsingh As long as the the directory your app install is included in the $Path in WSL, you call it directly just as easily as notepad.exe. If you have it on a separate directory, try adding the path into your env var on WSL. You will want to run Python installed from WSL vice Windows due to some limitations on the Windows side but your use case may not see those limitations. Just bear in mind that programming in Linux is often superior to Windows and is part of why we have WSL. I'd recommend using Visual Studio as well if you don't have it already. If you plan on using your old laptop still, you need to update your version of Windows to FCU and/or you can turn it into an Insider build version (or use the newer laptop for Insider) to get the most updated version of WSL.

zadjii-msft commented 6 years ago

See #2731.

The interop story is really only a half-measure at the moment. Running commands that exit quickly work very well in interop, but trying to run interactive windows commandline applications probably won't work all that well. In the case of R and python, i'd recommend just installing the linux versions within WSL, it'll make your life 100% easier.

blsingh commented 6 years ago

Thanks

I appreciate getting input

The interop stuff is very exciting but it should not become my focal point as I am student of analytics. That said It have enjoyed setting up a workstation where I can work from Bash prompt, use linux utilities to process files, run Python, R and MySQL from WSL session which I run in tmux session and thus can save my session(I/O) as well as scripts that can contain different languages (using vimux/slime).

It all started as I started working with sqlcmd and was hoping to just use the installation from windows, then I can a different commercial R engine called TERR. So I can use both of these in my data analysis session from Bash prompt and this is how::

/mnt/c/Windows/System32/cmd.exe /C TERR.exe OR /mnt/c/Windows/System32/cmd.exe /C sqlcmd

i.e. after they are in my windows PATH and I can run them from wixeendows Command Prompt. I will stop trying to dig in deeper here and just enjoy the functionality I have discovered but its really helpful to hear from other (working in a vacuum, I am) and get input from what y'all know. Thanks again, Best.

On Fri, Dec 15, 2017 at 12:53 PM, Mike Griese notifications@github.com wrote:

See #2731 https://github.com/Microsoft/WSL/issues/2731.

The interop story is really only a half-measure at the moment. Running commands that exit quickly work very well in interop, but trying to run interactive windows commandline applications probably won't work all that well. In the case of R and python, i'd recommend just installing the linux versions within WSL, it'll make your life 100% easier.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/WSL/issues/2754#issuecomment-352109035, or mute the thread https://github.com/notifications/unsubscribe-auth/AViCBqk0fa2lAR_1_siaLNyuLbfuItBqks5tAtwrgaJpZM4RCb2E .