The status of the previously created ubuntu folders in windows linux s

In summary: If there is one and only one ext4.vhdx file under your C:\Users\Arman777\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc folder then the files are deleted when the WSL2 is uninstalled. Otherwise they are still there, but they are not accessible.
  • #1
Arman777
Insights Author
Gold Member
2,168
193
A couple of months ago, I had created a WSL1 and used the Ubuntu app under the username void Later on, I have decided to upgrade it to WSL2, but I have encountered an error while upgrading it. Later on, I have discovered that it was due to BIOS virtualization settings.

In any case, I have performed these operations to delete the WSL2.

https://pureinfotech.com/uninstall-wsl2-windows-10/

1) Delete Ubuntu App
2) Uninstall Windows Subsystem for Linux update
3) Clear the Virtual Machine Platform option from the Windows Features
4) Clear the Windows Subsystem for Linux option from the Windows Features

After these operations, I enabled the BIOS virtualization and downloaded the WSL2 again, which runs perfectly fine.

The problem is I wonder what happened to the files that I have created under WSL1 under the void username. Are they also deleted after doing the above operations, or are they just somewhere in my windows machine.

Similar second question:

If I delete my ubuntu app (from windows store), does that also delete all my data (folders, etc.) that I have created under that username?
 
Technology news on Phys.org
  • #2
It's complicated.

WSL files are stored under %USERPROFILE%\AppData\Local\Packages\[distro name].

In practice this means your new Ubuntu subsystem files will be somewhere like
Code:
C:\Users\Arman777\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc
which I will shorten to [wslpath].

there is a file [wslpath]\LocalState\ext4.vhdx which is a virtual hard disk file containing your Linux filesystem. This will usually be mounted in Windows and can be accessed in Windows Explorer under Linux -> Ubuntu (this usually appears right at the bottom of the left hand pane).

User files are stored under /home, in this case /home/void.

Now this is very important: there is no correspondence between WSL installations and linux user names. You can have many different WSL installs, even separate different Ubuntu WSL installations and the user names and associatied /home folders are entirely separate.

So if you are lucky and you didn't uninstall the old WSL instance properly, you might find the files still sitting there under Linux in the Explorer tree. Or perhaps you might find the virtual disk image under the path at the top of this post (or even in a backup) and be able to mount it to extract the files you want.
 
  • Like
Likes sysprog and Arman777
  • #3
Arman777 said:
If I delete my ubuntu app (from windows store), does that also delete all my data (folders, etc.) that I have created under that username?
If the uninstallation works properly it will delete the whole folder containing that WSL installation including the virtual hard disk file which contains the image of the linux filesystem which contains the /home folder which contains the /home/[username] subfolder which contains your user files.
 
  • Like
Likes sysprog and Arman777
  • #4
pbuk said:
So if you are lucky and you didn't uninstall the old WSL instance properly,
well I only performed the above steps.
pbuk said:
you might find the files still sitting there under Linux in the Explorer tree. Or perhaps you might find the virtual disk image under the path at the top of this post (or even in a backup) and be able to mount it to extract the files you want.
I actually want to make sure that those files are deleted.
pbuk said:
If the uninstallation works properly it will delete the whole folder containing that WSL installation including the virtual hard disk file which contains the image of the linux filesystem which contains the /home folder which contains the /home/[username] subfolder which contains your user files.
What do you mean by "works properly" ? You can either delete it or not, isn't it ?

btw thanks for the answer.
 
  • #5
To run WSL2, I have downloaded and deleted many ubuntu apps and created a couple of users. It's silly, but I was curious about the status of those files and some of the folders that I made during those times.
pbuk said:
Now this is very important: there is no correspondence between WSL installations and linux user names. You can have many different WSL installs, even separate different Ubuntu WSL installations and the user names and associatied /home folders are entirely separate.
That makes sense. I can also download Kali, for instance, or maybe create a new account inside Ubuntu.

pbuk said:
If the uninstallation works properly it will delete the whole folder containing that WSL installation including the virtual hard disk file which contains the image of the linux filesystem which contains the /home folder which contains the /home/[username] subfolder which contains your user files.
If that's the case then I have nothing to worry.
 
  • #6
Arman777 said:
What do you mean by "works properly" ?
Doesn't e.g. suffer a power off, disk failure or user abort before it is complete.
Arman777 said:
I actually want to make sure that those files are deleted.
If you make sure there is one and only one ext4.vhdx file under your C:\Users\Arman777\AppData\Local\... folder you should be OK.
 
  • Like
Likes sysprog and Arman777
  • #7
pbuk said:
Doesn't e.g. suffer a power off, disk failure or user abort before it is complete.

If you make sure there is one and only one ext4.vhdx file under your C:\Users\Arman777\AppData\Local\... folder you should be OK.
In this folder

Code:
C:\Users\Arman\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState

theres only one ext4.vhdx file. So I think I am okay. Good to know this info :)
 
  • #8
Arman777 said:
So I think I am okay.
Yes, as long as there isn't a .vhdx file under e.g.
Code:
...\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState
as well (I have this folder on my HD left over from a previous Ubuntu WSL installation, but it is empty which is OK).
 
  • #9
pbuk said:
Yes, as long as there isn't a .vhdx file under e.g.
Code:
...\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState
as well (I have this folder on my HD left over from a previous Ubuntu WSL installation, but it is empty which is OK).
Thats the same path that I have shared.. ?
 
  • #10
Arman777 said:
Thats the same path that I have shared.. ?
No, yours had Ubuntu20.04onWindows instead of UbuntuonWindows :-p
 
  • Like
Likes Arman777
  • #11
pbuk said:
No, yours had Ubuntu20.04onWindows instead of UbuntuonWindows :-p
There are 3 versions of Ubuntu;
Ubuntu
Ubuntu 20.04
Ubunutu 18.04
I have only Ubuntu 20.04 downloaded...so I don't have UbuntuonWindows folder...
 
  • #12
Arman777 said:
I have only Ubuntu 20.04 downloaded...
Me too...
Arman777 said:
...so I don't have UbuntuonWindows folder...
...but I do have a UbuntuonWindows folder left over from a previous install - when I uninstalled it, it only deleted the files but left the folder structure. You can never be sure with Windows!

Oh and guess what: I re-installed the App 'Ubuntu' just now and it installed 20.04, so I now have 20.04 under UbuntuonWindows and 20.04.03 under Ubuntu20.04onWindows. Yes really! (lsb_release -a).
 
  • Like
Likes Arman777
  • #13
Oh and guess what: I uninstalled that 20.04 version and it left the vhd file behind (probably because I had it mounted and forgot to close it).

All this weirdness is why I stressed above that you cannot assume that a Windows uninstall has done everything you think it should do (and don't get me started on the Registry).
 
  • #14
pbuk said:
Me too...

...but I do have a UbuntuonWindows folder left over from a previous install - when I uninstalled it, it only deleted the files but left the folder structure. You can never be sure with Windows!

Oh and guess what: I re-installed the App 'Ubuntu' just now and it installed 20.04, so I now have 20.04 under UbuntuonWindows and 20.04.03 under Ubuntu20.04onWindows. Yes really! (lsb_release -a).
lol
pbuk said:
Oh and guess what: I uninstalled that 20.04 version and it left the vhd file behind (probably because I had it mounted and forgot to close it).
thats possible I guess. Yes windows sometimes acts weird..
 

Related to The status of the previously created ubuntu folders in windows linux s

1. What is the purpose of creating ubuntu folders in Windows Linux?

The purpose of creating ubuntu folders in Windows Linux is to have a shared space between the two operating systems. This allows for easy transfer and storage of files between Ubuntu and Windows.

2. Can I access the ubuntu folders from both Ubuntu and Windows?

Yes, you can access the ubuntu folders from both operating systems. However, you may need to configure your file sharing settings to ensure proper access.

3. Will the files in ubuntu folders be affected if I make changes in Windows or Ubuntu?

Yes, any changes made to the files in ubuntu folders will be reflected in both operating systems. This is because the folders are shared between the two systems.

4. How do I create ubuntu folders in Windows Linux?

To create ubuntu folders in Windows Linux, you can use a virtual machine such as VirtualBox or VMware. You can also use the Windows Subsystem for Linux (WSL) feature on Windows 10.

5. Can I delete the ubuntu folders without affecting my operating systems?

Yes, you can safely delete the ubuntu folders without affecting your operating systems. However, make sure to back up any important files before deleting the folders.

Similar threads

  • Programming and Computer Science
Replies
4
Views
630
  • Programming and Computer Science
Replies
1
Views
864
  • Computing and Technology
Replies
21
Views
2K
Replies
38
Views
3K
  • Computing and Technology
Replies
4
Views
2K
  • Computing and Technology
Replies
24
Views
8K
  • Computing and Technology
Replies
2
Views
1K
  • Computing and Technology
Replies
12
Views
2K
  • Computing and Technology
Replies
10
Views
5K
Replies
2
Views
4K
Back
Top