Skip to content
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

PS command is not listing Windows processes #2110

Closed
rrezino opened this issue May 15, 2017 · 12 comments
Closed

PS command is not listing Windows processes #2110

rrezino opened this issue May 15, 2017 · 12 comments
Labels

Comments

@rrezino
Copy link

rrezino commented May 15, 2017

  • Your Windows build number: Microsoft Windows [Version 10.0.15063]

  • What you're doing and what's happening: When you use the PS command, it doesn't list the Windows processes

  • What's wrong / what should be happening instead: I should be able to see the Windows processes on the list as well

  • Strace of the failing command, if applicable: use command ps on ubuntu terminal

@sunjoong
Copy link

@rrezino - Yes, it is, as expected.

@MikeGitb
Copy link

@rezzino: I guess it would help your case if you would provide a use case. E.g. do you need this functionality for your build setup to work?

@therealkenc
Copy link
Collaborator

"Use case" -- fair question. Interesting though, Cygwin/MSYS2 has a -W option in their ps implementation, that includes Windows processes in the list. Presumably not for their health, but I couldn't tell you why exactly. Shrug. Could be for their health, I guess.

@Dr-Irv
Copy link

Dr-Irv commented Jul 6, 2017

Here's a use case. I have a Windows program that takes a while to run and uses memory. I want to use ps to monitor the process size via ps --pid <windows-pid> -o vsz= . I do this on Linux, but would like to use the same script to monitor the Windows processes.

@MikeGitb
Copy link

MikeGitb commented Jul 6, 2017

To be honest, I'd rather use windows tools to monitor windows processes, but I can understand your desire to use the same script everywhere.

@philwalk
Copy link

philwalk commented Mar 24, 2018

lacking this feature (ability to monitor windows processes) will prevent migration from cygwin for anything that needs to launch and control windows processes. I've got a couple of candidate applications that are preventing me from migrating.

@therealkenc
Copy link
Collaborator

Call tasklist.exe inside WSL using interop. You can "launch and control" windows processes with ease with WSL (this is part of its charm). Bearing in mind that the PID namespace for the Windows process and your WSL processes will be different.

@philwalk
Copy link

when you "control", do you mean by using windows cli tools (e.g., taskkill.exe)?

@therealkenc
Copy link
Collaborator

therealkenc commented Mar 24, 2018

Yes. You aren't going to get Cygwin equivalence because Cygwin ps is not Linux ps (anymore than you can with say Real Linux in a VM). But you can invoke anything in Windows from a WSL instance, be it tasklist.exe, taskkill.exe, or notepad.exe with impunity using interop as of Creators Update 15063.

@j-aho
Copy link

j-aho commented Feb 21, 2020

I know this issue has been closed, but the proper solution to this had been if the microsoft windows processes had been presented as it's own namespace in the WSL, most of the GNU tools would have without modification been able to handle this and allowed computer users to get a full control of the game os too.

@zanfilip
Copy link

zanfilip commented Apr 28, 2020

I know there's tasklist and wmic but having to call these within a wsl linux distro means having to parse 2 more program ouput instead of just one. Making any custom script tools I create ( actually already have on cigwin ) more complex. Not all windows programs are launched from wsl!!

Ps yet another reason migrating from cygwin is proving tricky! :(

@Silentdoer
Copy link

the feature has been completed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants