Score:1

How to fix ubuntu terminal not working on windows?

bl flag

For more than a year I have been running Ubuntu 20.04 and more recently 22.04 on my windows machine.

Recently I was having some difficulties with my Ruby version that was installed on the Ubuntu system and I needed to source the bashrc file every time I opened the Ubuntu terminal.

For the past 3-4 days I am unable to use Ubuntu 22.04 nor 20.04, even if I install it from scratch. The terminal is inactive and not responding. Found some issues that sounded the same but I was not able to access the files from within windows and check them to try and modify something.

I need to access this terminal as there is a lot of data that is useful to me.

enter image description here

I tried running wsl --version and wsl --update commands in PowerShell with administrator permissions, but it just hang there for quite some time, returning nothing.

Waited for few minutes, no response

I also confirmed WSL is enabled by following some troubleshooting from Microsoft.

Check if wsl is enabled:

check if wsl is enabled

Artur Meinild avatar
vn flag
Are you using Windows Subsystem for Linux (WSL)?
AndrejKostov avatar
bl flag
Yes, I use the wsl on Windows 10.
Terrance avatar
id flag
Not knowing what you have tried or read out there to try and fix your issue, the most we can do is guess. Have you tried: https://www.thewindowsclub.com/fix-couldnt-mount-file-the-disk-image-isnt-initialized-error-in-windows-10 ? It would be a great help for us if you edited your question and could add in as much details of the installation and what troubleshooting / repair steps that you have tried. Thank you!
NotTheDr01ds avatar
vn flag
From PowerShell, what does `wsl -l -v` and `wsl --version` show? How about just `wsl ~`? Please edit any additional into your question. Thanks!
NotTheDr01ds avatar
vn flag
Oh, and don't mess with that `ext4.vhd` in the meantime. That can be dangerous since Windows doesn't understand the file system.
AndrejKostov avatar
bl flag
Thanks for the feedback! I won't touch the VHD in the meantime, I just tried opening it because most of the articles out there for solving this included checking the bashrc file. I will update the question with some screenshots I took. Running `wsl --version` or `wsl -l -v` and `wsl ~` doesn't do anything, it's just stuck in a loop I guess. Other than this, I installed ubuntu 20.04 again, since I had nothing important there, and tried the repair option provided by windows for the 22.04. It might be some WSL issue..
NotTheDr01ds avatar
vn flag
@AndrejKostov It feels like it's a problem at the WSL level, and not Ubuntu, yes. What happens if you try install the [Microsoft Store version of WSL](https://aka.ms/wslstorepage)? I'm assuming there's going to be some problem with it, but it might be useful to know exactly *what* happens. There's also a *slim* chance that it will fix the situation ...
AndrejKostov avatar
bl flag
@NotTheDr01ds I tried installing it, it had the same things happening. However, I was able to fix/resolve this by disabling HyperV from features in Windows. I had this enabled recently to tryout some things. :) Thanks all for the help, I will post this as an answer.
Score:1
bl flag

Answering the question as more people might run into the same issue.

I recently enabled HyperV Manager from windows features to try and run some VMs on my PC. I was not familiar that this could cause issue to my WSL.

Found out about probable issues in this Github issue comment , where someone was having similar problems.

Disabling HyperV from Windows features and restarting my pc resulted in resolving this issue and be able to run WSL with no issues.

Score:0
bf flag

I hope you fixed your problem but let me provide you with a possible solution! I had the same issue you discribe and it turns out it was a Windows update problem. It is possible that after a windows update the "Virtual Machine Platform" option in "Turn Windows Features On and Off" is disabled. Try to enable this feature and see if WSL works...

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.