Virtual Machine Setup

From ALFA
Revision as of 23:32, 27 June 2015 by Basilica (talk | contribs) (Add note about recompiling module if the module is very old.)
Jump to: navigation, search

This document describes in rough detail the recommended checklist for setting up a new game server host VM in the standard configuration. This configuration is suitable for running nwn2server.exe as a limited user account.

Prerequisites

Process

  1. Install Windows Server
  2. Copy standard tools over
  3. Create SG "NWN2 Servers"
  4. Create SG "NWN2 Admins"
  5. Create user "NWN2Server"
    1. Add to "NWN2 Servers" SG
  6. Create C:\NWN2, xcopy NWN2 install over
    1. Grant "NWN2 Servers" create files, create folders to "This folder only"
    2. Grant "NWN2 Admins" modify to folder, subfolders, and files
    3. Import NWN2.reg
  7. Create C:\NWN2User
    1. Grant full control to "NWN2 Servers"
    2. Grant modify/execute/list/read/write to "NWN2 Admins"
  8. Runas /profile /user:NWN2Server cmd.exe
    1. cd /d "%userprofile%\Documents"
    2. mklink /j "Neverwinter Nights 2" C:\NWN2User
    3. putty -ssh alfa@sql.alandfaraway.org
      1. Confirm and accept central server public key for vault tunnel to work
  9. Create C:\NWNX4, xcopy NWNX4 installation over
    1. Grant modify/execute/list/read/write to "NWN2 Admins"
    2. Grant modify/execute/list/read/write to "NWN2 Servers" for:
      1. AuroraServerNWScript.log
      2. AuroraServerVault.log
      3. nwnx.txt
      4. nwnx_controller.txt
      5. StandardQueryLog.txt
      6. xp_mysql.txt
      7. xp_bugfix.txt
      8. xp_objectattributes.txt
      9. xp_srvadmin.txt
      10. xp_system.txt
      11. xp_time.txt
  10. Create C:\Users\Public\Desktop\Credentials.txt
  11. Copy standard links to C:\Users\Public\Desktop
  12. Copy standard links to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Tools
  13. Copy standard scripts to C:\Scripts
  14. Copy standard NWN2 tools to C:\Tools
  15. Copy NWNServerConsole to C:\NWN2\Console
  16. Fix PowerShell signing
    1. Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Unrestricted -Force
  17. Install Git
  18. Install FileZilla
  19. Install Win8 Performance Toolkit
  20. Install 7-zip
  21. Install gvim
  22. Install WinDbg for Windows 7 or Windows 8.1.
  23. Set _NT_SYMBOL_PATH to SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols

NWNX4 Installation

  1. nwnx4_controller.exe -installservice
  2. Get SID for NWN2Server user with PowerShell:
([wmi]"win32_Group.Domain='$env:ComputerName',Name='NWN2 Admins'").sid
  1. Set SD on nwnx4-1 service to allow NWN2 Admins to start/stop:
sc sdset nwnx4-1 D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;RPWP;;;<NWN2 Admins SID from above command>)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
  1. Install SSH private key to C:\NWNX4\sshfs.ppk
  2. Add SSH public key to alfa@sql.alandfaraway.org:~/.ssh/authorized_keys
  3. Set configuration in C:\NWNX4\nwnx.ini
  4. Set configuration in C:\NWNX4\AuroraServerNWScript.ini
  5. Set configuration in C:\NWNX4\xp_mysql.ini
  6. Set configuration in C:\NWNX4\DatabaseConnector.ini
  7. Set configuration in C:\NWNX4\AuroraServerVault.ini

Module preparation

  1. If the module is being cloned directly from source control or copied from a very old backup, it may be necessary to recompile the module against a current alfa2_acr.hak to ensure that the database connection (and self-update) work at module startup. If the module never loads acr_databaseconnector in AuroraServerNWScript.log and no "DatabaseConnector" log messages in nwserverLog1.txt are seen before the ACR_OnModuleLoad: log line then this may be the problem (but also check for errors in AuroraServerNWScript.log that might indicate a misconfigured NWScript Accelerator installation).
  2. Make sure that alfa2_acr.hak is recent. An extremely old build predating the DatabaseConnector integration may not be able to self-update the rest of the ACR.