HyperV on a home server

Posted on February 1, 2015
Tags: hackhard

0.0.1 On Client Windows PC

Get-NetConnectionProfile
For me it returns “Wi-Fi” in the name field, use this in the next command.

Set-NetConnectionProfile -InterfaceAlias Wi-Fi -NetworkCategory Private winrm quickconfig

Set-Item WSMan:\localhost\Client\TrustedHosts -Value "192.168.1.66" Enable-WSManCredSSP -Role client -DelegateComputer "192.168.1.66"

Go to group policy Computer Configuration > Administrative Templates > System > Credential Delegation
Enable “Allow delegating fresh credentials”, Press “Show…” next to “Add servers to the list:
Add value”wsman/*”

Enable “Allow delegating fresh credentials with NTLM-only server authentication”, Press “Show…” next to “Add servers to the list:
Add value”wsman/*”

Click on hyper-v manager “Connect to Server…”
DESKTOP-ABCD2E Your password to login to Administrator

“DESKTOP-ABCD2E” will be replaced by the name of your PC.

0.1 Bad Server Wifi startup fix

I noticed that my server never startups with the internet on and I have to reset the network adapter everytime which means physically being at the server PC and running commands.

Here is the command to rest the Network adapter on Powershell.
Restart-NetAdapter (Get-NetAdapter | select -expand Name)

0.1.0.0.1 Automate the wifi restart fix

To call the command on startup, we create a config file in powershell

New-Item -Path . -Name "Config.ps1" -ItemType "file" -Value "Restart-NetAdapter (Get-NetAdapter | select -expand Name)"

Credit to stackoverflow “vkrams”, a startup script that sets any task to run at startup.

$TaskAction1 = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-ExecutionPolicy Bypass -File Config.ps1"
$TaskTrigger = New-ScheduledTaskTrigger -AtStartup
$TaskPrincipal = New-ScheduledTaskPrincipal -UserID "NT AUTHORITY\SYSTEM" -LogonType ServiceAccount -RunLevel Highest
Register-ScheduledTask -Action $TaskAction1 -Trigger $TaskTrigger -Principal $TaskPrincipal -TaskName "Config" -Description "Config Script"
0.1.0.0.2 Irrelevant tidbits

The wget of linux in powershell is:

(New-Object System.Net.WebClient).DownloadFile("https://github.com/macchrome/winchrome/releases/download/v92.0.4515.107-r885287-Win64/92.0.4515.107_ungoogled_mini_installer.exe", "ChromeSetup.exe")

We can download a fully functioning Chrome on a barebones Hyper-V core server.