How to compile and install Wine safely as a separate user

Have you ever thought about a Windows virus being run under Linux using Wine? Well, there's a chance this happens and you probably don't want to risk it!

In this tutorial, you will see how to compile and install wine as another/separate user and only that user can run Wine. So, YOU choose when wine should be running, this avoids viruses being run by other applications without your permission. Of course, this is not "bullet-proof" but this is one more security.

First you need to install 'sux', it's like 'su' but it passes your Xorg credentials so that you can open GUI applications too. (See sux's manual page for more information about it.):

sudo apt-get install sux

We add the user and log in with it using sux:

sudo adduser wineuser
sux wineuser

We create the install directory:

mkdir ~/wine

Download wine's tarball:

cd ~
wget http://prdownloads.sourceforge.net/wine/wine-1.1.14.tar.bz2 # or latest...

Extract the tarball and cd into it:

tar xf wine-1.1.14.tar.bz2
cd wine-1.1.14/

And we compile:

./configure --prefix=/home/wineuser/wine
make depend
make # or for dual cores: make -j 2
make install

[ad]
We change chmod's so nobody else can access it:

chmod -R go-rwx ~/wine/*

Add /home/wineuser/wine to your PATH variable like this (in your .bashrc):

export PATH=$PATH:/home/wineuser/wine/bin

Then, to log in under wineuser and use wine you can do, for example:

sux wineuser
wine notepad

And you have a secure installation of wine, only accessible through the wineuser user!

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: