How-to -- Ubuntu + Wine + HL2: Orange Box


Results 1 to 1 of 1

Thread: How-to -- Ubuntu + Wine + HL2: Orange Box

  1. #1
    Join Date
    Jan 2003
    Location
    Austin, Texas
    Posts
    684

    How-to -- Ubuntu + Wine + HL2: Orange Box

    I recently installed Ubuntu on my desktop and I have to say I'm quite impressed. I have only ever had Ubuntu virtual machines in the past, and this is much nicer. But I got to work on trying to play Half-life2 and its mods on Linux. It's supposed to work so I wanted to try it.

    The following is how I got it to work on my system. I referenced several different websites when doing this and I can't take all of the credit. So at the end I have posted them as they contain more information than the tidbit I have here.

    Portal runs well in 1280x1024 with most of the options on high. The other games (which have larger, more open maps) tend to run better at 1024x768, with most of the options on high. I average about 30 fps in the large maps at 1280x1024. In Portal, at 1280x1024 I average about 55-60. I have found that running at 1024x768 does extremely well (about 40 fps on large maps with lots of people). Typically I just go with the lower fps though, and run full screen at 1280x1024. Lately I have noticed that even though the official FPS is lower, it still isn't laggy. Seems to be just as smooth and playable as 1024x768.

    Here are the specs of my system:

    CPU: AMD Athlon64 3800+
    Graphics: 1x nVidia GeForce 7600 GT (PCI-express)
    HDD: Sata II (3.0 Gpbs)
    RAM: 2GB PC3200 DDR
    Board: Asus A8N-SLI Deluxe


    Obviously, I am using the nVidia drivers on my system. I can't say much about the ATI drivers because I can't use them and therefore haven't tested them. If anyone else can post some info that would be great.

    In case you're wondering, I'm using Ubuntu 7.10 (Gutsy Gibbon) and Wine 0.9.58. You do NOT need to install the Tahoma font with Wine anymore (Wine includes a replacement font for Tahoma as of 0.9.47). However, see section 7 below.

    I assume that anyone following this guide is familiar with a Unix/Linux command prompt. The default location in Ubuntu 7.10 is under the Applications -> Accessories menu.


    1. Install the nVidia driver:
    I followed the steps here which say:
    1. If you plan to connect multiple monitors, start out by connecting only the main monitor in order to keep things simple. (Once you have the driver working fine for just that monitor, you can then connect the other monitors and use the nvidia-settings utility to configure them.)
    2. Now reset the X server configuration to very basic settings:

    sudo dpkg-reconfigure xserver-xorg

    You will be presented with a series of questions. Choose the default answers for all the questions except for the following:
    1. Choose "vesa" for the X server driver.
    2. Choose "No" for monitor autodection.
    3. Choose "medium" for the method for selecting the monitor characteristics.
    4. Choose "1024x768 @ 60Hz" for the monitor's best video mode. (Don't worry, we'll get better screen resolutions once we install and enable the nVidia driver.)
    5. Choose "Yes" for writing the monitor sync ranges to the config file.
    You can now optionally restart the Gnome Desktop Manager (GDM) for these settings to take effect before continuing. Alternatively, you can just continue the driver installation without restarting the GDM.
    3. Install and enable the nVidia driver:

    sudo apt-get install nvidia-glx-new
    sudo nvidia-glx-config enable

    Note: If you have a GeForce4 video card, you may need to use nvidia-glx instead of nvidia-glx-new. And if you have a very old card, like a TNT, you may need to use nvidia-glx-legacy instead.
    4. Reboot the computer for these settings to take effect. (In theory, you could just restart the Gnome Desktop Manager, but I ran into a situation where, after an error, the nVidia driver didn't seem to load upon restart the GDM.)
    5. Set up screen resolution, dual monitors, Xinerama, etc.:

    sudo nvidia-settings

    You can change the settings in the "X Server Display Configuration" section and then click the "Save to X Configuration" button and save the file as /etc/X11/xorg.conf.
    6. (optional) Disable the nVidia splash screen:

    sudo gedit /etc/X11/xorg.conf

    Change:

    Section "Device"
    ...
    Driver "nvidia"
    ...
    EndSection

    to:

    Section "Device"
    ...
    Driver "nvidia"
    ...
    Option "NoLogo" "true"
    EndSection

    7. (optional) Restart Gnome Desktop Manager for these settings to take effect.

    2. Install Wine:
    I followed the steps here which say:
    1. Add the Wine repository to your sources list:

    wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
    sudo wget http://wine.budgetdedicated.com/apt/...t.d/gutsy.list -O /etc/apt/sources.list.d/winehq.list
    sudo apt-get update

    2. Install Wine:

    sudo apt-get install wine

    3. To run a Windows program from the terminal:

    wine program.exe
    3. Install the Gecko plugin for Internet Explorer:
    Steam needs this to display HTML information in the Steam application. You just need to launch the iexplore.exe and have it load a webpage. The first time you attempt to launch it will prompt you to install Gecko. Open it from the command line like this:

    Code:
    wine iexplore http://winehq.org
    When the plugin has been installed and the page is loaded, you're all set. Close the browser window and continue.

    4. Copy the DVDs to your hard drive:
    I found this little nugget of information in one of the references below. It comes in handy in step 6 where I happened to need it because my installation hung when I first tried it without copying the disks. When attempting to install directly from the DVDs, the installer hung after I was prompted to insert disk 2. For some reason even though it mounted it, it was never able to read any of the contents of it. To be on the safe side, just copy their contents to your filesystem!

    This step is really as easy as it sounds:
    -Just create a new directory somewhere (your desktop maybe?) with a name such as "orangebox" or whatever you want.
    -Insert each DVD into the drive and copy the contents to the newly created folder. You can do this via dragging and dropping the icons in gnome, or use the terminal like this:

    Code:
    cp /media/cdrom/* /home/<username>/Desktop/orangebox
    5. Install and Update Steam:
    -Open a terminal.
    -change into the Desktop/orangebox directory and run the steam installer:

    Code:
    cd /home/<username>/Desktop/orangebox
    wine msiexec /i SteamInstall.msi
    -Now we need to start Steam and make sure it downloads all of the latest updates. Do this like so:

    Code:
    cd ~/.wine/drive_c/Program\ Files/Steam
    wine Steam.exe
    Note: If your Steam update hangs at 26&#37; or you get other strange errors (mine kept telling me multiple copies of Steam were running when they were not), then the first reference below has information on how to fix that.

    6. Install the games:
    This is a simple task. Once Steam is installed just open the directory /home/<username>/Desktop/orangebox and double click the setup.exe icon. I let it install all of the icons to my desktop (and moved them later). The games will auto-update as well. Once the installer has completed you may remove the /home/<username>/Desktop/orangebox directory. You can also remove all of the .lnk files it puts on your desktop! If you want to move the icons that launch each game, you may do so now. You may also download games directly from within Steam. This works fine, but note that it will take MUCH longer than just installing the games after copying them to your hard drive. Some games aren't provided on the DVDs though (for example, Lost Coast). You can download and install Lost Coast, Counter-Strike, whatever just like you would in Windows.

    7. Install the Lucida Console and Tahoma fonts (optional):
    Steam uses the font "Lucida Console" in the developer console (see your options -> Keyboard -> Advanced to enable the developer console). While it is possible to read most of the text, it is in general, very difficult. To get around this issue, simply install the correct font, lucon.ttf.

    You should be able to copy this from an existing Windows installation or download it from the internet. Place the lucon.ttf file in ~/.wine/drive_c/windows/Fonts and you're set!

    As of (I think) Wine 0.9.47 there is a replacement font for Tahoma. It does a good job mimicking Tahoma, but it isn't Tahoma and because of this, names in the server list will be difficult to read. If this happens to you too, simply download tahoma.ttf (or copy it from the C:\WINDOWS\Fonts directory of a Windows system) to ~/.wine/drive_c/windows/Fonts on your Linux system.


    8. Check your options:
    I still had problems once I got here. I was able to launch the applications but the frame rate was HORRIBLE. Attempting to open the options menu took roughly 30 seconds and the audio lagged the whole time while I was waiting. A combination of 2 options saved me. One option forces DirectX 8.1 instead of DirectX 9.0. The other increases the size of the heap (dynamic memory used by the application).

    If you right-click on one of the icons and go to the properties, you'll see the games are launched by strings such as this one for Team Fortress 2:

    env WINEPREFIX="/home/<username>/.wine" wine "C:\Program Files\Steam\steam.exe" -applaunch 440
    I added in the two options per the Steam link in the references. I also added in automatic login options for Steam so my full command looks like this:

    env WINEPREFIX="/home/<username>/.wine" wine "C:\Program Files\Steam\steam.exe" -login %user% %pw% -applaunch 440 -heapsize 1048576 -dxlevel 81
    Obviously, substitute your SteamID and password in for the %user% and %pw% above. You can find a full list of the applaunch numbers in another Steam link below.

    Recently I have found that you can set these options without needing to create desktop icons. With your main Steam window open, just right-click on the game you wish to set options for and click "Preferences" (or click the Preferences button on the bottom-right of the Steam window). Next click the button to "Set Launch Options" and then enter in the options you wish to use (for example, -novid -heapsize 1048576 -dxlevel 81).

    Your system may or may not need to be set to a lower DirectX level. Try the heapsize variable first. If that still is not satisfactory, then set the dxlevel lower (options are 90, 81, 80, and 70). heapsize made the most difference for me however.

    Note: If you have less RAM then you need to decrease the heapsize variable. I have 2GB, so I chose to dedicate 1GB to the game. If you want to dedicate 512MB just divide the number I have there in half. I tried making my heapsize 2GB and TF2 would hang when sending client info to a server. I just decided to drop it back to 1GB and be done with it. 1GB is plenty.

    Now go enjoy The Orange Box...Linux style!



    References:
    http://appdb.winehq.org/objectManage...estingId=21632
    http://news.softpedia.com/news/How-T...tu-74731.shtml
    http://www.linux-gamers.net/modules/...=howto%20steam
    http://www.fsckin.com/2007/10/15/how...tu-using-wine/
    http://developer.valvesoftware.com/wiki/Applaunch_IDs
    http://developer.valvesoftware.com/w...d_Line_Options
    http://www.funnestra.org/ubuntu/gutsy/
    Last edited by gamblor01; 04-28-2009 at 11:13 AM.
    "The author of that poem is either Homer or, if not Homer, somebody else of the same name."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •