How to enable the Virtual Machine Platform Windows feature in EC2 instance?

0

When trying to install Windows Subsystem for Linux ("WSL") on an EC2 instance running Windows Server 2022 Base, I get the following error message.

PS \> wsl --install
Ubuntu is already installed.
Launching Ubuntu...
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80370102
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
For information please visit https://aka.ms/enablevirtualization
Press any key to continue...

How can I enable the Virtual Machine Platform Windows feature on my EC2 instance?

asked a year ago2.6K views
3 Answers
4

hello,

To enable the Virtual Machine Platform Windows feature and install WSL on an EC2 instance running Windows Server 2022, follow these steps:

1.For WSL 1 on Virtualized Instances:

  • Run the following command to install WSL 1
wsl --install --enable-wsl1

  • Restart your EC2 instance.
  • Set WSL 1 as the default version:
wsl --set-default-version 1

2.For WSL 2 on Metal Instances:

  • Ensure you are using a .metal instance type.
  • Run the following command to install WSL 2:
wsl --install

Note that nested virtualization required for WSL 2 is only supported on .metal instance types in EC2. Virtualized instances can only use WSL 1. For detailed information, refer to the Document

https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/install-wsl-on-ec2-windows-instance.html

i hope this will be helpful to you

profile picture
EXPERT
answered a year ago
1

Hello.

Is it WSL1 that you are trying to install?
In that case, I think you can install it by following the steps in the document below.
https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/install-wsl-on-ec2-windows-instance.html

For WSL2 you need to use a metal instance.

profile picture
EXPERT
answered a year ago
profile pictureAWS
EXPERT
reviewed a year ago
0

Hello, according to the document, you can only run nested virtualisation on a *.metal instance type: https://aws.amazon.com/blogs/compute/running-hyper-v-on-amazon-ec2-bare-metal-instances/

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions