How to register vdhx file as WSL 2? - windows-subsystem-for-linux

I have two separate drivers (let's call them C and D). I had Windows installed on C and a vdhx file (containing a WSL installation) on driver D. I had to reinstall Windows (hence, WSL) on C, but the vdhx file still available on D.
Is there a way to register this existing vdhx file as a WSL 2 distro or would I need to recreate the distro from scratch?
I've tried using wsl.exe --import but it seems to work only for tar files. I also came across wslconfig.exe and saw a switch to unregister a distro, but not to register a new one.

The following procedure worked for me:
Open regedit and navigate to Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss. Under this key there is a subkey that looks like a GUID, for each installed distro. Find the one that you want to move to different disk, and export it.
run wsl --unregister DistroName so that you can move the files
move your distro to another location
open the .reg file you exported in step 1, update BasePath value to point to the new location.
import the .reg file

Related

direnv with WSL2 - not loading files when used with source_env_if_exists

(this is to document a specific behavior that may affect users mixing windows and wsl for work)
I use a hierarchy of directories with .envrc in them to manage environment.
file content is like
export BASE_URL="url"
source_env_if_exists .terraform-state
First line works, second appears to be not doing anything. source_env_if_exists is direnv library call (https://github.com/direnv/direnv/blob/master/stdlib.sh)
Local environment is WSL2(Ubuntu), where the file is part of directory checked out on windows but used with in WSL
File is edited/cloned from windows leaves line ending in windows style. direnv library leaves that to bash (and does nothing) . Windows WSL - issue with carriege return · Issue #542 · direnv/direnv · GitHub has more details.
Fixing the file (using dos2linux or fresh clone from WSL2 ) worked.

In WSL version 2, where could I find the Windows folders?

I recently installed WSL version 2 according to the instruction. Everything work greatly. But I notice that the folder /mnt/c is not available any more.
I understand the new WSL using vhdx as file system which gives us better FS performance, but I could not find a way to access files in Windows.
I also tried to check the wsl --help but I could not find anything helpful.
Any suggestions?
After read more, I notice that WSL 2 is actually an optimized VM on Windows 10, which means the running WSL 2 has no idea about where it self. Seems there should be a way to pass some Windows folders while launch it. Haven't figured out how.....
By default, the command prompt in WSL is located at C:\Users\username. WSL considers this /home/user but you can can reference any directory on your Windows machine by starting at the root directory with /../../.
Here is an example command: find "/../../mnt/c/anyFolder/subfolder" -name "test" -type d

How to install apktool on Win 10?

I have downloaded both apktool_2.1.1.jar & apktool_2.0.0rc4.jar from https://bitbucket.org/iBotPeaches/apktool/downloads and pasted it in C://Windows. Yet when I run apktool in cmd, it returns:
C:\Users\arpit>apktool
'apktool' is not recognized as an internal or external command,
operable program or batch file.
Any help will be appreciated.
->Download Windows wrapper script from here https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/windows/apktool.bat
(Right click, Save Link As apktool.bat)
->Download apktool-2 https://bitbucket.org/iBotPeaches/apktool/downloads
(find newest here)
->Rename downloaded jar to apktool.jar
->Move both files (apktool.jar & apktool.bat) to your System32 directory (Usually C:\Windows\system32)
If you do not have access to C:\Windows\system32, you may place the two files anywhere then add that directory to your Environment Variables System PATH variable.
->Try running apktool with admin previlages via command prompt
Apktool is a tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications. You will find apktool indispensible if you want to extract resources (i.e. images from an Android application. Actually, the tool has no competitors at all!)
An online version of the apktool is available here: www.javadecompilers.com/apktool

How to access file with unacceptable file name

I don't know is this site a good place to ask this question... A long time ago, my operating system was linux. On linux I made a file with name \/:*?"<>|. Then I installed windows instead of linux, but now I cannot access or delete this file. I tried to delete it using Unlocker, ProceXP, Command Prompt and many other programs, but I couldn't. Also, I tried all commands in Command Prompt which can be used for deleting undeletable files, but this file is still here. If I try to rename it, process explorer.exe crashes. Then I installed linux again and this file become accessable.
Now I have windows and another file with name \/:*?"<>|. Is it possible to access this file without installing linux? Is there a way to access place on filesystem where this file name is stored and manualy change it to any acceptable file name? If yes, can you explain which program is best for it?
Try using DeleteDoctor. I've used it under similar situations as yours with great success. You can download a copy here:
http://www.download25.com/delete-doctor-download.html

What is TCPMon and How to install it on linux?

I want to know about the TCPMon and how to install it on linux based distribution. Also what are the uses of the tool
TCPMon is a utility that allows the user to monitor the messages passed along in TCP based conversation. It is based on a swing UI and works on almost all platforms that Java supports.It has originally being part of Axis1 and now stands as an independent project.
Download and Install on Linux:
1.Download the zip package from Apache TCPMon release
2.Go to you download directory and copy the zip file to your preferred destination
3.Open terminal and navigate to the folder where you downloaded the zip file
4.Type in the terminal "unzip tcpmon-1.0-bin.zip" and unzip it
type "cd tcpmon-1.0-bin/build" and hit enter
type "chmod 777 tcpmon.sh" and hit enter
7.finally type ./tcpmon.sh
That's it