Win 10 WSL won't set default 2 - windows

Completely new to developing on windows (as my mac is in for repair) and I'm trying to follow these instructions https://learn.microsoft.com/en-us/windows/wsl/install-win10
But while I seem to have an adequate version, my wsl does not seem to have the right option. I have installed the wsl update, but was not asked for elevated privaledges while doing so. Any ideas?

After following #ahsan-a's answer, make sure to complete the last step,Set your distribution version to WSL 1 or WSL 2:
On Powershell:
wsl --list --verbose
Then:
wsl --set-version <distribution name> 2

Make sure virtualisation is enabled in your BIOS by going to Task Manager -> More Details -> Performace -> CPU and an option called Virtualisation should be set to enabled. If it isn't enabled then go to your BIOS and enable SVM Mode on AMD CPUs or Intel Virtualisation Technology on Intel CPUs.
next, make sure WSL is enabled by running this in powershell:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
and that the virtual machine feature is enabled by running this:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart your computer. Then, go to the microsoft store and download your distro of choice. Then, set your default distro by running
wsl --setdefault <DistributionName>
and enable WSL 2 by running
wsl --set-default-version 2
again. If this doesn't work, run wsl --help and make sure --set-default-version is listed. If it isn't listed, your operating system does not support it and you need to update. If it throws this error:
WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel
Update here and run the MSI update package.

If anyone is stuck on this issue and they have tried the above solutions, I would give wsl --set-version <distro_name> 2.

Also #Simon H
I faced similar issue when updating to wsl2,
You may also keep both wsl1 and wsl2,
Once you have wsl1, Follow the guidelines as posted by #ahsan-a, update to wsl2
Have a new/separate linux distro installed for wsl2, Like this
Then you may easily switch between wsl1 and wsl2 like this
Observe the state, I just do start-> type the name of linux distro.
Next to make new distro default, Just supply as shown below

In some cases wsl2 doesn't work.
if your wsl machnine doesn't start deinstall your machine and set the default parameter to
wsl --set-default-version 1
and reinstall your wsl machine

Step by step resolution for the issue.
Step 1: Make sure virtualization is enabled in your BIOS.
Task Manager -> More Details -> Performance -> CPU -> Virtualization
> -> "Enabled"
Step 2: Open "Windows Features" from start menu and make sure "Virtualization Machine Platform" and "Windows Subsystem for Linux" is checked
Step 3: From PowerShell, to see available distros in machine use
wsl --list --verbose
Step 4: To set WSL default version to 2 use
wsl --set-default-version 2
Step 5: To set the appropriate distro to wsl 2, use
wsl --set-version 2
In case in Step 5, you encounter the error WSL 2 requires an update to its kernel component. Download and install MSI update package from official MS site. Once update is installed, restart and continue from step 4.

Related

Docker Desktop Installation failed: one prerequisite is not fulfilled on Windows 10

I have a problem when installing a Docker Desktop 2.3.0.3
"Installation failed: one prerequisite is not fullfilled"
Docker Desktop requires Windows 10 Pro/Enterprise (15063+) or Windows 10 Home (19018+).
My Computer System Specification:
OS Name: Microsoft Windows 10 Pro
Version: 10.0.10240 Build 10240
RAM: 8Gb
I have tried manually Install Hyper-V and Containers in my Computer, but still failed to install the desktop docker.. Anyone can help me? Im need your help.
You need to install Windows 10 Home 2004 build which was released on May 2020, you can use Microsoft's update assistant to manually get the update if it's not showing up for you on Windows.
Get it here: https://www.microsoft.com/en-us/software-download/windows10
You may want to try Docker Toolbox
Docker Toolbox is an installer for quick setup and launch of a Docker
environment on older Mac and Windows systems that do not meet the
requirements of the new Docker Desktop for Mac and Docker Desktop for
Windows apps.
The actual required Windows version is greater than what it says in the installer GUI.
It might be a typo! and according to Docker this has happened before:
Docker actually requires Windows build xxxxx or greater - we're
working on the typo in the installer gui, but you'll need to update
your Windows to proceed. (Jan 8, 2018)
Just Update Windows and the problem goes away.
If you cannot update the system use choco
Install following the official Сhocolatey documentation: https://chocolatey.org/install
After installation, run the command choco install docker-desktop or follow the official installation documentation https://community.chocolatey.org/packages/docker-desktop

VMWare Workstation cannot run on Windows 10 after recent update to Windows 10

I've Windows 10 Pro system, and use Hyper-V on that system. Due to the needs of device redirection doesn't works well with Hyper-V, I've installed VMWare Workstation 14.
I have to disable Hyper-V to make VMWare Workstation work, at beginning. It worked until last weekend , seems because of the QFE update. I just verified, it was not QFE but Feature update to Windows 10, version 1803 that triggered the problem with VMWare Workstation again.
After Windows update completed (after reboot), I tried to start a VM in VMWare. I get the error dialog complaining about Device/Credential Guard.
Following the instruction in this link: https://kb.vmware.com/s/article/2146361, and after the reboot, I get another complaint about incompatibility with Hyper-V.
After reset the Hyper-V selection in Windows Feature or confirm that HyperV is not already removed, and reboot, the first error came back.
It gets in a loop of error complaining about Device Guard and complaining about Hyper-V for VMWare.
Ok, thanks to the answer from communities of VMWare: https://communities.vmware.com/thread/588526
The issue is now gone, by applying the following change:
Disable credential guard by using readiness tool from Microsoft: https://www.microsoft.com/en-us/download/details.aspx?id=53337, with this command: DG_Readiness_Tool_v3.2.ps1 -disable
Disable Hyper-V by using PowerShell command: Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
Reboot and accept to boot without CG/DG.
Although I don't like that VMWare cannot work together with device guard from system, I get my VM working for the moment.
1- run cmd as admin
2- run : bcdedit /set hypervisorlaunchtype off
3- reboot
let me knew if it works please
good luck
here are the few steps for you to solve this issue:
Disable the HvHost service (and any other services with prefix Hyper-V if needed) from windows TaskManager(Ctrl+Alt+Del)
use the tool from the official website
Uncompress the downloaded zip file to your own directory, take C:\DG_Readiness_Tool_v3.5 here for instance.
Run Windows PowerShell as admin, type the following two commands:
cd C:\DG_Readiness_Tool_v3.5
.\DG_Readiness_Tool_v3.5.ps1 -Disable
Reboot
Adrian at https://answers.microsoft.com/en-us/windows/forum/windows_10-security/cannot-disable-memory-integrity-core-isolation-in/29ac5ce4-30d2-47d1-ab17-734980fd287b
says "I think it's a bug that this cannot be disabled via UI but fortunately it's possible through the registry by setting the following key to 0:"
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity\Enabled
This worked for me as well [Windows 10 Pro Version 1803(OS Build 17134.112, VMWare Workstation 14 Pro Version 14.1.2]

Copy/paste from vbox to windows

I am using Windows 10 and VBox v5.1.6r110634 (Qt5.5.1). Ubuntu 16.04.1 LTS and GNOME Terminal 3.18.3.
I am trying to copy from a Ubuntu system to my Windows 10 Visual Studio v14.0.25431.01 Update 3. I have set Ubuntu's settings to be bidirectional just as described on a web page (Settings->General->Advanced->Shared Clipboard and Drag'n'Drop to Bidirectional). But the copy/paste from a terminal to Windows does not work. I have verified that the Copy operation in Ubuntu works because I can then Past to Ubuntu. But when I try to Paste to Visual Studio it does not work. I have tried a complete shutdown of Vbox and restarted it but still no help. I have checked to be sure I have the guest additions loaded so that is not the problem.
Does anyone have any ideas as to what may be going on?
Devices -> Insert Guest Additions CD Image -> Install -> Restart.
Remember activate bi-directional shared clipboard!
You may also need to install some libraries if its from a standard Ubuntu desktop build
sudo apt-get install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-ext-pack
And Install Insert Additions CD Image from the device menu of the virtualbox window of the running VM.
How to enable bi-directional copy and paste on virtual box/ubuntu 16.4
pkill 'VBoxClient --clipboard' -f & sleep 1 && VBoxClient --clipboard
I ran this command on virtualbox(5.2)/ubuntu(16.4). It worked for me. I have enabled the bi-direction mode in settings->advance as well and after that ran this command.
Finally, trying so many methods, this one worked for me.

Cannot start docker after installation on Windows

I am a new to Docker. After the installation of Docker Toolbox (OS: Windows 10) I run Docker Quickstart Terminal and in the console I see this:
Running pre-create checks...
Error wirh pre-create check: "Hyper-V is installed. VirtualBox won't boot a 64bits VM when Hyper-V is activated. It it's installed but deactivated, you can use --virtualbox-no-vtx-check to try anyways"
Look like something went wrong in step 'Checking if machine default exists'...
Press any key to continue...
What did I do wrong? All checking of system and install steps are taken from here.
Thank you very much for your help!
Hyper-V and VirtualBox are conflicting each other.
You can either uninstall Hyper-V or run
docker-machine create -d virtualbox --virtualbox-no-vtx-check test
Source
Docker supports Hyper-V as the driver
You need to perform the following steps:
Create a virtual switch, refer to this article on how to do that
Create a docker machine using that network switch and hyper-V driver.
docker-machine create -d hyperv --hyperv-virtual-switch "name of the virtual switch created above" default
I got the same error when I installed Docker Toolbox on my Windows 10 machine.
Solution:
Install Docker Community Edition (not Docker Toolbox)
Enable Hyper-V
Open Control Panel -> System and Security -> Programs (left panel) -> Turn Windows features on or off -> Check the Hyper-V box
As of 2017's Win 10, if you don't have Hyper-V option, then your Windows OS is not Enterprise Edition. Also, Docker seems to work a lot better on Intel processors (not AMD).
Add C:\Program Files\Docker\Docker\resources\bin to Path in Environmental Variables.
Open Git Bash and type docker-compose up and now that command should work.
If you don't have GitBash, please download it.
I was having the same issue, and this blog post solved it. The author runs you through the steps of adding the --virtualbox-no-vtx-check flag to the docker shell script.
Virtualbox and Hyper-V don't play well together. I am NOT the author.
I set the Hyper-V off using windows feature on off and it worked for me.
See if when you run:
docker-machine create -d hyperv --hyperv-virtual-switch "Virtual Switch" default
you get Error with: pre-create check: "Hyper-V PowerShell Module is not available"
If so just enable in Docker(icon on your desktop)->settings->expose daemon on TCP ...
You need to disable Hypervisor to check new application that use VT-x before the virtual machine launch:
Open the command prompt as Administrator
Run bcdedit to check hypervisor status:
Check hypervisor launch type.
If is set to auto then disable it:
bcdedit /set hypervisorlaunchtype off
Reboot host machine and launch VirtualBox again
After performing above steps I opened again Docker Quickstart terminal and it is working fine.
I pressed the Windows Button on keyboard. Typed 'Hyper-V Manager'. It opened the 'Hyper-V Manager'. Then I right clicked on my machine name. There was an option to 'stop'. I selected this option. It stopped the 'Hyper-V' on my machine and then Kitematic worked fine, i.e., it download the hello-world-nginx and displayed the web page.
NOTE: This is strange and I am not sure why. Once I have done above steps, now when I restarted the Hyper-V using Hyper-V Manager, Kitematic is still working and downloading images. Can anybody comment why it is now still working when Hyper-V is also running ? Thank you.
Good
Ali Ahsan
The solution as suggested by #Gene is correct and works perfectly if:
One has windows pro edition
Both Hyper-V Management Tools and Hyper-V Platform are enabled
Sometime this isn't always the case; here is what to do:
Check Windows Edition:
To check which version right click on Windows key and select System.
Scroll down to Windows specifications and look at [Edition]
Check Hyper-V Platform (virtualisation)
For Hyper-V Platform to be enabled one must turn on virtualisation; normally this is done via the BIOS.
On HP laptop one this is done from the BIOS.
On start-up click Ctrl+F10
Press the right arrow key to System Configuration tab.
Select Virtualization Technology and then press the Enter key.
Select Enabled and press the Enter key.
Once these steps are done then:
Search for Turn Windows features on or off.
Scroll down to Hyper-V
Tick this box (Ensure you see a tick NOT a black box which indicates some features not enabled)
Upon restart docker should be running... good luck !!

How to initialize and run Docker on windows?

I have Docker installed on Windows 7 platform. However when I try to run boot2docker start, the console gives me:
Failed to get machine 'boot2docker-vm': machine does not exist.
Ok, so I try to initialize the machine: boot2docker init. What now happens is even though I have the ISO image on the same path as docker, it tries to download a new image (and then fails to do so).
I uninstalled both OracleVM and GIT before installing them with boot2docker bundle as advised on Docker forums, but now I don't know how to proceed.
I had the same problem on a Windows 7 64 bit system when I installed the entire boot2docker package. It seems that running the solely 64-bit based boot2docker image from a 32-bit OS image (e.g. created by Virtualbox) does not work.
The solution for me was
to activate Intel Virtualisation Technolologies in my BIOS
(Lenovo X61 for me). Note that the settings can be found either
under CPU or Security.
choose a 64 bit OS version in VirtualBox and boot in with the
image obtained by boot2docker.
In case you're trying to do this now
For Windows 10 64-bit: Pro, Enterprise, or Education (Build 15063 or later), follow the instructions to install Docker Desktop here https://docs.docker.com/docker-for-windows/install/.
If you have Windows systems that do not meet the requirements of Docker Desktop for Windows(in my case Microsoft Windows 10 Home Single Language), you can install Docker Toolbox by following the instructions here https://docs.docker.com/toolbox/toolbox_install_windows/.
boot2docker does not support sharing directories on Windows IIRC. The way I run Docker on windows is:
install VirtualBox
install Vagrant
create a directory (let's say c:\vm\docker)
download this Vagrantfile and save it under c:\vm\docker\Vagrantfile
open a DOS command prompt
go to the directory cd c:\vm\docker
start the VM vagrant up and wait for it to install, start up and get provisionned
connect to the VM vagrant ssh
play with docker docker images, etc
Also you might want a real console instead of using the DOS command prompt:
install Git Bash for Windows
install Console
setup Console to use Git Bash (see this guide)
use Console to run the vagrant up and vagrant ssh commands

Resources