Hyper V Server 2019 Sd Card

Hyper-V does not support a loopback storage configuration.This is a situation in which a Hyper-V system attempts to provide its own “remote” storage. As an example, you cannot have Hyper-V Server connect to a virtual machine running on a share that the same Hyper-V system is hosting. Hyper-V 2019 is at 15GB. So a 40GB partition is plenty. You could put this partition on either array. SSDs might be nice for when booting up, not that your slow spinners in Raid10 would affect boot times much.

-->

Applies to: Microsoft Hyper-V Server 2016, Windows Server 2016, Windows Server 2019, Microsoft Hyper-V Server 2019

Starting with Windows Server 2016, you can use Discrete Device Assignment, or DDA, to pass an entire PCIe Device into a VM. This will allow high performance access to devices like NVMe storage or Graphics Cards from within a VM while being able to leverage the devices native drivers. Please visit the Plan for Deploying Devices using Discrete Device Assignment for more details on which devices work, what are the possible security implications, etc.

There are three steps to using a device with Discrete Device Assignment:

  • Configure the VM for Discrete Device Assignment
  • Dismount the Device from the Host Partition
  • Assigning the Device to the Guest VM

All command can be executed on the Host on a Windows PowerShell console as an Administrator.

Configure the VM for DDA

Discrete Device Assignment imposes some restrictions to the VMs and the following step needs to be taken.

  1. Configure the “Automatic Stop Action” of a VM to TurnOff by executing

Some Additional VM preparation is required for Graphics Devices

Some hardware performs better if the VM in configured in a certain way. For details on whether or not you need the following configurations for your hardware, please reach out to the hardware vendor. Additional details can be found on Plan for Deploying Devices using Discrete Device Assignment and on this blog post.

  1. Enable Write-Combining on the CPU
  2. Configure the 32 bit MMIO space
  3. Configure greater than 32 bit MMIO space

    Tip

    The MMIO space values above are reasonable values to set for experimenting with a single GPU. If after starting the VM, the device is reporting an error relating to not enough resources, you'll likely need to modify these values. Consult Plan for Deploying Devices using Discrete Device Assignment to learn how to precisely calculate MMIO requirements.

Dismount the Device from the Host Partition

Optional - Install the Partitioning Driver

Discrete Device Assignment provide hardware venders the ability to provide a security mitigation driver with their devices. Note that this driver is not the same as the device driver that will be installed in the guest VM. It's up to the hardware vendor's discretion to provide this driver, however, if they do provide it, please install it prior to dismounting the device from the host partition. Please reach out to the hardware vendor for more information on if they have a mitigation driver

If no Partitioning driver is provided, during dismount you must use the -force option to bypass the security warning. Please read more about the security implications of doing this on Plan for Deploying Devices using Discrete Device Assignment.

Locating the Device's Location Path

The PCI Location path is required to dismount and mount the device from the Host. An example location path looks like the following: 'PCIROOT(20)#PCI(0300)#PCI(0000)#PCI(0800)#PCI(0000)'. More details on located the Location Path can be found here: Plan for Deploying Devices using Discrete Device Assignment.

Disable the Device

Using Device Manager or PowerShell, ensure the device is “disabled.”

Dismount the Device

Depending on if the vendor provided a mitigation driver, you'll either need to use the “-force” option or not.

  • If a Mitigation Driver was installed
  • If a Mitigation Driver was not installed
Hyper V Server 2019 Sd Card

Assigning the Device to the Guest VM

The final step is to tell Hyper-V that a VM should have access to the device. In addition to the location path found above, you'll need to know the name of the vm.

What's Next

After a device is successfully mounted in a VM, you're now able to start that VM and interact with the device as you normally would if you were running on a bare metal system. This means that you're now able to install the Hardware Vendor's drivers in the VM and applications will be able to see that hardware present. You can verify this by opening device manager in the Guest VM and seeing that the hardware now shows up.

Removing a Device and Returning it to the Host

If you want to return he device back to its original state, you will need to stop the VM and issue the following:

You can then re-enable the device in device manager and the host operating system will be able to interact with the device again.

Example

Mounting a GPU to a VM

In this example we use PowerShell to configure a VM named “ddatest1” to take the first GPU available by the manufacturer NVIDIA and assign it into the VM.

Troubleshooting

If you've passed a GPU into a VM but Remote Desktop or an application isn't recognizing the GPU, check for the following common issues:

  • Make sure you've installed the most recent version of the GPU vendor's supported driver and that the driver isn't reporting errors by checking the device state in Device Manager.
  • Make sure your device has enough MMIO space allocated within the VM. To learn more, see MMIO Space.
  • Make sure you're using a GPU that the vendor supports being used in this configuration. For example, some vendors prevent their consumer cards from working when passed through to a VM.
  • Make sure the application being run supports running inside a VM, and that both the GPU and its associated drivers are supported by the application. Some applications have allow-lists of GPUs and environments.
  • If you're using the Remote Desktop Session Host role or Windows Multipoint Services on the guest, you will need to make sure that a specific Group Policy entry is set to allow use of the default GPU. Using a Group Policy Object applied to the guest (or the Local Group Policy Editor on the guest), navigate to the following Group Policy item: Computer Configuration > Administrator Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Remote Session Environment > Use the hardware default graphics adapter for all Remote Desktop Services sessions. Set this value to Enabled, then reboot the VM once the policy has been applied.

When trying to Enabling Physical GPUs in Hyper-V, the option is not there in the GUI. In Windows 2016 there is an option as in the below screenshot:

In Windows Server 2019, here is the screenshot and there is no option to enable it:

So, Here is how to enable it in Windows server 2019. You can also use RemoteFX vGPU feature on Windows Server 2019. Although the config UI of RemoteFX vGPU has been removed from Hyper-V Manager of Windows Server 2019, you can configure RemoteFX vGPU by using Powershell on Windows Server 2019.

Check your Host GPU – You need RemoteFX Compatible GPU Card and you need to install the Remote Desktop Virtualization Host role in Windows Server Manager.

To install the Remote Desktop Virtualization Host role, open Server Manager, and select the Add Roles and Features option from the Manage menu. This will cause Windows to launch the Add Roles and Features Wizard. Click Next to skip the wizard’s Before You Begin screen. You will now be taken to the Installation Type screen. Select the Role-Based or Feature-Based Installation option and click Next. You will now be prompted to choose the server on which you wish to install the role. Choose the Select a Server from the Server Pool option. Make sure that the correct server is selected, and click Next. You should now see the Select Server Roles screen. Select the Remote Desktop Services role, and click Next. Click Next again to bypass the Features screen, and once again to bypass the Remote Desktop Services introduction.

The next screen that you will see asks you to select the role services that you wish to install. Select the Remote Desktop Virtualization Host checkbox, as shown below. If prompted to install the Media Foundation and the Remote Server Administration Tools, be sure to click the Add Features button.

Click Next, followed by Install, and the required role services will be installed onto the server. When the process completes, click Close. You will need to reboot the server in order to finish the installation.

Now open powershell as Administrator.

Run the following commands:

Look for the following:

Card

CompatibleForVirtualization: True
Enabled: True

Here is the screenshot for the Nvidia card I have. Make a note of the name of the card as well.

Hyper V Server 2019 Sd Card

You can also use the name of the card directly or with a wildcard as below:

Hyper-v Server 2019 Iso

Next, Enable/Disable Host GPU for RemoteFX vGPU. To Enable, run this:

Next, stop the VM on hyper V. Then, Add RemoteFX vGPU to your VM:

Install Hyper-v Server 2019

Example: Add-VMRemoteFx3dVideoAdapter -VMName [vm_name]

Now, open the VM Settings in Hyper V so you can configure RemoteFX vGPU. You should see this:

5) Start VM.

Other Resources:

Hyper-v Server 2019 Licensing

1. https://techcommunity.microsoft.com/t5/windows-server-for-it-pro/server-2019-hyper-v-vm-using-gpu/m-p/303761
2. https://social.technet.microsoft.com/Forums/forefront/en-US/738f05a3-a8d2-49ca-a82a-d356b83e1cd4/hyperv-quotremotefx-3d-video-adapterquot-gone-in-windows-10-1809
3. http://techgenix.com/enabling-physical-gpus-hyper/
4. https://docs.microsoft.com/en-us/powershell/module/hyper-v/enable-vmremotefxphysicalvideoadapter?view=win10-ps
5. https://social.technet.microsoft.com/wiki/contents/articles/16652.remotefx-vgpu-setup-and-configuration-guide-for-windows-server-2012.aspx?wa=wsignin1.0&CommentPosted=true