3.2. Using PowerShell

An alternative to using the Hyper-V manager for virtual machine creation is to use Microsoft PowerShell commands.

The steps are as follows:

  1. Create at least one vSwitch

    New-VMSwitch -Name <name> <type>

  1. Configure the cOS Core virtual machine

    New-VM -Name <name> -MemoryStartupBytes <size> -VHDPath <VHD-filepath>

    Note that the <name> given to the virtual machine will become the value for <vm-name> in later commands.

  1. Check that a single CPU is assigned

    SET-VMProcessor -VMName <vm-name> -Count 1

  1. Connect a network adapter

    connect-VMNetworkAdapter -vmname <vm-name> -Name <adapter>
    		-SwitchName <vswitch>

    Note that the Legacy Network Adapter is not supported. SR-IOV is also not supported.

  1. Enable MAC address spoofing if required

    Set-VMNetworkAdapter -vmname <vm-name> -Name <adapter>
    		-MacAddressSpoofing On

    VLAN filtering will require spoofing to be enabled. Further details about setting up VLAN filtering can be found in Section 3.3, Using VLANs.

  1. Power on the virtual machine

    Start-VM -vmname <vm-name>

  1. Configure cOS Core

    Go to Chapter 5, Configuring cOS Core for details on how to connect to and configure cOS Core.