If you prefer to use Ubuntu Linux over Windows but you still have some Windows programs that have no equivalent in Linux, there is a way to run some Windows programs in your Linux environment.

Wine is a compatibility layer that allows you, in theory, to run some applications written for Windows on a Unix-like system. However, some applications may require tweaking to get them to run correctly. Wine is easy to install and runs fine on Ubuntu 10.04 Lucid Lynx.

To find out which programs run in Wine, refer to the Wine Application Database, found at http://appdb.winehq.org/. There are different levels of ratings indicating how well each program in the database behaves in Wine.

For this example, we are going to install 7-Zip in Wine. 7-Zip is a very good free compression utility and file manager for Windows. It has a Platinum rating, which means it installs and runs flawlessly on a standard, default Wine installation, with no tweaking required.

To install Wine, open a terminal window by selecting Accessories | Terminal from the Applications menu.

Opening a terminal window

Enter the following command:

$ sudo apt-get install wine

Entering the command to install Wine

Enter your password to authenticate, and Wine starts to find what it needs. A message telling you the size of the installation displays and you are asked if you want to continue. If you have enough disk space and want to continue the installation, type a ‘Y’ (case does not matter) and press Enter. It might take a while to install depending upon your connection speed.

Continuing the Wine installation

The progress of the installation displays in the terminal window.

Wine installation progress

When the installation is finished, you are returned to a prompt. Type ‘exit’ and press Enter to close the terminal window.

Closing the terminal window

There is now a new Wine category added to your Applications menu on your desktop. The Wine category has four subcategories:

  • Programs lets you browse the Windows programs installed in Wine programs on your system.
  • Browse C: Drive lets you browse the C: drive structure Wine emulates for Windows programs.
  • Configure Wine lets you tweak settings for Wine itself and for the Windows programs installed in Wine.
  • Uninstall Wine Software lets you remove Windows programs installed in Wine. An Add/Remove Programs dialog box displays that also allows you to install Windows programs.

Wine program categories

We downloaded the executable, installation file for 7-Zip into a 7zip directory in the Downloads directory. Before installing a program in Wine, you must first make sure the installation file has executable permission. To do this, open the File Browser using the Places menu and navigate to the directory into which you downloaded 7-Zip, if necessary.

Opening the File Browser

Right-click on the 7-Zip executable file and select Properties from the pop-up menu.

Getting the properties of the 7-Zip executable file

Click the Permissions tab on the Properties dialog box, and make sure the Allow executing file as program check box is checked.

Turning on the Allow executing file as program check box

Click the Close button.

Closing the Properties dialog box

There are two different methods for starting an installation of a Windows program in Wine. The first method is to right-click on the executable installation file and select Open with Wine Windows Program Loader from the pop-up menu.

Opening the 7-Zip executable with the Wine Windows Program Loader

The second method is to open the Wine Uninstaller by selecting Wine | Uninstall Wine Software from the Applications menu. This may seem misleading, but the option also allows you to install software.

Running the Wine Uninstaller

NOTE: The first time you perform any action in Wine, the following dialog box displays.

Wine configuration being updated

If you opened the Wine Uninstaller, the Add/Remove Programs dialog box displays. Click the Install button.

Add/Remove Programs dialog box in Wine

On the secondary Add/Remove Programs dialog box that displays, navigate to the directory containing the 7-Zip executable file, select it and click Open.

Selecting the 7-Zip executable file

Both methods of starting an installation of a Windows program results in the first screen of the Setup Wizard displaying. Follow the instructions in the installation program, the same way you would in Windows. For our example of installing 7-Zip, accept the default installation location on the first screen and click Install.

7-Zip Setup dialog box

When the 7-Zip installation is finished, the dialog box informs you. Click the Finish button to close the setup wizard.

7-Zip installation finished

If you installed 7-Zip using the Add/Remove Programs dialog box, you are returned to the dialog box. Click OK to close it.

NOTE: The list of software on the Add/Remove Programs dialog box that can be automatically removed is not automatically updated even though you just installed a program. To populate the list of installed software, you must close the dialog and reopen it.

Closing

Programs installed in Wine generally reside in the ~/.wine/drive_c/Program Files/ directory, unless you chose a different location during the installation. You will notice that 7-Zip was installed into a 7-Zip directory in the Program Files directory, just like it would be in Windows.

15_location_of_7zip_installed_in_wine

One feature that is not available in 7-Zip running in Wine, is the integration with the File Browser. You cannot zip files by right-clicking on them in the File Browser. To zip one or more files, select 7-Zip File Manager under Wine | Programs | 7-Zip on the Applications menu.

7-Zip on Wine submenu

In the 7-Zip File Manager, navigate to the file(s) you want to zip, select them, and select 7-Zip | Add to “filename.zip” from the pop-up menu. A name for the zip file is suggested depending on the directory you are currently in.

17_add_to_a_zip_file

The zip file is created in the current directory.

Zip file created

To close the 7-Zip File Manager, select Exit from the File menu.

Closing 7-Zip

Wine provides an uninstaller for uninstalling Windows programs installed using a .exe file.

NOTE: The Wine uninstaller does not work with programs installed using an .msi file.

To uninstall 7-Zip, select Wine | Uninstall Wine Software from the Applications menu.

Uninstalling 7-Zip from the menu

You can also uninstall a program in Wine by navigating to the program’s directory in the ~/.wine/drive_c/Program Files/ directory (~ stands for the Home directory) and right-clicking on the uninstall executable file, if there is one, and selecting Open with Wine Windows Program Loader from the pop-up menu. In the case of 7-Zip, there is a file called Uninstall.exe.

Uninstalling 7-Zip using the executable uninstall file

Using either method for starting to uninstall a program in Wine, opens the Add/Remove Programs dialog box. 7-Zip displays in the list of software that can be automatically removed. Select the 7-Zip file and click the Modify/Remove button.

Uninstalling 7-Zip on the Add/Remove Programs dialog box

The 7-Zip Uninstall dialog box displays. Click the Uninstall button.

7-Zip Uninstall dialog box

You can tweak settings for both individual programs within Wine and for Wine itself. To change settings, select Wine | Configure Wine from the Applications menu.

Configure Wine option

The Wine configuration dialog box displays. Click the different tabs to change the various settings available.

Wine configuration dialog box

If you want to browse Wine’s C: drive the same way you would in Windows, select Wine | Browse C: Drive from the Applications menu.

Browse C: Drive option

The File Browser opens to the ~/.wine/dosdevices/c: directory.

Browsing the C: drive in the File Browser

A lot of the applications that work well in Wine are games, but there are other types of programs that are in the Platinum rating list, such as several Adobe programs and Amazon Kindle for the PC. Again, browse the Wine Application Database (http://appdb.winehq.org/) to see what programs work in Wine and how well they work.

For more information about using and configuring Wine, see the documentation at http://www.winehq.org/documentation.

by Lori Kaufman