Encounter "fatal error - NtCreateEvent(lock): 0xC0000077" when execute kinit in cygwin - linux

I have mintty 1.2-beta1(x86_64-pc-cygwin) installed on my Windows 7 64 bit.
Then I installed krb5-workstation version 1.12.1-2 to cygwin using Cygwin Net Release Setup Program.
But when I execute kinit or klist in cygwin, I got an error:
$ kinit
1 [main] kinit 3912 C:\cygwin64\bin\kinit.exe: *** fatal error - NtCreateEvent(lock): 0xC0000077
Hangup
Restarting cygwin or restarting windows didn't work either.
Could anybody help?

I had the same error when starting xterm, which just appears to flash briefly, then exit producing an xterm.exe.stackdump file. If you give xterm the -hold option you will see the NtCreateEvent error. The root cause of my problem was interference from AVG anti virus, and adding c:\cygwin64\bin\xterm.exe to AVG's exception list made xterm work again.

I'm not sure if it helps, but I had the same error code when I was trying to install CPANminus in Cygwin 64-bit. However the installation worked fine in the 32-bit version. It's not a full solution, but maybe you can try the 32-bit version of Cygwin.

I wanted to run gdm3 on my Windows 7 desktop and ran into the same problems as you had. After some fiddeling, I got a working solution that I'm (very) happy with, so I wanted to share this with you. I did the following (you need to do this only once):
Start the Cygwin Terminal (on your Windows PC)
From the terminal, run xlaunch.exe and follow the dialogs (I ended up using XDMCP; a good article about configuring that can be found here)
Safe the resulting config file to your desktop
From now on, you can just click on the dekstop icon to launch the remote (gdm3) desktop.

AVG seems to be causing the exception including a rsync.exe.stackdump.
If you get on the server side:
rsync: safe_read failed to read 1 bytes [Receiver]: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(276) [Receiver=3.1.1]
or client side:
rsync.exe fatal error - NtCreateEvent(lock): 0xC0000058
try disabling AVG. If it works when disabled, I added the rsync.exe as an AVG program exception and rsync is fine again.

Related

Virtual machine "pc1" Netkit error?

Introduction
I've just installed a networking simulator Called Netkit. On Debian stretch stable. Using the official installation guide here.
Installation
After setting the correct paths and installing. I then run the check_configuration.sh script.
Everything is checked OK, and it has found the terminal emulator xterm which is needed for netkit. And recieve the complete message.
[ READY ] Congratulations! Your Netkit setup is now complete!
Enjoy Netkit!
The Problem
Running netkit using the command:
vstart pc1
The xterm netkit-kernel emulator starts running. However I'm getting an infinite loop of the same error message:
ubda: can't open "home/foo/netkit/pc1.disk" failed, errno= 13
So im guessing it's because the file is missing? if so how do i obtain it? and if not, what is causing this error. I've followed the install guide completely.
I'm assuming your system is not a 32bit system. Netkit is only supported on the 32-bit architecture(unless the compatibility libraries are installed). Hence I would suggest you download a 32-bit VM(instead of installing the libraries) and run Netkit on the same(worked fine for me).
Check position of your lab-folder..

Pycharm Startup Error: Unable to detect graphics environment

I'm trying to setup Pycharm professional edition on Fedora 25 x64.
After downloading the files and extracting them, I'm trying to run the script ./pycharm.sh in the bin directory.
This is the error I get:
Startup Error: Unable to detect graphics environment
I have checked my Java version
[root#localhost bin]# java -version
openjdk version "1.8.0_144"
OpenJDK Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)
I tried as well to set the DISPLAY variable:
export DISPLAY=:0
And this is what I get:
[root#localhost bin]# ./pycharm.sh
No protocol specified
Start Failed: Failed to initialize graphics environment
java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
Any suggestions please ?
I had the same error installing in a clean Ubuntu 17.10, with Gnome on Wayland. At #mattdm's suggestion in your comments, I just opened a new terminal (as myself, not root) and it ran fine. I was running as root (after unpacking everything to /opt/) when I got the error.
mike#feynman:~$ /opt/pycharm/bin/pycharm.sh
Once you register/activate, just click the "* Configure v" pulldown from the welcome window, and select "Create Desktop Entry" to make it available from your OS menus. I'm assuming JetBrains made this work for whichever linux flavor you prefer.
Your X environment is not properly set (manually setting DISPLAY doesn't always work). Possibly because you're attempting this as root and root is not the owner of the graphics session. There could be other reasons, too.
You won't be able to run xclock or any other X app either in this situation - this is the clue that it's not a pycharm-related problem. For example if you ssh to localhost as root, not as the user currently logged in into the graphical session:
laptop:~ # ssh localhost
Password:
Last login: Thu Nov 23 22:19:06 2017 from localhost
Have a lot of fun...
laptop:~ # export DISPLAY=:0
laptop:~ # xclock
No protocol specified
Error: Can't open display: :0
laptop:~ # konsole
No protocol specified
Segmentation fault
laptop:~ # pycharm
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
No protocol specified
Start Failed: Failed to initialize graphics environment
You'd also see the same behaviour if you attempt the same in a text-mode console.
To address this issue open a new terminal from the graphics environment - if it is properly installed you should be able to run any of the X apps, including pycharm (or at least it shouldn't fail with that error).
In fedora
I have installed pycharm using fedy. This is worked.
Or change to a another user and try except root.
Phpstrom, Webstrom, PyCharm
Above three of them worked same like that.
In my case I am runing pycharm through docker, which is different host, run command xhost + , this would disable access control and client would be able to connect from any host.
Try running the program from another user instead of root. It worked for me.
I used OpenJDK instead of Oracle Java, because PyCharm hangs on Raspberry Pi.
In the file /etc/java-8-openjdk/accessibility.properties, disabling the entry assistive_technologies (simply comment out with a #) solved the issue.
This is what resolved my issue:
export DISPLAY='localhost:11'

Trying to use bash on Windows and got no installed distributions message

I am trying to use bash on Windows 10, but I'm getting this message when tried to run bash:
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Windows Store:
https://aka.ms/wslstore Press any key to continue...
When I go to that url which opens the Windows Store app, there no sign of any Linux distribution there.
My windows version is(as in my right bottom corner of the screen):
Windows 10 Enterprise Insider Preview. Evaluation copy.Build
16215.rs_prerelease.170603-1840
I follow the instructions in this guide Installation Guide and also was watching this video Editing code and files on Windows Subsystem for Linux on Windows 10 from Scott Hanselman, but they didn't get the message of no installed distribution.
Any Help?
When the Windows Store opened, there was no Distro to choose, then I found this command lxrun /install and worked for me as well.
You will get something like this as an output:
C:\WINDOWS\system32>lxrun /install
Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
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 Microsoft Store... 100%
Extracting filesystem, this will take a few minutes...
Would you like to set the Ubuntu locale to match the Windows locale (en-FI)?
The default locale is en_US.
Type "y" to continue: y
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: <you type your login here>
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Installation successful!
Documentation is available at: https://aka.ms/wsldocs
I'm getting a similar bug after trying to uninstall and reinstall.
For me I had to open a cmd prompt as administrator and run lxrun /install
I get this when I have recently rebooted. If I wait 5 minutes, the problem fixes itself !
The top answers written for this question are more than enough. I just had trouble following them because lxrun command has been depreceated, so I get the error
'lxrun' is not recognized as an internal or external command, operable
program or batch file.
when I try to run this command with cmd.
It has been replaced with wsl command. You can get more info on this issue here - https://github.com/MicrosoftDocs/WSL/issues/425
When you run wsl /install, there is a chance you may still get the error that you had earlier posted in your question. In that case, simply go to the link https://aka.ms/wslstore as you had gone earlier. If you don't see anything coming up, simply search for Ubuntu and install the same. (If you search with the term wsl though, you will get to see other Linux flavors too and then you can download any of your choice)
It seems that the link given in the command doesn't work. Here's the actual link to the microsoft store for Ubuntu.
https://www.microsoft.com/en-nz/store/p/ubuntu/9nblggh4msv6?rtc=1
You have to go to https://aka.ms/wslstore this link and download ubuntu on windows. After that you can use bash on windows.
If you have any problems with running lxrun /install (for example on ltsb Windows version) try manual mode.
First, go to the folder with downloaded .appx file and run following commands (change filename if needed):
Rename-Item ~/Ubuntu.appx ~/Ubuntu.zip
Expand-Archive ~/Ubuntu.zip ~/Ubuntu
After finishing cd into new folder and run ubuntu.exe file. That's it.
If you get this error after installing a distribution using the windows store, and WSL was working previously, you may need to make sure that the LxssManager service is running, since it often stops after a Windows update or a reboot.
Go to services.msc, and search for LxssManager and start it; if it is running already, restart it.
For everyone who is getting
'lxrun' is not recognized as an internal or external command,
operable program or batch file.
or
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Open microsoft store, install 'Ubuntu' then open the app. This will install ubuntu and later you can use wsl command since lxrun is deprecated
Go to add or remove programs
Install Windows subsystem for Linux
Go to https://aka.ms/wslstore, which will take you to the Microsoft Store
Select and install a Linux distribution
lxrun /install
Works on a Administrator Command Prompt for Windows 10 Professional, Version 1803 Build 17134.165
This installs GNU/Linux by default whereas there is an option to select between:
Ubuntu
openSUSE Leap 42
SUSE Linux Enterprise
Debian GNU/Linux
Kali Linux
If the given link (https://aka.ms/wslstore) works, it openes the windows store for me with an error saying something is wrong on their side and to try again later.
It's actually easier to solve this problem that other solutions listed here. If you run wslconfig /l and if the output is:
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
Just run wslconfig /s Ubuntu to set Ubuntu as default again. It should start working now.
Edit:
I've also found that if this problem occurs on a fresh boot, then you just wait for a few minutes (10 minutes max) and this error automatically disappears.
Edit 2:
I've also found that this error is sometimes also due to the corresponding service not running. Run CMD as administrator and run
net start LxssManager
For running bash on windows ubuntu is required to be installed.
As you've already added bash from programs and features, now you need to install Ubuntu. Contrary to what is seen in most of the installation guides on web, it does not gets installed by running 'bash.exe'.
You can simply go to Microsoft store in search for 'Bash' or 'Ubuntu'and install Ubuntu 18 LTS from there.
After installation you'll be able to use the terminal and all its commands.
Run the bash command in git bash windows. It worked !!
As of 2022, New Linux distributions are available for Windows 10 as well as Windows 11 like Kali Linux and Ubuntu. Both available from Microsoft Store. Someone watching this question now can visit Microsoft Store to Download them..
I had this same issue. But when you go to the windows store you can search for ubuntu and then install the ubuntu app and it works. I think most of the tutorials on the net are from the beta version and have afterwards never been updated.
https://insights.ubuntu.com/2017/07/11/windows-10-loves-ubuntu-loveislove/
Note: This is also old. You do not need to be on the insider builds. I'm not and it worked.
The only thing that worked for me is described here https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distros
https://aka.ms/wsl-ubuntu-1804
manually install it or run Add-AppxPackage.\.appx from PowerShell
The link to the store appears to have a region lock in it, resulting in errors for many visitors.
However there are different Ubuntu distributions to be downloaded. See image below, image is however in Dutch but it will show results.
So pick a version you desire and it will result in a working bash.
The actual answer to the question query is: The user exists with Ubuntu already installed. But WSL command does not find anything in CMD.exe "Command Line" "System does not find distribution."
You need to start the below WSL command from Windows Start Menu. And then the old Linux System will show up on WSL in the command line as found.
If this doesn't work for you? Just start up PowerShell with Administrator and:
WSL --help
WSL "only this command, will start the Linux default distro selected"
You can then start up using this command with CMD.exe Administrator in Windows:
lxrunoffline l "This will now list all your distros"
With an option to remove old distros copied to Windows folders are with perhaps Ubuntu18.04 such way that you will have to use Linux to remove older folders, do not try to copy or edit files in a distro with Windows Apps. You risk integrity problems as well as many errors followed by huge processing time. Use folder /mnt to find your drive with Linux and use commands there to further finish your work as perhaps copying the home directory into a new distro.
My solution to move "not copy" my distro then was: "to give space for C:"
lxrunoffline m -n Ubuntu-18.04 -d d:\wslinstalled\Ubuntu-18.04 "remember folder names"
"Remember folder name such as Ubuntu-18.04 for a specific movement. Unless you will overwrite everything on that folder name with also the lxrunoffline files and you risk losing older copies if you use one folder name. You might end up with a strange name to your project if you just use one directory."
Lxrunoffline has several other commands if you need help just run:
lxrunoffline
like beginner_ said in his answer you need to go to the store and look for the distros you want to install.
Please see the following link to understand what has changed and what you can excpect or what distros you can look for(the list is outdated so just try to find an updated list or just try your luck).
I am running on my machine without the developer mode Ubuntu, OpenSuse and Kali.
Access to Microsoft Store is blocked by my company. For me following worked in PowerShell (admin) -
lxrun /install
Go to cmd, and then run the following command:
lxrun /install
Typing lxrun /install in elevated command prompt works....
The solution to the error "WSL 2 installation is incomplete",
Execute the following steps:
wsl --install -d Ubuntu ## lxrun is no more, its now replaced with wsl,
enter image description here
wsl
enter image description here

Can't launch Visual Studio Code on Ubuntu

I'm running a VM in Azure with Ubuntu 14.04. I've installed XFCE and use X2GO to remote desktop to the machine.
I've downloaded the VS Code and unzipped the files. When I run Code from a terminal I get the following error:
WouterDeKort#UbuntuDev:~/tools/web/visual-studio-code$ ./Code
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
WouterDeKort#UbuntuDev:~/tools/web/visual-studio-code$ [ , [Error: channel closed] ]
Any idea what I'm doing wrong?
DISCLAIMER ;-) I'm a total Linux newby. I've just installed Linux for the first time today and I have no idea what I'm doing ;-)
The work-a-round is in issue 3451. After running this, I was able to launch it from Debian Jessie with LXDE over X2Go.
sudo sed -i 's/BIG-REQUESTS/_IG-REQUESTS/' /usr/lib/x86_64-linux-gnu/libxcb.so.1
I have the same problem using X2GO and LXDE. Works okay (but slowly) using MobaXterm so apparently this is a problem specific to X2GO.
For anyone who still wonder what is the best choice if you want to start Visual Studio Code on a headless Ubuntu - the winning combination is:
Ubuntu Server + xfce + nomachine remote desktop
VS Code starts immediately without any hacks, you can set your resolution however you like, and nomachine is blazingly fast.

Cygwin Bad Address

When I open a cygwin console I get the following message:
hostname: : Bad address
Furthermore when I try to ssh into a server I get this message:
gethostname: Bad address
Does anyone know what this might be about? I tried reinstalling ssh and reinstalling cygwin to no avail.
I believe this is a known problem affecting some 64-bit users with the latest version of Cygwin (1.7.29-2).
See the thread here: http://cygwin.com/ml/cygwin/2014-04/msg00132.html
I believe the only solution at this point is to download a recent snapshot, which has a patch for this.
You can get snapshots here: http://cygwin.com/snapshots
But read the directions first here: http://cygwin.com/faq.html#faq.setup.snapshots
The only way I could fix this was by installing the 32bit version of Cygwin, it's worked perfectly on my 64bit system.
Chris's method worked. I'm just going to put it in my words here.
This happened to me with Cygwin 64bit. I unplugged my laptop and at some point it crashed and restarted, it had a network issue wlan. I'm not sure the cause but suddenly I got that message "hostname: : Bad address" when going into cygwin. cygwin.bat runs .\bin\bash --login i and then I got that message
Judging by the solution that worked (replacing cygwin1.dll)
My guess is cygwin1.dll got corrupted, perhaps from an unexpected shutdown (as I just had one of those and was fine before).
Solution was, to replace cygwin1.dll with the latest one from the cygwin snapshots link.
I went here
https://cygwin.com/snapshots/
Got the latest cygwin1.dll
by clicking this link
Downloading cygwin1....dll.xz
http://cygwin.com/snapshots/x86_64/cygwin1-20141120.dll.xz
Extracting cygwin1.dll from it with 7zip (though some may use tar within cygwin but I closed cygwin particularly as i'll be replacing that file of cygwins)
made a copy of my existing cygwin1.dll and Copied cygwin1.dll over my existing cygwin1.dll
(I dragged the cygwin1.dll icon onto the command prompt to get the path to expand)
C:\cygwin\bin>move cygwin1.dll cygwinold1.dll
1 file(s) moved.
C:\cygwin\bin>move C:\Users\harvey\Downloads\cygwin1-20141120.dll\cygwin1.dll .
1 file(s) moved.
Then cygwin started fine no problems.

Resources