I know this is an old post but I have TWGS successfully running on Ubuntu Server through wine. It works great. You can also using an isolated TWGS and run it with it's own user with a remote VNC session for headless administration.
If you are using straight Ubuntu simply install wine and then TWGS and your good to go. Just note that you can't get TWGS to run on port 22. That port is reserved for the root user and if you're smart you wont let TWGS run as root
To get TWGS to bind to a port simply use port 2002 or higher.
Here's how to install TWGS on Ubuntu Server (Hardy or Intrepid) running as it's own user in a VNC session for remote administration in case anyone is curious (as well as to keep a record of these instructions for myself as it took a long time of reading forum posts and how-to's to piece this all together):
1) Install Ubuntu Server and make sure the Universe and Multiverse repositories are active.
2) Install nano (if you want to copy/paste these instructions.. Otherwise use VI)
Code:
sudo apt-get install nano
3) Open the termnial and Install gnome-core and GDM (needed for wine and VNC)
Code:
sudo apt-get install gnome-core gdm
4) Install VNC4Server and Xinetd
Code:
sudo apt-get install vnc4server xinetd
5a) Set GDM permissions for remote VNC
Code:
sudo nano /etc/gdm/gdm.conf-custom
5b) Change [security] and [xdmcp] sections to the following:
Code:
[security]
DisallowTCP=false
[xdmcp]
Enable=true
6) Set root vnc password (used for GDM session which is only needed to install the software)
Code:
sudo vncpasswd /root/.vncpasswd
7) Create a new file Xvnc to add the vnc service to xinetd
Code:
sudo nano /etc/xinetd.d/Xvnc
Paste these contents into the file
Code:
service Xvnc
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc
server_args = -inetd :1 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5901
}
9) Create user "tradewars"
Code:
sudo adduser tradewars
10) Add key for wine repository
Code:
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
11) Add Wine Repository
Code:
For Ubuntu Intrepid (8.10):
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/intrepid.list -O /etc/apt/sources.list.d/winehq.list
For Ubuntu Hardy (8.04):
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/hardy.list -O /etc/apt/sources.list.d/winehq.list
For Debian Etch (4.0):
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/etch.list -O /etc/apt/sources.list.d/winehq.list
12) Update package information
13) Install Wine
Code:
sudo apt-get install wine
14) Reboot the server (needed to reset GDM permissions, DO NOT SKIP THIS STEP)
Code:
sudo shutdown -r now
15) You should now have a working VNC session and everything you need to install TWGS. Next you need to load up your vncviewer. If your remote machine is runing Ubuntu run the following on the remote machine NOT THE SERVER:
Code:
vnc4viewer -via serveruser@myhost.com localhost:1
This will create an SSH tunnel to the VNC session running on the server.
Please Note that "serveruser" is the user account on the server machine. "myhost.com" is your servers domain name or IP address.
16) Once you see the GDM login screen make sure to set your session to Gnome and login as user "tradewars"
17) Open a terminal window in the VNC session and Download TWGS
Code:
wget http://www.eisonline.com/twgs/beta/TWGS10300.EXE
18) Install TWGS
19) Once installed it's time to setup a special VNC session for tradewars. To do that we need to create startup files and a VNC password for user "tradewars"
20) We don't need this default session so we'll go ahead and kill new vnc session
21)edit the Xstartup file so we can launch TWGS when the VNC session loads
Code:
nano /home/tradewars/.vnc/xstartup
22) replace this file with the following:
Code:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid black
vncconfig -iconic &
twm &
exec /usr/bin/wine "C:\Program Files\Epic Interactive Strategy\TWGS\twgs.exe"
23) Logout and close the VNC viewer
24) SSH back into the server using a normal user
25) Because this is a headless server we need a way to start a VNC session to startup the TWGS. To do that we are need to create a new file in /etc/init.d
Code:
sudo nano /etc/init.d/vnc.sh
26) Copy and Paste the following script into this new file
Code:
#!/bin/sh
#
# Startup/Stop script for vncservers for some users.
#
case "$1" in
'start')
/bin/su - tradewars -c "/usr/bin/vnc4server :2"
;;
'stop')
/bin/su - tradewars -c "/usr/bin/vnc4server -kill :2"
;;
*)
echo "Usage: /etc/init.d/vnc.sh { start | stop }"
;;
esac
27) Make this script executable
Code:
sudo chmod 755 /etc/init.d/vnc.sh
28) Double check your run level. It should be set at two but some webservers do screwy things with the OS
You should something like this:
29) You need to remember the last number in the list. In this case it's 2. So on that note I would switch to /etc/rc2.d to add an entry. If your at runlevel 3 then you would want to use /etc/rc3.d. Using a runlevel of 2 we'll need to create a new symlink in rc2.d
Code:
ln -s /etc/init.d/vnc.sh /etc/rc2.d/S99vnc
30) Now we want to make sure it all comes up at boot time so we'll boot the server
Code:
sudo shutdown -r now
If all went well your new TWGS game server should now be online and you can access it using VNC at mysite.com:2
All that's left now is to empty out the contents of /etc/xinetd.d/Xvnc as this session was only needed to install TWGS and GDM and Gnome take up alot of resources. Finally start adding games and configuring TWGS to your liking
Enjoy,
LaChild