Playing Portal 2 under Ubuntu

Last week I found out that Portal 2 was on sale for just $10.20 through Steam. I had played the first game through Steam under Ubuntu so I knew it was possible. But since then I did a clean install of Oneiric Ocelot 11.10 (the newest version of Ubuntu) and needed to start from scratch again. Here’s how I got it running.

Install Wine

You need the Windows Emulator for Linux (Wine) to use Steam. This is easy enough:

sudo apt-get install wine

Install Steam

Steam’s not hard to get running either. Just go to their page and download the Windows installer. I downloaded it to my Desktop, then right-clicked and chose to open it with the Wine program launcher. Follow the prompts, and please do have it make desktop icons for you (this happens by default), we’re going to use those later.

Buy and Download the Game

You should now be able to load the Steam application and use it to purchase Portal 2. You’ll need to have an account with Steam, etc. FYI- this application runs extremely slowly on my machine. Don’t fret, the game runs much better. But you will need to put up with this through the purchase and download phase. The game is over 10 gigs so start the download and go do something else.

Making it work on Ubuntu

Now you can try launching the game from Steam once it downloads, but this didn’t work for me. I couldn’t even get the game window to open. But never fear, there’s always something to be learned at the WineDB. There’s a lot to wade through at that link, but I managed to get my copy up and running with two simple changes.

  1. Edit the Portal 2 link on your desktop to launch the game directly, in windowed mode, by changing the command to this: wine .wine/drive_c/Program\ Files/Steam/steamapps/common/portal\ 2/portal2.exe -window -w 1024 -h 768 -dxlevel 81
  2. Use winetricks to make sure your sound is set to alsa (only if you’re having sound problems with the game). Rather than me rehashing that process, just follow this guide.

How to start playing the game

You need to have Steam running before you launch Portal. There should be a Steam icon on your desktop. If you double-click it, Steam will launch. You should be able to close the main window and sill have the little icon on your top panel that tells you Steam is still running. Now just double-click the Portal 2 icon and enjoy!

The game is fully playable for me. But sometimes it does crash Unity when I exit the game. This doesn’t seem to have an adverse affect on my machine. All process keep running, I’m just kicked out to the login screen after about 20 seconds of scrambled images on my monitor.