microsoftdocs / wsl Goto Github PK
View Code? Open in Web Editor NEWSource code behind the Windows Subsystem for Linux documentation.
Home Page: https://docs.microsoft.com/windows/wsl
License: Other
Source code behind the Windows Subsystem for Linux documentation.
Home Page: https://docs.microsoft.com/windows/wsl
License: Other
I have a program that is failing with a message that it cannot create/open a semaphore.
I don't have access to the source of that program, but experimenting on my own I found the following:
error when running localectl:
Failed to get D-Bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
also no way atm to type @ unless it's a special keycombo?
Instead of having an FAQ item like: https://github.com/Microsoft/CommandLine-Documentation/blob/live/commandline/WSL/faq.md#can-i-run-other-linux-distros-than-ubuntu
It would be good to show or explain how a fedora, arch, or other user space could be created.
If the user space is truly separated from the WSL then you will only expand your testing by allowing other 'user spaces' to be created, and install applications ontop of them.
I copied over my .vimrc from a working Ubuntu machine. One of the lines is
set listchars=tab:⇥·,eol:↵,trail:·
This was mangled to
set listchars=tab:�~G���,eol:�~F�,trail:��
and it caused vim to output the following message:
Error detected while processing /home/cowens/.vimrc:
line 88:
E474: Invalid argument: listchars=tab:�~G���,eol:�~F�,trail:��
I then attempted to copy and paste UTF-8 data and all UTf-8 characters were stripped from the paste. As a further test, I wrote a simple Perl 5 script to output an e acute and got the following output
$ perl -CSDL -E 'say "\x{e9}"'
�
Next I tried setting the encoding to CP1252, and still didn't get an e acute:
$ perl -E 'binmode STDOUT, ":encoding(cp1252)"; say "\x{e9}"'
�
A test of the output shows that a Latin1/CP1252 e acute is being written:
$ perl -E 'binmode STDOUT, ":encoding(cp1252)"; say "\x{e9}"' | perl -Mbytes -nlE 'for my $c (split //) { printf "0x%02x $c\n", ord $c }'
0xe9 �
when trying to launch bash from an alternative console (ConEmu, MobaXterm) the arrow keys are comletely ignored
root@localhost:# ps -ef#
UID PID PPID C STIME TTY TIME CMD
missing btime in /proc/stat
root 1 1 0root@localhost:
They just can't start, or make the bash looks creepy.
Using the instructions at https://github.com/tokuhirom/plenv, the plenv bash script throws an error in step 4:
$ exec $SHELL -l
/home/cowens/.plenv/bin/plenv: line 15: /dev/fd/62: No such file or directory
plenv: cannot find readlink - are you missing GNU coreutils?
/home/cowens/.plenv/bin/plenv: line 15: type: write error: Broken pipe
This seems to be related to the following code from the script:
read READLINK < <( type -p greadlink readlink )
I can't find a good way to strace a bash command like read (I tried `strace bash -c 'read A < <(echo foo)', but got nothing useful from it).
After installing clisp with apt-get install clisp
, running clisp
results in the following error:
/usr/lib/clisp-2.49/base/lisp.run: error while loading shared libraries: libavcall.so.0: cannot enable executable stack as shared object requires: Invalid argument
npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install"
npm ERR! node v4.4.2
npm ERR! npm v3.8.5
npm ERR! path ../mime/cli.js
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall symlink
npm ERR! Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/mnt/c/users/kyle/Documents/dev/listomaniapi/node_modules/.bin/mime'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/mnt/c/users/kyle/Documents/dev/listomaniapi/node_modules/.bin/mime']
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'symlink',
npm ERR! path: '../mime/cli.js',
npm ERR! dest: '/mnt/c/users/kyle/Documents/dev/listomaniapi/node_modules/.bin/mime',
npm ERR! parent: 'listomaniapi' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /mnt/c/users/kyle/Documents/dev/listomaniapi/npm-debug.log
npm ERR! code 1
root@localhost:~/dev/listomaniapi#
root@localhost:/mnt/c/Users/Giant_ice5/afl-2.10b# cowsay
Command 'cowsay' is available in '/usr/games/cowsay'
The command could not be located because '/usr/games' is not included in the PATH environment variable.
cowsay: command not found
Seems you need to add a /usr/games directory in the default path?
I was following the instructions for setting up for building AOSP and I've been blocked by the installation of the openjdk.
I downloaded the openjdk-8-jre-headless.deb and rand dpkg -I openjdk-8-jre-headless.dep and then ran apt-get install -f .
I expected the dependencies and issues to get resolved but I got errors in a few places:
/dev/pts didn't work right for dumping error data.
some keytool command needing a mounted /proc
and issues with the cert setup.
root@localhost:~/test# apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Can not write log (Is /dev/pts mounted?) - openpty (2: No such file or directory)
Setting up ca-certificates-java (20130815ubuntu1) ...
the keytool command requires a mounted proc fs (/proc).
dpkg: error processing package ca-certificates-java (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of openjdk-8-jre-headless:amd64:
openjdk-8-jre-headless:amd64 depends on ca-certificates-java; however:
Package ca-certificates-java is not configured yet.
dpkg: error processing package openjdk-8-jre-headless:amd64 (--configure):
dependency problems - leaving unconfigured
Processing triggers for ca-certificates (20160104ubuntu0.14.04.1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....
the keytool command requires a mounted proc fs (/proc).
E: /etc/ca-certificates/update.d/jks-keystore exited with code 1.
done.
Errors were encountered while processing:
ca-certificates-java
openjdk-8-jre-headless:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@localhost:~/test#
./test-win32.exe
bash: ./test-win32.exe: cannot execute binary file: Exec format error
/test-win64.exe
bash: ./test-win64.exe: cannot execute binary file: Exec format error
(These are just "hello world"s.)
The executables in question do work from cygwin, cmd or with wine-binfmt on real Linux.
When I hit AltGr+3 in bash, I do get a #.
But this doesn't work in vi.
Given the command perl -E 'say for 1 .. 100' | less
, hitting the down arrow key works fine, but hitting the up arrow key only changes the first line (and only those portions that have text, so scrolling back from "10\n"
to "9\n"
shows "90\n"
. The same problem occurs when scrolling pages with f and b.
Will there be support for ARM processors in the near future?
The documentation states that right now only AMD64 architecture is supported, will that change?
Using apt-get install default-jdk results in several failures related to dependencies:
Selecting previously unselected package libx11-doc.
Preparing to unpack .../libx11-doc_2%3a1.6.2-1ubuntu2_all.deb ...
Unpacking libx11-doc (2:1.6.2-1ubuntu2) ...
Selecting previously unselected package libxt-dev:amd64.
Preparing to unpack .../libxt-dev_1%3a1.1.4-1_amd64.deb ...
Unpacking libxt-dev:amd64 (1:1.1.4-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up xorg-sgml-doctools (1:1.11-1) ...
Setting up x11proto-core-dev (7.0.26-1ubuntu2) ...ubuntu14.04.1) ...
Setting up libice-dev:amd64 (2:1.0.8-2) ...
Setting up libpthread-stubs0-dev:amd64 (0.3-4) ...
Setting up libsm-dev:amd64 (2:1.2.1-2) ...
Setting up libxau-dev:amd64 (1:1.0.8-1) ...
Setting up libxdmcp-dev:amd64 (1:1.1.1-1) ...
Setting up x11proto-input-dev (2.3-1) ...
Setting up x11proto-kb-dev (1.0.6-2) ...
Setting up xtrans-dev (1.3.5-1
Setting up libxcb1-dev:amd64 (1.10-2ubuntu1) ...
Setting up libx11-dev:amd64 (2:1.6.2-1ubuntu2) ...
Setting up libx11-doc (2:1.6.2-1ubuntu2) ...
Setting up libxt-dev:amd64 (1:1.1.4-1) ...
Setting up openjdk-7-jre-headless:amd64 (7u95-2.6.4-0ubuntu0.14.04.2) ...
the java command requires a mounted proc fs (/proc).
dpkg: error processing package openjdk-7-jre-headless:amd64 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of default-jre-headless:
default-jre-headless depends on openjdk-7-jre-headless (>= 7~u3-2.1.1); however:
Package openjdk-7-jre-headless:amd64 is not configured yet.
dpkg: error processing package default-jre-headless (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of openjdk-7-jre:amd64:
openjdk-7-jre:amd64 depends on openjdk-7-jre-headless (= 7u95-2.6.4-0ubuntu0.14.04.2); however:
Package openjdk-7-jre-headless:amd64 is not configured yet.
dpkg: error processing package openjdk-7-jre:amd64 (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.dpkg: dependency problems prevent configuration of default-jre:
default-jre depends on default-jre-headless (= 2:1.7-51); however:
Package default-jre-headless is not configured yet.
dpkg: error processing package default-jre (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached alreadydpkg: dependency problems prevent configuration of openjdk-7-jdk:amd64:
openjdk-7-jdk:amd64 depends on openjdk-7-jre (= 7u95-2.6.4-0ubuntu0.14.04.2); however:
Package openjdk-7-jre:amd64 is not configured yet.
dpkg: error processing package openjdk-7-jdk:amd64 (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of default-jdk:
default-jdk depends on default-jre (= 2:1.7-51); however:
Package default-jre is not configured yet.
default-jdk depends on openjdk-7-jdk (>= 7~u3-2.1.1); however:
Package openjdk-7-jdk:amd64 is not configured yet.
dpkg: error processing package default-jdk (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of ca-certificates-java:
ca-certificates-java depends on openjdk-7-jre-headless (>= 7u3-2.1.1pre1-1) | java6-runtime-headless; however:
Package openjdk-7-jre-headless:amd64 is not configured yet.
Package java6-runtime-headless is not installed.
Package default-jre-headless which provides java6-runtime-headless is not configured yet.
Package openjdk-7-jre-headless:amd64 which provides java6-runtime-headless is not configured yet.
dpkg: error processing package ca-certificates-java (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
openjdk-7-jre-headless:amd64
default-jre-headless
openjdk-7-jre:amd64
default-jre
openjdk-7-jdk:amd64
default-jdk
ca-certificates-java
E: Sub-process /usr/bin/dpkg returned an error code (1)
When the system call stat(2) for an directory or a file returned successfully, ino_t of the stat structure has equivalent inode value for different (not linked) files located at same depth of the directory tree.
This leads to undesirable and confusing behavior such,
# cd /home/foo
# ls bar
bar
# ls /usr/bin/bar
ls: cannot access /usr/bin/bar: No such file or directory
# mv bar /usr/bin
mv: ‘bar’ and ‘/usr/bin/bar’ are the same file
#
There was no problem installing something in the crontab:
root@localhost:~#` crontab -e
crontab: installing new crontab
root@localhost:~# date
Fri Apr 8 02:53:31 UTC 2016
root@localhost:~# crontab -l
54 2 * * * echo test > /root/test
But the entry in the crontab never runs:
root@localhost:~# ls
root@localhost:~# date
Fri Apr 8 02:54:12 UTC 2016
root@localhost:~# ls
It looks like there is no cron process or service running:
root@localhost:~# ps aux | grep cron
missing btime in /proc/stat
root@localhost:~# cat /proc/stat
cpu 34206 0 625778 3902536 0 2674 0 0 0 0
cpu0 7123 0 157873 968435 0 2482 0 0 0 0
cpu1 7250 0 157746 990993 0 92 0 0 0 0
cpu2 10396 0 154600 971287 0 65 0 0 0 0
cpu3 9437 0 155559 971821 0 35 0 0 0 0
root@localhost:~# start cron
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: No such file or directory
I know that there is a module named PSReadLine for PowerShell, but I found it does not work in bash on ubuntu on windows.
emacs style key binding means "ctrl+a" for "Home" and "ctrl+k" for "cutting to EOL" and "ctrl+y" for paste etc..
When piping the output of a command to less, scrolling down seems to work fine, but scrolling up only updates the topmost line of the terminal window
I'm unable to spawn Bash from NodeJS. If you try to, it will return this error: Error: 0x80070057
node
in CMDcp = require('child_process');
proc = cp.spawnSync('cmd', ['/c', 'bash -c "ls"'], {encoding: 'utf8'}).output
It outputs:
[ null, 'Error: 0x80070057\r\r\n', '' ]
Will I lose my files and my configurations in the subsystem when I update to the next build?
On first run, applications like aptitude
complain because /var/lock
cannot be accessed. This is due to the fact that /var/lock
is a symlink to /run/lock
, and that directory is nonexistent.
Environment setup should probably create that directory.
I got the above error, it was solved by disabling GitHub "update" from startup.
just putting this here for others searching
apt-get install nginx
, edit /etc/nginx/sites-enabled/default
to disable ipv6 (which causes another error) and use command nginx
to start the server, the server failed to start the worker process.
here is my /var/log/nginx/error.log
2016/04/07 11:48:21 [alert] 420#0: ioctl(FIONBIO) failed while spawning "worker process" (22: Invalid argument)
2016/04/07 11:48:21 [alert] 420#0: ioctl(FIONBIO) failed while spawning "worker process" (22: Invalid argument)
2016/04/07 11:48:21 [alert] 420#0: ioctl(FIONBIO) failed while spawning "worker process" (22: Invalid argument)
2016/04/07 11:48:21 [alert] 420#0: ioctl(FIONBIO) failed while spawning "worker process" (22: Invalid argument)
I ran into a problem when running node
. I traced the error down to the rlwrap
program, which outputs the error on invocation:
root@localhost:~# rlwrap ls
rlwrap: Could not open master pty: No such file or directory
Which brings me to suspecting that Bash on Ubuntu on Windows haven't yet implemented working pseudoterminal interfaces.
We can possibly add this to the FAQ, as this is an error that is reproducible (at least for me). Try it on your own machine.
I got X11 apps working by using Xming and tested it using twm, i3, gvim etc..., so naturally, the next thing I wanted to play with was xterm :). xterm cannot start due to problems with ptys, here's the output:
boran@localhost:~$ xterm
xterm: Error 32, errno 2: No such file or directory
Reason: get_pty: not enough ptys
Along with strace snippet:
open("/dev/ptmx", O_RDWR) = 4
statfs("/dev/pts", 0x7ff5fffee8f0) = -1 EPERM (Operation not permitted)
statfs("/dev/", 0x7ff5fffee8f0) = -1 EPERM (Operation not permitted)
close(4) = 0
open("/dev/ptyp0", O_RDWR) = -1 ENOENT (No such file or directory)
write(2, "xterm: Error 32, errno 2: ", 26xterm: Error 32, errno 2: ) = 26
write(2, "No such file or directory\n", 26No such file or directory
) = 26
write(2, "Reason: get_pty: not enough ptys"..., 33Reason: get_pty: not enough ptys
) = 33
ioctl(-1, TCFLSH, 0x1) = -1 EBADF (Bad file descriptor)
close(-1) = -1 EBADF (Bad file descriptor)
From Windows I've created [New - Text Document] renamed [test.sh], opened in [Sublime Text 3]
Wrote:
while true; do
echo $(date)
sleep 5
done
Doesn't work. Writes some error that "expected do" on line with "done".
but when written:
while true; do echo $(date); sleep 5; done
Everything works.
~# apt-get install ssh
~# /etc/init.d/ssh start
* /dev/null is not a character device!
And I cannot remove /dev/null and re-create with mknod
I added a new user with adduser
, added the user to /etc/sudoers
with visudo
, logged in as the user with su - user
, then attempt to become root with sudo su -
and sudo -i
. Both throw the following error (but appear to log me in as root):
mesg: /dev/tty: Operation not permitted
Trying to launch bash from cmd gives me: Error: 0x80070040.
I installed bash yesterday and I was able to run it. Today instead I am not able to launch it.
Is there a way to see a logfile or something similar do understand what's going on?
Thanks
After installing bash.On the powershell i tried to run bash.But it shows error:"Error: 0x80070057".
I followed the instructions at https://github.com/Microsoft/CommandLine-Documentation/blob/master/commandline/WSL/install_guide.md and cannot find"Windows Subsystem for Linux" in the "Turn Windows features on or off" menu.
I am running Windows 10 Home. Does this require Pro? Or does it require a certain build #? I posted my build details in the graphics below:
If .bashrc is modified from windows explorer then going to the bash command prompt cannot find the file and gives a input output error.
I wanted to clean all modifications made on my wsl installation and ran a lxrun /uninstall /full
. Then I ran lxrun /install
to install it again.
The /root/.bashrc
file has the same modifications that I've made before reinstalling bash
and even some symlinks on a user that I created before where there after I created the user again.
I don't think that is the desired behavior for lxrun /uninstall /full
.
Since Linux is open source perhaps the shell and subsystem components can be open sourced?
When trying to start the game I get a segfault.
I know that Bash on Ubuntu on Windows is (primarily) for using developer tools and such. However, some (very) simple relaxation between developing is also important and what better way to do it than with good old simple moon-buggy.
Bash starts up correctly, and all standard programs work as you would expect. The network seems to not be initialized at all though. Tried running as admin, restarted, etc:
nslookup:
`root@localhost:/# nslookup google.com
socket.c:2447: setsockopt(20, SO_TIMESTAMP) failed: Invalid argument
socket.c:1915: internal_send: 127.0.0.1#53: Invalid argument
socket.c:2447: setsockopt(21, SO_TIMESTAMP) failed: Invalid argument
socket.c:2476: setsockopt(21, IPV6_RECVPKTINFO) failed: Invalid argument
;; connection timed out; no servers could be reached`
Happy to provide more information if requested. I saw a few other people having similar issues, but no issue logged yet.
Additional information:
Ran this
apt-get update
apt-get upgrade
apt-get install go
apt-get install git
Created these directories
/root/go/
bin
pkg
src
Modified .bashrc
export GOTPATH=/root/go/
export PATH=${PATH}:${GOPATH}:.
Ran this command
go get -u -v github.com/deathly809/gomath
Got this error message
runtime: address space conflict: map(0x7ff5df610000) = 0x7ff5ffd20000
fatal error: runtime: address space conflict
runtime stack:
Microsoft Windows Version 10.0.14316 2016 Microsoft Corporation. All rights reserved.
C:\Users\Alex>lxrun /install
-- Beta feature --
This will install Ubuntu on Windows, distributed by Canonical
and licensed under its terms available here:
https://aka.ms/uowterms
Type "y" to continue: y
Downloading from the Windows Store... 100%
Extracting filesystem, this will take a few minutes...
Installation successful! The environment will start momentarily...
C:\Users\Alex>bash -c "ls"
Error: 0x80070057
C:\Users\Alex>bash ~
Error: 0x80070057
root@localhost:~# mkdir 233
root@localhost:~# ls
233
root@localhost:~# cd 233/
root@localhost:~/233# touch 1
root@localhost:~/233# touch 2
root@localhost:~/233# ls
1 2
root@localhost:~/233# cd
root@localhost:~# mv 233/ 2333/
mv: cannot move ‘233/’ to ‘2333/’: Permission denied
Mount seems to be fine:
root@localhost:~# mount
rootfs on / type rootfs (ro,relatime)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
There is a fstab:
root@localhost:~# cat /etc/fstab
LABEL=cloudimg-rootfs / ext4 defaults 0 0
However niether df nor fdisk are working:
root@localhost:~# df
df: cannot read table of mounted file systems: No such file or directory
root@localhost:~# fdisk -l
cannot open /proc/partitions
I tried using lxrun /update
on cmd
and apt-get dist-upgrade
inside bash
and it didn't work on any of them.
Hi - is it possible to access files in the root via Windows Explorer? Trying to open some files via Windows Programs like VSCode.
When using less scrolling down works perfectly. However when trying to scroll up only the top row of the conhost screen changes so you are then limit to that single line if you want to read something for which you have to scroll up.
And I hit the same problem when using less on a remote machine via ssh.
Tried to build the latest AFL Fuzz. http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz
First ran into permissions issue with the linker not allowed to symlink a file.
Next got this:
[-] SYSTEM ERROR : shmget() failed
Stop location : setup_shm(), afl-showmap.c:134
OS message : Invalid argument
make: *** [test_build] Error 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.