windows-subsystem-for-linux

Detect “Ubuntu on Windows” vs native Ubuntu from bash script [duplicate]

左心房为你撑大大i 提交于 2019-12-29 03:34:08
问题 This question already has answers here : How to check if a program is run in Bash on Ubuntu on Windows and not just plain Ubuntu? (7 answers) Closed 2 years ago . Can a bash script detect if it's running in "Ubuntu on Windows" vs native Ubuntu? If so, how? I ran env on both machines and didn't see any obvious environmental variable differences. I could test for the existence of the /mnt/c directory, but that is not foolproof because that directory could potentially also be present on native

Windows Subsystem for Linux crashing Windows when “git pull” is run

半腔热情 提交于 2019-12-25 02:58:09
问题 Has anyone else faced this problem? When I try to run git pull in WSL, the system immediately and consistently crashes leading me to the Blue Screen. With the stop code: PAGE FAULT IN NONPAGED AREA I am on Windows 10. 回答1: Yes. I is likely related to a known bug as described here. https://github.com/Microsoft/WSL/issues/3916 The summary is: Using SSH or Agent forwarding causes the BSOD(Blue Screen of Death). They have reproduced the issue and are working on a fix. That was as of 6 days ago.

How to setup powerline-go in vscode running in WSL2 (Ubuntu)

ⅰ亾dé卋堺 提交于 2019-12-25 01:38:18
问题 These are the contents of my ~/.vscode-server/server-env-setup function _update_ps1() { PS1="$($GOPATH/bin/powerline-go -error $?)" } if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" fi ... gives this error [2019-12-10 13:49:39.763] /mnt/c/Users/cber/.vscode/extensions/ms-vscode-remote.remote-wsl-0.40.3/scripts/wslServer.sh: 1: /home/cber/.vscode-server/server-env-setup: Syntax error: "(" unexpected [2019-12-10 13:49:39.805] VS

How to access webcam through opencv in bash?

北战南征 提交于 2019-12-24 08:16:21
问题 When accessing webcam through python opencv, isOpened() returns False and no data is read. Does it has to do something with wsl? 回答1: According to this github issue, hardware access is not supported yet in WSL: Ben Hillis: Hardware access is another area we will be investigating in the future. All hardware related CLI tools seem to fail (dmesg, lsblk, lsusb returns nothing, /dev is empty...) so it looks like this statement is still valid today. That explains why you cannot access your camera

Why are empty arrays treated as unset in bash?

徘徊边缘 提交于 2019-12-23 07:57:14
问题 Recently, I set up Microsoft's Windows Subsystem for Linux on my computer. It just emulates a Linux environment and stuff; basically, it's Cygwin, but a little better connected to the underlying Windows system. After switching from Cygwin to WSL, however, I ran into a problem. I don't know if it's particular to Windows' implementation or not, but this doesn't happen in Cygwin. To catch bugs in my code a little faster, I've taken to using bash's set -u option, which causes the shell to "treat

Is it possible to run WSL Bash in non-interactive mode?

混江龙づ霸主 提交于 2019-12-23 04:33:34
问题 One may want to use Bash on Windows in Task Scheduler or maybe as version-control hook scripts. Is it possible or supported? If not, why? Is it a bug or a measure to prevent some issues? 回答1: If I'm understanding your question correctly, the -c option is what you're looking for. It allows you to directly invoke a Linux command. For example, to open the man page for bash (perhaps in order to find out about the -c option): bash -c "man bash" Note: You can leave off the quotes if you escape any

How to enable rust debugging when using WSL toolchain in CLion?

℡╲_俬逩灬. 提交于 2019-12-23 03:59:12
问题 I am new to rust and I am using CLion and the rust plugin from JetBrains on Windows now. It works well when I just compile and run. But when I start debugging, it shows a dialog like this even though I switch my toolchain to WSL. I wonder whether WSL is a kind of GNU toolchain. And if it is, what should I do to enable rust debugging? Thanks. 回答1: Rust provides two kinds of Tier 1 toolchains for the Windows operating system: pc-windows-msvc and pc-windows-gnu (for i686 and x864_64

RabbitMQ accepting connections but closing them before accepting any input

喜你入骨 提交于 2019-12-23 03:18:27
问题 So I just installed the latest version of rabbitmq and I've been trying to get it to work. The server is running and I've restarted it once just to be sure it's a consistent problem. If I telnet localhost 5672 , I get Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host. As you can see, the connection is accepted but rabbitmq does not accept any input. The connection is closed immediately. No further information shows up in logs. rabbitmqctl

C\C++ in VS Code with Linux Subsystem For Windows

♀尐吖头ヾ 提交于 2019-12-22 04:53:11
问题 I am having issues getting my "includes" to work in my editor in VS Code on Windows 10 build 17134 using Linux Subsystem for Windows. I have the C/C++ extension installed and can run my application using the launch.json information outlined in the documentation here. In their documentation here, Microsoft outlines how to set up a c_cpp_properties.json to get around this issue, but it has not advanced me much. Currently, I am getting an error under my "includes" line which says: #include

Ubuntu on Windows as VS Code terminal - executable path

左心房为你撑大大i 提交于 2019-12-21 21:39:49
问题 There is a related question but it details the approach for WSL, in newer versions of Windows, the Linux distributions are not beta anymore and they are provided through the MS app store. Where do I find the path to Ubuntu on Windows executable? (Not WSL.) I tried right-clicking on the icon to find Properties, but it is not there, it seems to be some special kind of a shortcut. 回答1: If you have multiple distros installed, you can read this how to launch one individually. https://msdn