(WSL error at Startup) Press any key to continue - windows-subsystem-for-linux

Problem:
When I launched Ubuntu 20.04, it pops up: "Press any key to continue...", and then if I press any key, it exits immediately. This prevents me from using (typing any command) in Ubuntu WSL. (It occurred suddenly today. For the last couple of days it has been working properly.)
Screenshot: Press any key to continue pops up after startup
Attempts Tried:
LxssManager service is running. But LxssManagerUser and LxssManagerUser_60d78 are stopped. Manually starting the two services doesn't help as they automatically stop themselves right afterwards.
Hyper-V service is set to auto. Virtualization mode is enabled (task manager -> performance -> CPU)
Trying to re-run the update from here https://learn.microsoft.com/en-us/windows/wsl/wsl2-kernel, but it shows WSL not installed (which is weird since I have been using it for a long time before)
Environment:
OS: Microsoft Windows 10 Family, Insider Preview
Version: 10.0.20152 Version 20152
System Type: x64 based

I'd accidentally mounted the WSL virtual disk image by double-clicking it in explorer, and it remained mounted to my machine even though it reported an error that made having it mounted useless. Unmounting the vdisk from Disk Management resolved the issue for me.

From https://github.com/microsoft/WSL/issues/4177#issuecomment-597736482
There is a conflict between wsl.exe and Proxifier.
Developers of Proxifier gave a solution.
Thanks for the info.
We have reproduced this issue. Apparently, wsl.exe displays this error
if Winsock LSP DLL gets loaded into its process.
The easiest solution is to use WSCSetApplicationCategory WinAPI call
for wsl.exe to prevent this. Under the hood the call creates an entry
for wsl.exe at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog
This tells Windows not to load LSP DLLs into wsl.exe process.
We have a tool that can make this call:
www.proxifier.com/tmp/Test20200228/NoLsp.exe
Please just run as admin with the full path to wsl.exe as the
parameter: NoLsp.exe c:\windows\system32\wsl.exe
This has fixed the problem in my case.
Please let me know how it works for you.
And it works well for me!

This worked magic! Go to the Windows Command Prompt and run the following command:
netsh winsock reset
Then Restart your computer. NB: Don't Shutdown since it did not work for me. Instead, Restart!
More answers can be found here.

I solved by downloading the https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msimsi and excuting it.
see https://learn.microsoft.com/en-us/windows/wsl/wsl2-kernel

I went into the bios and had to enable virtualization from there

if you got this error:
An operation was attempted on something that is not a socket.
there is something wrong with windows sockets and try this command in cmd administrator mode to reset windows sockets.
1. netsh winsock reset catalog
2. netsh int ipv4 reset reset.log
3. netsh int ipv6 reset reset.log
4. Restart the computer.

Maybe not relevant for TO but I had the same issue and just had to run in Windows Terminal:
wsl --shutdown
After that Ubuntu worked again.

powershell => type "wsl --shutdown" => error message
ctrl-alt-del => services => HvHost => right button => restart (think to stop all hyperv virtual machines before ?)
powershell => type "wsl" => OK
restart hyperv virtual machines

Related

Need to restart wsl everytime after Windows start before using vscode-remote

I'm running Windows 10 with WSL2. I'm using VSCode with the Remote - WSL extension to open the files from my wsl file system.
When I boot my Windows laptop, and open VSCode I get the following error:
When I perform a wsl.exe --shutdown in PowerShell, and restart Docker Desktop, Everything works fine. But I have to do this after every laptop restart.
Remote WSL extension version: v0.51.4
Visual Studio Code version: v1.51.1
Windows version: 10.0.19041 Build 19041
Someone any idea?
I have had this problem several times, and I have found that on Windows 10 20H2 one of the two options described below solves the problem.
Network reset
This option can make you lose your network configuration, so use it with discretion and read every warning. You can perform this task by going to Settings > Network & Internet > Status. There you need to click on the option "Network reset" after that, you can start the network reset by clicking on "Reset now" Picture of Windows 10 20H2 status section. Then you will need to wait some minutes until your PC is restarted automatically and try to execute Visual Studio Code under WSL2 again.
Reset Windows
This option is dangerous as it will remove either all your files and programs or all your installed programs. You select what you want to remove before starting the reset process. This option can be performed by going to Settings > Update & Security > Recovery. Then you have to click on the button "Get started" on the section "Reset this PC" and follow the instructions provided by the reset tool Picture of Windows 10 20H2 recovery section. After your Windows is reset, you will have to configure your WSL again because all your WSL files will be lost when executing this operation.

x2go issue with XFCE and Ubuntu 20.04

When I connect x2go with XFCE Ubuntu 20.04 (KVM VM) after ~10 minutes of idle time, x2go will lose its mouse focus and keyboard focus and there is no way to grab control of the session. Even restarting x2go will not bring the focus back.
The XFCE VM is still running because I can see the top output in the console.
I tried several key combinations to bring the focus back but it does not. I tried LXDE and it does not have this issue. I tried XFCE desktop 20.04 on its running in a KVM VM. I also tried installing Ubuntu server 20.04 and load Xubuntu-desktop (KVM VM) - the same issue. After ~10 minutes the x2go session-focus is lost.
What brings the session focus back is if I reboot the VM and then connect to the VM again using x2go. as I mentioned just restarting x2go will not bring the session focus back.
I tried uninstalling the screensaver and the power management features in XFCE but that did not fix this issue.
Update: this x2go bug report log suggests its screensaver related. Using the applications/settings/screensaver allowed me to turn off anything related to the screensaver, solving the problem for me. Issue appears to be solved here similarly: askubuntu forum
I've been having the same issue w/ XFCE and LXDE both after an idle period (10-15 minutes), and only on Ubuntu 20.04, not on 18.04 or earlier. In either desktop env, the session was not recoverable and required termination of the session either from the client side or via a separate terminal ssh session to kill <PID> the x2gocleansessio process on the server side (after seeing it was running using top). For a short period, I regained control in the new session until the cycle recurred.
Seems like a major problem for x2go in Ubuntu 20.04.
Just to save everyone the time of digging through the AskUbuntu forum... run this + restart and you should be good to go on Ubuntu 20.04 -
sudo apt-get remove xfce4-screensaver
If your are login via x2go and don't want to uninstall xfce4-screensaver, it's hard to solve the problem because there are intern script of xfce who launch xfce4-screensaver whatever you told him to do. I found my own workaround WITHOUT root privilege:
First activate screensaver on start-up :settings-manager -> Session and Startup->check screensaver(that sound weird but by this way you are sure to launch your xfce4-screensaver localy otherwise it's the root user who launch it which this own startup file which you can't edit without root)
Second : in ~/.config/autostart/xfce4-screensaver.desktop (if it doesn't exist uncheck then check screensaver in first step). Add to the end of this file:
Exec=sh -c "kill $(pgrep -u <YOUR-USERNAME> screen)"
This will launch it but auto-kill it after OnLogin
Edit: it's better than uninstall it because in my case that was the administrator that install for every user xfce4-screensaver so I can't uninstall it because the computer need a screensaver on the real sessions (I mean not in ssh on the physique machine). Maybe switch to Xscreensaver or other screensaver will solve this problem

Vagrant disable SSH Agent

Getting the following when I am trying to run Vagrant up.
Have tried to re-provision etc. Even tried rolling back (in Time Machine) the user/vagrant-local directory & the vagrant-local directory where the sites all live.
An error occurred in the underlying SSH library that Vagrant uses. The
error message is shown below. In many cases, errors from this library
are caused by ssh-agent issues. Try disabling your SSH agent or
removing some keys and try again.
If the problem persists, please report a bug to the net-ssh project.
timeout during server version negotiating
I was getting this exact error.
I upgraded from VirtualBox 5.0.x to 5.1.8 and the error went way.
After upgrading I did vagrant destroy and then vagrant up and the machine booted up without issues.
So this is what I have now:
Windows 10 pro
Vagrant 1.8.7
VirtualBox 5.1.8
I also made sure everything else was updated. Don't forget to reboot.
Hope this helps.
I have faced the same issue and done the following:
Send shutdown command to your VM (virtual machine)
Run the command again: vagrant up
ssh issue was resolved after this as VM has been restarted again.
I just had the same issue on this setup:
Windows 11
Vagrant 2.3.1
VirtualBox 6.1.38
What seems to have solved the problem for me is this:
run vagrant destroy -f
temporarily disable "Use the WSL2 based engine" from Docker Desktop. Wait for Docker Desktop restart.
run vagrant up --debug. The problem is still reported, but this time Vagrant recovers and runs to the end
Verify vagrant ssh is working
Re-enable "Use the WSL2 based engine". Wait for Docker Desktop restart.
Verify things are still working (also after re-boot)

How to run a command in cmd on startup in Windows XP

Sigh. For reasons, I am running a windows xp virtual box in ubuntu. In this instance of windows there is an express (node) server running. Everything works fine, except that occasionally windows crashes or the virtual box freezes (perhaps after being left idle for several days). I would like to restart the virtual box (and node server) programmatically when this happens. The actual restarting of the virtual box from linux seems attainable, but I can't figure out how to get windows to run "node .../server.js" on startup! I tried putting the command in C:\AUTOEXEC.bat, and it did not start when I restarted the computer. I know I'm asking for trouble with a 10 year old OS but it's what I have to work with. Any thoughts?
Try scheduling in as a task in the task scheduler.
Tasks get executed when their triggers are satisfied, and in this case you can use the 'at startup' trigger, as described here:
http://technet.microsoft.com/en-us/library/cc748841.aspx
At startup
This trigger causes the task to run when the computer starts up. The only settings for this trigger are the advanced settings described in the Advanced Settings section below.
Look out though, that information wasn't tailor-made for XP, but should do it for you.
I actually just got it working. I put a batch file in start/programs/startup that CD'd to the right directory and then ran node.

How can I run xsp4 as a background process on linux?

Is there an easy way to get xsp4 running as a background process on a linux server?
When I run xsp4 I get this:
xsp4
Listening on address: 0.0.0.0
Root directory: /test
Listening on port: 80 (non-secure)
Hit Return to stop the server.
So if I quit the terminal I am running it from it stops the server.
Do I have to write a daemon to do this? Or is there already something in place that I am missing?
Thanks
You have a couple of options. If your problem is terminal closing, then screen can be simple solution (just run screen xsp4, then Ctrl+A,D and you can close terminal). If the method you have used suits you, then use it -- however xsp will die after terminal closing. xsp should be generally used for debugging, production solutions are FastCGI or apache module, so these are daemons "by definition".
I had to use Mono for a demo that I had to show, and faced the same problem. My workaround was:
xsp4 --nonstop &
Note: It will show the initial information and if you hit enter, it will continue running. You can also exit the terminal if you want and it will continue as well.
you can do install the xsp4 in the terminal
sudo apt-get install mono-xsp4
then
go to your project Folder where the Asp project saved and type in the terminal
xsp4