Ubuntu on WSL doesn't launch - windows-subsystem-for-linux

I have installed Ubuntu 18.04 for windows subsystem for linux on windows 10, after enabling WSL in Powershell (instructions here: https://learn.microsoft.com/en-us/windows/wsl/install-win10).
I've done this before on a desktop but now I'm doing it on a laptop. I had no issues with the previous installation but this time around ubuntu will not launch. I get the ubuntu console popping up briefly before disappearing.
Also trying to run bash.exe from the command line fails silently (doesn't hang, just exits with no message), which may be related.
I'm struggling to figure this out as I have no idea where any error messages might be logged. Does anyone know how I can investigate further why this is happening?
Setup is a windows 10 Pro, os build 17134.376, everything up to date.

I'm struggling to figure this out as I have no idea where any error messages might be logged. Does anyone know how I can investigate further why this is happening?
Check with wslconfig.exe /l all registered distros, try to deregister the one you have problem with ( e.g. wslconfig.exe /u Ubuntu [^1]) and run the ubuntu.exe in your distro once again. Just a wild guess, it might be also a problem, if you have more than one copy of the linux distribution in you home directory.
[^1]: Warning: deregistering will delete all the associated files!

Related

VSCode WSL - Installing VS Code Server for x64 - FAIL

Can anyone decode the following for me?
WSL was working perfectly on C++ a few weeks back.
Switched to try to run older Python under windows (not WSL) and it seems all twisted up now.
Can't get Win10 nor WSL to run. Keeps trying and failing to update. I re-ran the WSL and updated VSCode on the windows side. I AM behind a proxy but as far as I know, I've update all the files that google searches pointed me at. Pretty frustrated and would appreciate any help there is.
"
Request downloadRequest failed with message: getaddrinfo ENOTFOUND update.code.visualstudio.com. Will try to download on WSL side."
"
[2022-02-10 13:51:09.374] Setting up server environment: Looking for /home/ubuntu/.vscode-server/server-env-setup. Not found.
[2022-02-10 13:51:09.374] WSL version: 4.4.0-19041-Microsoft Ubuntu-20.04
[2022-02-10 13:51:09.374] Updating VS Code Server to version d6ee99e4c045a6716e5c653d7da8e9ae6f5a8b03
[2022-02-10 13:51:09.374] Removing previous installation...
[2022-02-10 13:51:09.674] Installing VS Code Server for x64 (d6ee99e4c045a6716e5c653d7da8e9ae6f5a8b03)
[2022-02-10 13:51:09.674] Downloading:
[2022-02-10 13:52:43.314] VS Code Server for WSL failed to start. No messages received for 90s
[2022-02-10 13:52:43.314] For help with startup problems, go to
[2022-02-10 13:52:43.314] https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2022-02-10 13:52:43.328] WSL Daemon exited with code 0
"
I'm not 100% which step fixed it however I was able to proceed after.
Launching C++ project in wsl also tried to update and failed. The difference being that the install button did actually install the wsl server update w/o fail. So that error was gone.
I then launched another VSCode session with the Python project and the cmd terminal. I then had to use this help (https://github.com/pypa/pip/issues/9216#issuecomment-741836058) to adjust the proxy.
I could then proceed to reinstall ipykernel which is what had stopped working and was blocking me.
I'm pretty sure my environments are conflicting with each other. I'm afraid I don't understand VSCode environments well enough and very likely caused this problem for myself.

WSL2 stopped working with error The system cannot find the path specified

WSL2 stopped working suddenly. If I do a new installation of linux distros. Then it throws the following error, when I click launch button for the linux distro from play store:
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070003
Error: 0x80070003 The system cannot find the path specified.
the wsl --help command works properly. All other wsl command hangs or throws error as shown below
like wsl -l command throws this error
The system cannot find the path specified.
I had the same thing happening to me after I moved the directory of my distro.
You have to unregister the distro from WSL;
wslconfig /u Ubuntu-20.04
and then just execute the installed exe and install the whole distro to WSL again.
I had to reinstall the windows to fix the issue. Something got corrupted in the OS. However, before reinstalling the OS as I had lot of work stored in the WSL2, I took the backup of the entire WSL2 image, the big .vhdx file. This file is the Virtual Hard Disk of WSL2 Linux. The files inside cannot be directly explored from Windows at the moment.
If one has not moved the file anywhere else, it is stored here: %LOCALAPPDATA%\Packages\<PackageFamilyName>\LocalState\ext4.vhdx
Before reinstalling the OS, after taking the backup, I wanted to test if this backup runs fine on new install of WSL2. For that, I tested it on another machine, by installing the same Ubuntu WSL2 distro and replacing the .vhdx file created with the backup file. It ran fine.
So, it felt safe to do entire OS reinstall and then reinstalling WSL2 Ubuntu and finally replacing the .vhdx file with the old backup .vhdx file. So, I did loose some time. But, my data and all the applications/programs on WSL2 were intact.
I know this is old but I had the same problem after deleting a driver associated with Hyper V and fixed it by uninstalling the virtual machine platform and Windows Hypervisor along with WSL, rebooted, reinstalled all 3 and then I could install Ubuntu again
This is my first answer on stack overflow and English is not my first language.
So, I will answer this question in images. My solution would not delete the date in any existing installed Linux distribution, at least for me.
Hope you can solve this problem successfully.
enter image description here
enter image description here
enter image description here
"Enable" Virtualization from your bios settings.
Settings may differ from bios to bios (search for your machine options)

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

Using Enthought Canopy over SSH+Putty Fails to Start

I have Enthought Canopy installed on a machine running RedHat Enterprise Linux 5. I installed it successfully and can verify it runs.
I would like to be able to use it remotely from a windows computer, I have installed putty + xming for X11 forwarding. I can use regular applications like gedit and firefox fine. However when I try using canopy by launching ~/Canopy/canopy an empty gray box for the welcome screen appears, disappears after a few moments, and canopy exits with no return error without having started.
When I ssh with X forwarding from another linux computer, I can use canopy just fine.
There is no error code, I don't see any debug flags and I can't find any log files. I really have no idea why I cant access canopy with putty and xming.
I am trying this as a solution for interns so they can use a machine with access to our datafiles from their windows computers.
I highly appreciate any and all help.
Canopy needs some features not provided by XMing and a few other X server implementation on windows. See the following article for more details:
https://support.enthought.com/entries/21873380-Running-Canopy-Linux-via-remote-display-VNC-remote-X-display-
In short, use MobaXterm ( http://mobaxterm.mobatek.net/ ) or VcXSrv ( http://sourceforge.net/projects/vcxsrv/ )
EDIT: newer versions of Canopy have fixed this bug and should work fine with XMing

xquartz: couldn't query security extension and xterm failing

I am using OSX 10.7.5 from my MacBook Air to login to remote Linux workstation, running Suse (/etc/issue: SUSE Linux Enterprise Desktop 11 SP2 (x86_64) - Kernel \r (\l))
Everything was working fine until I started to play with macports latest X11, XQuartz XWindow System (XQuartz 2.7.4 (xorg-server 1.13.0)). By default OSX 10.7.5 comes with XQuartz 2.6.4 (xorg-server 1.10.6), however I've installed and made default XQuartz 2.7.4. I am now observing two issues:
(1) When logging to my remote Suse box (this is done via VPN tunnel btw, not sure if it matters), via 'user1> ssh -X user2#wks01' I am getting
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
This (at least appears) to be traced to the fact that there's no 'Security' extension on the new Xquarts server. Traced via ssh -vvv option, and then due to the fact that xauth is failing, so running it separately on MacBox, or remote Suse gives:
user2#wks04:~> xauth generate "$DISPLAY" .
trustedxauth: (argv):1: couldn't query Security extension on display "localhost:10.0"
'ssh -Y' logs in without warning
(2) What is also interesting, that in both ssh modes -X and -Y I am able to open and forward to my display any X-application that I have checked, including xclock, xlogo, xcalc and even eclipse. However running simple 'xterm' results in a hanging job (i.e. appears running), but xterm never displays on my Mac.
While rolling back to will XQuartz 2.6.4 probably help with the issues above (as all the above operations worked smoothly before), but I am curious now to understand the root of the matter.
Thank you in advance for your help,
Dmitry