crc-org / crc

CRC is a tool to help you run containers. It manages a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes
https://crc.dev
Apache License 2.0
1.26k stars 238 forks source link

[Enhancement] Windows Server Support #3415

Open adrianriobo opened 1 year ago

adrianriobo commented 1 year ago

With the introduction of user network mode, Openshift Local remove the constraint on setup a vswitch to route communication within the machine. That constraint was the main reason to pick only Windows 10 Professional as a valid supported version.

Now the support can be extended to any Windows version which supports hyper-v feature.

Currently, install Openshift Local on a Windows Server, which already has hyper-v and its management tools enabled, works out of the box.

On other systems where hyper-v is not enable yet, Openshift Local installation should fix it by enabling/installing the feature. Currently the installer command to enable hyper-v only works with Workstations.

Here we can see the different cmdlets to handle it based on product type:

Workstations

Get-ComputerInfo | select OSProductType
OsProductType
-------------
  WorkStation

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart

Servers

PS C:\Windows\system32> Get-ComputerInfo | select OSProductType

OsProductType
-------------
       Server

Install-WindowsFeature -Name Hyper-V -IncludeManagementTools

Fix

The installer script can get information on the product type and set the cmdlet accordingly, with this in place we could evaluate if we can agreed on support windows server versions

adrianriobo commented 1 year ago

:eyes: sample code for this

VGerris commented 1 year ago

Another idea would be to file a bug at Microsoft Windows, either version, referring to the other one and pointing out it is not consistent, saving a billion if/else statements :). Keeping this in mind, https://github.com/crc-org/crc/blob/main/CONTRIBUTING.adoc would you consider trying to make a PR for it? thank you