Comments (14)
Here's how to fix it:
- Run
outbash.exe --outbash-session
so that it will write outbash_port in your home dir - Run
sudo ln -s /home/lky/.config /root/.config
to pass outbash_port file to root user
from cbwin.
I'd actually advise testing/using MS interop if you can (that is: for now on Insider builds, and don't need any feature/behavior they don't provide yet). Actually they can do things we cannot without access to their implementation, or at least not with extreme difficulty and hacks. For example stdin forwarding just can't be perfect with an extra layer out of the implementation - like I'm forced to do; while once completely debugged their interop capable pipes will be just fine for that. I don't envision maintaining cbwin forever. (But I'll maintain it at least for people using stable versions of Windows.)
from cbwin.
$HOME of root is /root, not /home/lky, so wcmd can't read outbash_port file. And /root is not in DrvFs (/mnt/x), see also #20.
from cbwin.
wcmd is not used to run xxx.sh (but xx.exe/xx.bat), and there is no root user in Windows, this root user only works in WSL.
from cbwin.
@tomsihap Not sure if you're aware, but this feature was adopted into the driver by Microsoft since 14951, not that Xilun's work isn't excellent!
from cbwin.
Don't do sudo zsh (why are you running zsh and therefore its child wcmd as root?!)
That's only part of the problem.
You would also need to do
wcmd : cmd
The :
tells wcmd
, wstart
, and wrun
to launch in your %userprofile%
in Windows. Without that parameter, the cbwin utilities will attempt path translation of the "start in" directory, which matters for various programs.
For example, if the pwd
in your linux shell (bash, zsh, FiSH, csh, tcsh, whatever) is
/mnt/c/Windows/System32
,
running wcmd cmd
would launch cmd
in
C:\Windows\System32
from cbwin.
Thanks for your reply.
The point is that wcmd won't work under root, if I have a xxx.sh script need to run as root, it could not use wcmd.
from cbwin.
@lkytal Ummmm, I don't think there is a reason why you would ever need to run a wcmd script with Linux root.
from cbwin.
@goreliu Jinx!
from cbwin.
It's unfortunate wcmd does not work under root reached with a sudo (at least not without extra configuration), but I'm not sure it is worth to invest much energy in that. @lkytal what is more precisely your scenario where running wcmd as root would be important for you?
As a work-around, you can try to launch outbash with the --outbash-session option, or to elevate with su instead of sudo.
from cbwin.
@xilun Elevate with su does work, Thanks.
Running wcmd with sudo is not that important to me, but I do feel strange that wcmd behaves differently between root and normal users. Better support towards sudo may make this little interesting project better 😄
from cbwin.
Thanks a lot poma, this works !
from cbwin.
When this feature is supposed to be released in a stable windows build?
Does MS implementation work with interactive apps? (for example wrun ssh ...
doesn't work in cbwin)
from cbwin.
The next stable Windows release should be in spring 2017.
I can't speak for the MS team, but I think it is likely than interactive apps then work better with their interop and maybe some console updates, than they do on the Anniversary Update with cbwin.
For info I've started to play with console modes a little in cbwin (in a separate branch), but for now I did not found anything good enough when running on the Anniversary Update...
from cbwin.
Related Issues (20)
- wrun: can't translate a WSL VolFs path to a Win32 one HOT 7
- Default command handler HOT 10
- some win32 console programs "sometimes" do line feed instead of new line, but a workaround seems possible HOT 1
- a cmd-like behavior distinguishing between console / GUI target programs might be useful HOT 1
- backgrounded & force redirected caller => SIGTTIN
- Use double quotes to prevent word splitting may be better HOT 12
- Problem with arguments containing the character "&" HOT 1
- wcmd cmd no longer laggy, but eats characters HOT 1
- Let cbwin in session mode launch multiple wcmd instances in parallel HOT 11
- sockets for redirections are not using any security HOT 6
- wstart /mnt/c/windows does not work HOT 7
- behavior of environment variable inconsistent in regards to case sensitivity HOT 1
- No terminal support HOT 6
- Vagrant output doesn't wrap correctly HOT 4
- interactive win32 console programs are broken (input and output) HOT 5
- Native Windows support for launching Windows applications HOT 1
- Some inputted characters skipped in Docker interactive terminal HOT 1
- Starting parameters for bash.exe
- Can't remove cbwin from my pc HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cbwin.