WSL2 Prompt contains extended WSL path? - docker-desktop

I'm using build 19042.450 of Windows 10 enterprise, build 2.3.5.1 of the edge version of Docker Desktop and WSL2 integration. The last Docker Desktop update failed to install fully, but I uninstalled/reinstalled, and now the Docker is working fine.
However, I noticed that my WSL prompt used to look like this:
mark#DESKTOP:/mnt/c/CODE$
But now looks like this:
mark#DESKTOP:/tmp/docker-desktop/shadowing-mounts/f55edec80b1e9ede02de2e973bd22e24a6f111e60342288eca607a63a1f0528b/mnt/c/CODE$
And I'm curious if this is a new weird failure or a new feature.
Does anyone know why this long path is now my prompt?

Related

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)

install weblogic on VM with Solaris OS

I stuck in install weblogic on my vm solaris. i try that
java -d64 -jar fmw_12.2.1.3.0_wls.jar
and i got an error
Checking monitor: must be configured to display at least 256 colors. DISPLAY environment variable not set. Failed <<<<
Any solution for these error?
This happens if you want to do an graphical install of the system without having a X11 running. The error message is quite normal for such an situation.
You could:
Not running the installer in the graphical mode by doing a silent install (please refer to https://docs.oracle.com/cd/E24329_01/doc.1211/e24492/silent.htm#WLSIG131 for information)
Install the nescessary package to have an X11 and stuff running in your VM with pkg install solaris-desktop. Then execute the java command again from the GUI . This obviously only works if you can get a the graphical output of the VM for example via VNC or other tools.
You could set the DISPLAY variable to an installed X11 implementation. For example i use Xquartz on my Apple notebook. Then configure DISPLAY and XAUTHORITY correctly. Or you could simply log into the Solaris system with ssh -X . I prefer the second one, as it does everything automatically.

Ubuntu (store version) - path for console emulators

I've currently moved from old WSL which was called Bash to Ubuntu from windows store. I'm using it along with ConEmu terminal emulator. To configure this two together, I need to specify ubuntu.exe path in conemu, but I can't find it, do you know where's it installed ? For instance, before it was C:\Windows\system32\bash.exe
Execute where ubuntu command in cmd to find correct path.
for example:
C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps\ubuntu.exe

How to get Sikuli working in headless mode

If we have a headless test server running sikuli (both ubuntu and windows configurations needed), how to get it work without a physical monitor and preferably for as many screen resolutions as possible.
I successfully got sikuli running in headless mode (no physical monitor connected)
Ubuntu: check Xvfb.
Windows: install display driver on the machine (to be headless) from virtualbox guest additions display drivers and use TightVNC to remotely set resolution from another machine.
Detailed steps for windows 7
Assume that:
Machine A: to be headless machine, windows 7, with vnc server ready (e.g. TightVNC server installed and waiting for connections).
Machine B: will be used to remotely setup the virtual display driver on machine A.
steps:
Download virtualbox guest additions iso file on Machine A from here (for latest version check latest version here and download VBoxGuestAdditions_x.y.z.iso)
Extract iso file (possibly with winrar) into a directory (let us call it folder D)
using command prompt cd to D folder
Driver extraction
-To extract the 32-bit drivers to "C:\Drivers", do the following:
VBoxWindowsAdditions-x86 /extract /D=C:\Drivers
-For the 64-bit drivers:
VBoxWindowsAdditions-amd64 /extract /D=C:\Drivers
Goto device manager
add hardware
Restart and connect with VNC viewer, now you should be able to change screen resolution
other valuable info on launchpad.
I got SikuliX working in a true headless mode in GCE with a Windows 2016 client system. It takes some duct tape and other Rube Goldberg contraptions to work, but it can be done.
The issue is that, for GCE (and probably AWS and other cloud environment Windows clients), you don't have a virtual video adapter and display, so, unless there's an open RDP connection to the client, it doesn't have a screen, and SikuliX/OpenCV will get a 1024x768 black desktop, and fail.
So, the question is, how to create an RDP connection without having an actual screen anywhere. I did this using Xvfb (X Windows virtual frame buffer). This does require a second VM, though. Xvfb runs on Linux. The other piece of the puzzle is xfreerdp 2.0. The 2.x version is required for compatibility with recent versions of Windows. 1.x is included with some Linux distros; 2.x may need to be built from sources, depending on what flavor Linux you're using. I'm using CentOS, which did require me to build my own.
The commands to establish the headless RDP session, once the pieces are in place, look something like this:
/usr/bin/Xvfb :0 -screen 0 1920x1080x24 &
export DISPLAY=:0.0
/usr/local/bin/xfreerdp /size:1920x1080 /u:[WindowsUser] /p:"[WindowsPassword]" /v:[WindowsTarget]
In our environment we automated this as part of the build job kicked off by Jenkins. For this to work under the Jenkins slave, it was also necessary to run the Jenkins slave as a user process, rather than a service... this can be accomplished by enabling auto admin login and setting the slave launch script as a run (on logon) command.
For those looking to automate on ec2 windows machines, this worked for me: http://www.allianceglobalservices.com/blog/executing-automation-suite-on-disconnectedlocked-machines
In summary, I used RDC to connect, put the following code in a batch file on remote desktop, double clicked it, and sikulix started working remotely (kicking me out of RDC at the same time). Note that ec2 windows machines default to 1024x768 when tscon takes over which may be too small so TightVnc can be used to increase the resolution to 1280x1024 before running.
tscon.exe 0 /dest:console
tscon.exe 1 /dest:console
tscon.exe 2 /dest:console
tscon.exe 3 /dest:console
START /DC:\Sikulix /WAIT /B C:\Sikulix\runsikulix.cmd -d 3 -r C:\test.sikuli -f C:\Sikulix\log.txt -d C:\Sikulix\userlog.txt
I just figure out a way to resolve similar issue.
My env:
local: windows pc
remote (for running sikulix + app I would like to test): windows ec2 instance
My way:
1.create a .bat file, its contents:
ping 127.0.0.1 -n 15 > nul
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console
)
cd "\path\to\sikulix"
java -jar sikulixide-2.0.5.jar -r /path/to/sikulix -c > logfile.log
prepare your app
run the bat (right click > run as administrator)
ping will give your 10s, so that you can bring your app back to front
you will be disconnnected from rdp connection
Explanation:
ping is like "sleep"
for loop: kick out current user & keep session alive

An after-build copy command compatible with Windows and Linux at the same time

I'm developing C# using Mono and MonoDevelop in Windows and Ubuntu. I might code the same project in Windows today and tomorrow in Ubuntu (which is why I chose Mono and MonoDevelop).
In project properties I need to add some After Build commands to copy some projects compiled files into some alternate folders. And I've done this like so:
cp ${TargetFile} ${SolutionDir}/SomePorject/bin/${ProjectConfigName}/Plugins
While this command works perfectly in my Ubuntu machine, each time I'm using Windows my Build requests get canceled since this command can not be executed in Windows (there's no cp in Windows). It makes this a pain to switch between Ubuntu and Windows since each time I need to change these commands.
Now my question is, is there a copy command which works in Windows and Ubuntu alike? Or maybe MonoDevelop has come up with a copy command of its own which works according to the OS it is running under!
I think "configurations" is your way to go.
Create separate configurations for each platform (Right click on solution -> options -> configurations). After that, in "Custom commands" create two "After Build" commands, one for Windows, and other for Ubuntu.
When you build solution just choose your platform from your configurations.
You could install cygwin on your Windows box.