Archive for the ‘Linux’ Category

when windows wipes teh MBR

I installed Windows XP Home on some leftover space on one of my CentOS OpenVZ machines that I use for development purposes. It is nice to have a ready to go system for when friends come over and we get to hankering for some LAN gaming. So install my Windows to the leftover space and of course it wipes the Master Boot Record. Bah! So I get out my CentOS install disk and type in “linux rescue” at the install prompt. From there I was kind of lost, so I searched around and found a short guide to restoring the GRUB boot loader. After that everything was smiles.

My process:

  1. Get a linux install disk and type “linux rescue” at the install prompt
  2. The rescue process should mount any of the found linux systems. (It did in my case.) The rescue process mounted my linux installation to “/mnt/sysimage“. I then chrooted into my system: “chroot /mnt/sysimag“.
  3. My main hard drive in said machine is named “hda”, so I reinstalled GRUB to /dev/hda with the command: “grub-install /dev/hda“. My original GRUB configuration was restored successfully.
  4. I then added the boot entry for the new Windows XP Home installation. I had installed it to the 3rd partition on the main hard drive so I added the following entry to my GRUB menu.lst file (/boot/grub/menu.lst).

    title Windows XP Home
    root (hd0,2)
    savedefault
    makeactive
    chainloader +1

    (hd0,2) = (the first hard drive, 3rd partition). Thus, (hd0,0) would be the first hard drive and first partition.

  5. Just remember to exit the chroot’ed shell before you reboot. Otherwise everything we just did goes to pot.

And everything was working spiffy after that.

TightVNC on Debian linux

Introduction
I have been wanting to run a Halo Custom Edition dedicated server on one of my OpenVZ nodes for quite some time, so this afternoon I finally started on a fun little bit of research. Running Halo (full featured edition or dedicated server) on Linux requires Wine, which if run headless over a network requires VNC. Virtual Network Computing (VNC) is a graphical desktop sharing system which uses the RFB protocol to remotely control another [wikipedia]. Unfortunately as I found out later, the Halo dedicated servers require some OpenGL stuffs (specifically an extension by the name of “GLX”). In an upcoming post I guess I’ll try again and get an install that will be able to run the Halo client/dedicated server on linux. Ah well, in any case I’ve now got a X-Window system set up. Now all that I will have to do is install KDE or Gnome. Although maybe next time I’ll go with xorg-server instead; from what I have read it has a much easier setup procedure and integrates various OpenGL drivers.

The following assumes that:

  1. you have a functioning Debian or Ubuntu – like system
  2. you are logged in as root or are capable or running “sudo” commands. add in “sudo” where necessary, typically on the apt-get commands.

 
 
Installation
Now that the basics are out of the way, it is time to install some dependencies for vnc.
apt-get install xutils xbase-clients xfonts-base xfonts-75dpi xfonts-100dpi xterm

What just happened: X11, required X11 fonts, and the X-Window terminal emulator just got installed. All that is left to do is install your vnc server of choice (I personally prefer TightVNC): apt-get install tightvncserver

Cool so everything should be ready to start-up properly. So start tightvncserver for the first time: tightvncserver :1 -geometry 1024x768 -depth 16. If all goes according to plan it should ask you to enter a password, this will be your login password via vnc for the account you are currently logged in through (root). You can always modify the screen resolution and depth commands to match whatever resolution and pixel depth you please. Login via a vnc client (I suggest TightVNC viewer), to check if you can login, then close the session and kill the vnc server: tightvncserver -kill :1. We have some customizations to do yet.

If you execute “cat .vnc/xstartup” in your terminal session, you should probably get something like the following outputted to your terminal session.

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 160×50+10+10 -ls -title “$VNCDESKTOP Desktop” &
x-window-manager &

This is the current start up script for your vnc server. Be sure to have the line starting with “x-terminal-emulator” in your start up script, because we will be needing terminal access via vnc to mess around with the Halo dedicated server. If you want to have your terminal window larger, modify that line accordingly (160×50+10+10 is plenty for me).

Now start the (tight)vncserver again and get into your cool graphical terminal session screen. For more information on VNC commands check out this article about vnc servers on the TWiki.

Conclusion
This setup is a great starting point. VNC and X-Window sessions are ready to go, and even will auto-restart after a power cycle. Unfortunately my goal of having a Halo dedicated server running on this setup, did not come to fruition. It requires some other dependencies and/or a completely different X-Window setup.

Counter Strike Debian linux server setup

Counter Strike server setup procedure on Debian linux – January 7th, 2008
Based upon – http://www.cstrike-planet.com/tutorial/1/5 – Props to whoever wrote it!
IT IS ADVISABLE TO RUN THE VARIOUS INSTALL PROCESSES AS ROOT! Edit: You can actually run all of these from a regular system user account.

handy tip – to measure current directory size: du -h

This setup procedure assumes that you (the installer) currently possess:

  1. knowledge of how to use a command line text editor in linux (vi, nano, etc.)
  2. knowledge of how to use apt-get or yum to install dependencies
  3. a preexisting linux installation, and root access on said box (you are able to login as “root”)

I’m doing this installation on a Debian Etch (4.0) minimal installation within a VPS. You do not necessarily have to install a separate Counter Strike dedicated server on a separate VPS. All you have to do is setup the Counter Strike dedicated server to run on different port/IP addresses. So let’s get going!

  1. Create an install directory and dl the installer
    • mkdir srcds (the directory for Counter Strike: Source dedicated server)
    • cd srcds
    • wget http://www.cstrike-planet.com/dls/hldsupdatetool.bin
  2. Make the installer executable and execute it
    • chmod +x hldsupdatetool.bin
    • ./hldsupdatetool.bin
  3. Agree to the terms and conditions by typing “yes” and “steam” will be created in the same directory
  4. Now run the steam installer that will dowload a new version of HLDSUpdateTool
    • just to be on the same side, why not make it executable (if it isn’t already) – chmod +x steam
    • run steam: ./steam – it took about 10 minutes for it to update. all depends upon the steam server loads.
  5. We are now ready to download and install Counter Strike Source. be sure the trailing dot stays in the command! It is there so that the install goes into the current directory.
    • ./steam -command update -game “Counter-Strike Source” -dir .
    • the install size is ~ 1.1GB uncompressed
  6. The server is now ready for various customizations. I’ll be writing more on that later …

Your Ad Here

This next installation method is for the Counter Strike 1.6 linux dedicated server
Based upon – http://www.cstrike-planet.com/tutorial/1-Linux-Install-CS-16/6

  1. Repeat steps 1-5 in previous installation but in different root directory. so instead of “srcds” let’s put the installation in “hlds”. Step 2 of the previous method should this time be:
    • mkdir hlds
    • cd hlds
  2. Run the various steps outlined above, and now to install the cstrike1.6 linux dedicated server.
    • ./steam -command update -game cstrike -dir .
    • the install is ~ 360MB

Q and A time
Q: How can I keep hlds running while I am not logged into the server with SSH?
A: Start your dedicated server with screen: screen -S hlds ./hlds_run . And then when you want to access the running server process once logged back in: screen -r hlds.

Q: How many CS virtual servers can I get on one machine?
A: see – http://www.webhostingtalk.com/showthread.php?t=743585

Q: What does the “tickrate” have anything to do with anything? What is it?
A: see – http://www.counter-strike.com/tickrate.php

Q: Where can I get cheap vps/dedicated server hosting to try this out on?
A: You could pick up a VPS from webkeepers.com or check out ThePlanet’s bargain bin: https://www.theplanet.com/servers/outlet.aspx.

Return top