1. Create INTERNAL network switch:

2. Check network hardware adapters:

3. Run Hyper-V VM autoPig created by script:


> gc .\newVM.ps1.txt
### RENAME this file to newVM.ps1 to make this
### script recognizable by Powershell.
### Apply necessary policy to allow local scripts:
### Get-ExecutionPolicy,
### Set-ExecutionPolicy { remotesigned | unrestricted }

# Set VM Name, Switch Name, and Installation Media Path.

$VMName = 'autoPIG'
$Switch = 'Default Switch'
$InstallMedia = 'F:\ISO\debiuefi1.iso'

# Create New Virtual Machine

Remove-VM $VMName -Force

rm "C:\Users\Public\Documents\Hyper-V\Virtual hard disks\$VMName.vhdx"

#  -Path "D:\VM\$VMName" `

New-VM `
  -Name $VMName `
  -MemoryStartupBytes 2GB `
  -Generation 2 `
  -NewVHDPath "C:\Users\Public\Documents\Hyper-V\Virtual hard disks\$VMName.vhdx" `
  -NewVHDSizeBytes 32GB `
  -SwitchName $Switch

4. Check Host-Only NIC properties (with Network Center)

Image

Image

5. Allow packet forwarding on host:

Image

6. Reboot your wifi connected Host Computer (Windows 10)

7. From VM console (not via SSH yet) -- do following:

/etc/network/interfaces

# This file describes the network interfaces 
# and how to activate them. For more information see:
# source /etc/network/interfaces.d/* 

# The loopback network interface 
auto lo 
iface lo inet loopback 

# The primary network interface 
allow-hotplug eth0 
iface eth0 inet dhcp 

# The secondary network interface 
allow-hotplug eth1 
iface eth1 inet static 
  address 10.10.10.10 
  netmask 255.255.255.0 

8. Restart your VM and try to Connect 10.10.10.10 as usual

Good luck!