Difference between revisions of "Virtual Machine Setup"
From ALFA
(→Process) |
(→Process) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 15: | Line 15: | ||
# Copy standard tools over: | # Copy standard tools over: | ||
## [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html putty] | ## [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html putty] | ||
− | # Create | + | # Create Security Group "NWN2 Servers" (if using Windows Server) |
− | # Create | + | # Create Security Group "NWN2 Admins" (if using Windows Server) |
# Create user "NWN2Server" | # Create user "NWN2Server" | ||
## Add to "NWN2 Servers" SG (if using Windows Server) | ## Add to "NWN2 Servers" SG (if using Windows Server) | ||
Line 29: | Line 29: | ||
## <code>cd /d "%userprofile%\Documents"</code> | ## <code>cd /d "%userprofile%\Documents"</code> | ||
## <code>mklink /j "Neverwinter Nights 2" C:\NWN2User</code> | ## <code>mklink /j "Neverwinter Nights 2" C:\NWN2User</code> | ||
− | ## <code>putty -ssh alfa@sql.alandfaraway. | + | ## <code>putty -ssh alfa@sql.alandfaraway.info</code> |
### Confirm and accept central server public key for vault tunnel to work | ### Confirm and accept central server public key for vault tunnel to work | ||
− | # Create C:\NWNX4, xcopy NWNX4 installation over | + | # Create C:\NWNX4, xcopy NWNX4 installation over (or just simply install it) |
## Grant modify/execute/list/read/write to "NWN2 Admins" (if using Windows Server) | ## Grant modify/execute/list/read/write to "NWN2 Admins" (if using Windows Server) | ||
## Grant modify/execute/list/read/write to "NWN2 Servers" for: (if using Windows Server) | ## Grant modify/execute/list/read/write to "NWN2 Servers" for: (if using Windows Server) | ||
Line 53: | Line 53: | ||
# Fix PowerShell signing | # Fix PowerShell signing | ||
## Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Unrestricted -Force | ## Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Unrestricted -Force | ||
− | # Install [http://git-scm.com/ Git] | + | # Install [http://git-scm.com/ Git] You need this to get module updates |
− | # Install [https://filezilla-project.org/ FileZilla] | + | # Install [https://filezilla-project.org/ FileZilla] ( Optional depending on your needs) |
− | # Install [http://msdn.microsoft.com/en-us/windows/apps/br229516 Win8 Performance Toolkit] | + | # Install [http://msdn.microsoft.com/en-us/windows/apps/br229516 Win8 Performance Toolkit] or [https://docs.microsoft.com/en-us/windows-hardware/test/wpt/ Windows 10 Performance Toolkit] (Optional depending on your needs) |
− | # Install [http://www.7-zip.org/ 7-zip] | + | # Install [http://www.7-zip.org/ 7-zip] You need this to be able to unpack the haks when they are downloaded to the server for updates |
− | # Install [http://gvim.en.softonic.com/ gvim] | + | # Install [http://gvim.en.softonic.com/ gvim] ( Optional depending on your needs) |
− | # Install WinDbg for [http://www.microsoft.com/en-us/download/details.aspx?id=8279 Windows 7] or [http://msdn.microsoft.com/en-US/windows/desktop/bg162891 Windows 8.1]. | + | # Install WinDbg for [http://www.microsoft.com/en-us/download/details.aspx?id=8279 Windows 7] or [http://msdn.microsoft.com/en-US/windows/desktop/bg162891 Windows 8.1] or [https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools Windows 10]. ( Optional depending on your needs) |
− | # Set <code>_NT_SYMBOL_PATH</code> to <code>SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols</code> | + | # Set <code>_NT_SYMBOL_PATH</code> environment variable to <code>SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols</code> ( Optional depending on your needs) |
== NWNX4 Installation == | == NWNX4 Installation == | ||
# nwnx4_controller.exe -installservice | # nwnx4_controller.exe -installservice | ||
− | # Configure NWNX4-1 service to run as the "NWN2Server" user | + | # Configure NWNX4-1 service to run as the "NWN2Server" user: |
## If using a Microsoft account (user@email) for the server user, use Computername\Username where Username is the value that %USERNAME% shows from "echo %USERNAME%" in cmd.exe and Computername is the value that %COMPUTERNAME% shows from "echo %COMPUTERNAME%" in cmd.exe. Also, in this case, you have to manually grant this user "Log on as a service" rights by going to Local Security Policy, Local Policies, User Rights Assignment, Log on as a service, and adding Computername\Username to the list. This only applies to accounts set up as a Microsoft account initially, not to local accounts that a Microsoft account was connected to afterwards. | ## If using a Microsoft account (user@email) for the server user, use Computername\Username where Username is the value that %USERNAME% shows from "echo %USERNAME%" in cmd.exe and Computername is the value that %COMPUTERNAME% shows from "echo %COMPUTERNAME%" in cmd.exe. Also, in this case, you have to manually grant this user "Log on as a service" rights by going to Local Security Policy, Local Policies, User Rights Assignment, Log on as a service, and adding Computername\Username to the list. This only applies to accounts set up as a Microsoft account initially, not to local accounts that a Microsoft account was connected to afterwards. | ||
# Get SID for NWN2Server user with PowerShell: (if using Windows Server) | # Get SID for NWN2Server user with PowerShell: (if using Windows Server) |
Latest revision as of 17:24, 20 October 2024
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
.NET 3.5 and the DirectX End-User Runtime are optional unless the toolset will be run locally on the game server host machine.
- If running the toolset on the host is desired (optional), enable .NET 3.5 in Add/Remove Windows Features before installing DirectX
- DirectX End-User Runtime (required only if the toolset will be used to stage content on the game server)
- Microsoft .NET Framework 4
- Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update
- Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package MFC Security Update
Process
- Install Windows Server (or Windows 10)
- Copy standard tools over:
- Create Security Group "NWN2 Servers" (if using Windows Server)
- Create Security Group "NWN2 Admins" (if using Windows Server)
- Create user "NWN2Server"
- Add to "NWN2 Servers" SG (if using Windows Server)
- Create C:\NWN2, xcopy NWN2 install over (or just install NWN2)
- Grant "NWN2 Servers" create files, create folders to "This folder only" (if using Windows Server)
- Grant "NWN2 Admins" modify to folder, subfolders, and files (if using Windows Server)
- Import NWN2.reg (only if not installing NWN2)
- Create C:\NWN2User
- Grant full control to "NWN2 Servers" (if using Windows Server)
- Grant modify/execute/list/read/write to "NWN2 Admins" (if using Windows Server)
- Run this in a command window:
Runas /profile /user:NWN2Server cmd.exe
(or log in as the NWN2Server user and open up a command window)-
cd /d "%userprofile%\Documents"
-
mklink /j "Neverwinter Nights 2" C:\NWN2User
-
putty -ssh alfa@sql.alandfaraway.info
- Confirm and accept central server public key for vault tunnel to work
-
- Create C:\NWNX4, xcopy NWNX4 installation over (or just simply install it)
- Grant modify/execute/list/read/write to "NWN2 Admins" (if using Windows Server)
- Grant modify/execute/list/read/write to "NWN2 Servers" for: (if using Windows Server)
- AuroraServerNWScript.log
- AuroraServerVault.log
- nwnx.txt
- nwnx_controller.txt
- StandardQueryLog.txt
- xp_mysql.txt
- xp_bugfix.txt
- xp_objectattributes.txt
- xp_srvadmin.txt
- xp_system.txt
- xp_time.txt
- Create C:\Users\Public\Desktop\Credentials.txt
- Copy standard links to C:\Users\Public\Desktop
- Copy standard links to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Tools
- Copy standard scripts to C:\Scripts
- Copy standard NWN2 tools to C:\Tools
- Copy NWNServerConsole to C:\NWN2\Console
- Fix PowerShell signing
- Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Unrestricted -Force
- Install Git You need this to get module updates
- Install FileZilla ( Optional depending on your needs)
- Install Win8 Performance Toolkit or Windows 10 Performance Toolkit (Optional depending on your needs)
- Install 7-zip You need this to be able to unpack the haks when they are downloaded to the server for updates
- Install gvim ( Optional depending on your needs)
- Install WinDbg for Windows 7 or Windows 8.1 or Windows 10. ( Optional depending on your needs)
- Set
_NT_SYMBOL_PATH
environment variable toSRV*C:\Symbols*http://msdl.microsoft.com/download/symbols
( Optional depending on your needs)
NWNX4 Installation
- nwnx4_controller.exe -installservice
- Configure NWNX4-1 service to run as the "NWN2Server" user:
- If using a Microsoft account (user@email) for the server user, use Computername\Username where Username is the value that %USERNAME% shows from "echo %USERNAME%" in cmd.exe and Computername is the value that %COMPUTERNAME% shows from "echo %COMPUTERNAME%" in cmd.exe. Also, in this case, you have to manually grant this user "Log on as a service" rights by going to Local Security Policy, Local Policies, User Rights Assignment, Log on as a service, and adding Computername\Username to the list. This only applies to accounts set up as a Microsoft account initially, not to local accounts that a Microsoft account was connected to afterwards.
- Get SID for NWN2Server user with PowerShell: (if using Windows Server)
-
([wmi]"win32_Group.Domain='$env:ComputerName',Name='NWN2 Admins'").sid
-
- Set SD on nwnx4-1 service to allow NWN2 Admins to start/stop: (if using Windows Server)
-
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)
-
- Install SSH private key to C:\NWNX4\sshfs.ppk
- Add SSH public key to alfa@sql.alandfaraway.org:~/.ssh/authorized_keys
- Set configuration in C:\NWNX4\nwnx.ini
- Set configuration in C:\NWNX4\AuroraServerNWScript.ini
- Set configuration in C:\NWNX4\xp_mysql.ini
- Set configuration in C:\NWNX4\DatabaseConnector.ini
- Set configuration in C:\NWNX4\AuroraServerVault.ini
Module preparation
- 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).
- 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.
Troubleshooting
Fixes for some problems encountered during server deployment are listed here.
- Module didn't load or server doesn't start up?
- Look at the server log file and C:\NWNX4\AuroraServerNWScript.log for errors/exceptions for next troubleshooting steps.
- Database doesn't connect, or many exceptions in server log about the database, or PCs (but not DM's) are booted at log on?
- Make sure that plink.exe was run once as the user that the NWNX4-1 service runs as in order to accept the SSH key of the central server.
- Monitor Server Uptime script closes immediately?
- Make sure that the following command was run from an administrator privileged PowerShell session: Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Unrestricted -Force
- Game server starts with NWNX4_GUI.exe but not as a service?
- Make sure that the service is running as the right user. Go to services.msc and configure it to run as the user whose %userprofile%\Documents\Neverwinter Nights 2 has the module, server vault, etc. present.
- Toolset doesn't start/work properly?
- Make sure that .NET Framework v3.5 (sometimes called .NET Framework v2.0) is installed, and then the DirectX End-User Runtime is installed. If the DirectX End-User Runtime was installed first, it's installer has to be re-run after installing .NET Framework v3.5.
- Database or scripts don't work, or NWNX4 plugins didn't load?
- Make sure that all Visual C++ and .NET runtime dependencies were installed.
- Make sure that NWNScriptJIT.dll, NWNScriptJITIntrinsics.dll are installed in the NWN2 installation directory (not necessarily the NWNX4 installation directory).
- Make sure that plink.exe was run once as the service user (see above).
- Using a Microsoft account for the service account and the service fails to start with "The service dependency failed to start."?
- Configure the service to log on using Computername\Username and ensure that from Local Security Policy, Local Policies, User Rights Assignment, that Computername\Username was granted "Log on as a service" rights.