Skip to content

Instantly share code, notes, and snippets.

@john-clark
Last active April 30, 2022 21:16
Show Gist options
  • Save john-clark/0f0e25980304de5caea8feba5063a7f5 to your computer and use it in GitHub Desktop.
Save john-clark/0f0e25980304de5caea8feba5063a7f5 to your computer and use it in GitHub Desktop.
Install and Configure - Windows Server 2019 CORE no GUI on ProxMox VM

Windows Server 2019 Core on ProxMox VM - file server

Install and Configure

SCONFIG

  1. Change computer name
  2. Change Timezone
  3. Set updates to Manual

Uninstall slow down

Uninstall-WindowsFeature Windows-Defender

Disable IPv6

Get-NetAdapterBinding -ComponentID ms_tcpip6
Disable-NetAdapterBinding -Name "Ethernet Instance 0" -ComponentID ms_tcpip6
#or all
Disable-NetAdapterBinding -Name "*" -ComponentID ms_tcpip6

Install ssh

Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
#look for the version number and replace something on the next line
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~something
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~something
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'

Now you can ssh into the machine

Locate and install drivers

# display available drives to find mounted iso (typically d:)
Get-PSDrive

# install drivers
pnputil -i -a D:\NetKVM\2k19\amd64\*.inf
pnputil -i -a D:\Balloon\2k19\amd64\*.inf
pnputil -i -a D:\vioserial\2k19\amd64\*.inf

# set up guest agent
Set-Location D:\guest-agent
# set driver to allow dynamically change it’s memory usage
.\qemu-ga-x86_64.msi

Copy-Item D:\Balloon\2k19\amd64 -Destination 'C:\Program Files\Balloon' -Recurse
Set-Location 'C:\Program Files\Balloon'
./blnsvr.exe -i
Restart-Computer

Now you can enable qemu guest agent and restart

Allow trusted subnet

# Replace x.x.x with local subnet
New-NetFirewallRule -RemoteAddress x.x.x.0/24 -DisplayName "Trusted Subnet" -Direction inbound -Profile Any -Action Allow

Setup local user

$USERNAME = 'something'
$PASSWORD = 'something'
New-LocalUser -AccountNeverExpires -PasswordNeverExpires -Name $USERNAME -password ( $PASSWORD | ConvertTo-SecureString -AsPlainText -Force )
Add-LocalGroupMember -Group Administrators -Member $USERNAME

Share folders

New-SmbShare -name "Movies" -Path "E:\movies\" -CachingMode none -FullAccess "Users"
New-SmbShare -name "TV" -Path "F:\tv\" -CachingMode none -FullAccess "Users"
New-SmbShare -name "OLDTV" -Path "G:\tv\" -CachingMode none -FullAccess "Users"

Install nfs

Get-WindowsFeature | Where-Object { $_.Name -match 'NFS' }
Install-WindowsFeature FS-NFS-Service -IncludeManagementTools 
New-NfsShare -name "Movies" -path "E:\movies" -enableunmappedaccess $true -Permission readwrite -AllowRootAccess $true
New-NfsShare -name "TV" -path "F:\tv" -enableunmappedaccess $true -Permission readwrite -AllowRootAccess $true
#fix for bsod
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NfsServer\KBSwitch /v 769E60B7-C2FF-41B0-AD1F-14FC26F6F46B /t REG_DWORD /d 1 /f
# need to test KODI 

Install iscsi

Get-WindowsFeature *iscsi*
Install-WindowsFeature FS-iSCSITarger-Server -IncludeManagementTools
# will test this later

Install Chocolatey

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Install Packages

choco install git rsync nginx vim

Edit nginx

vi \tools\nginx-1.xx.x\conf\nginx.conf

  location / {
    root .\html;
    autoindex on;
    # testing
    dav_methods PUT DELETE MKCOL COPY MOVE;
    dav_ext_methods PROPFIND OPTIONS;
    dav_access user:rw  group:rw all:rw;
  }

  location /tv {
    alias E:\\tv;
    autoindex on;
  }
  location /movies {
    alias F:\\movies;
    autoindex on;
  }
  location /oldtv {
    alias g:\\tv;
    autoindex on;
  }

Set folder permissions

icacls e:\tv /grant SYSTEM:(OI)(CI)F /T
icacls f:\movies /grant SYSTEM:(OI)(CI)F /T
icacls g:\tv /grant SYSTEM:(OI)(CI)F /T

Resart nginx

nssm restart ngnx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment