Estou procurando uma instrução passo a passo para me guiar nas maneiras de instalar, configurar e depurar muitos dos problemas que novos usuários têm ao lidar com o Wine no Ubuntu.
Qual é a maneira recomendada de instalar o Wine, alguns dos principais problemas que ele apresenta e como resolvê-los?
Se eu tiver um problema específico com um aplicativo no Wine, como faço para resolvê-lo? Quais são as etapas recomendadas para garantir que posso corrigir um problema relacionado a um aplicativo que desejo usar?
Se você quiser usar a versão de desenvolvimento/ensaio mais recente do Wine, certifique-se de seguir o guia no Guia Oficial do WineHQ para Ubuntu , basicamente cobrindo:
Se você estiver usando uma arquitetura de 64 bits, habilite 32 bits para melhor compatibilidade
Adicione a chave do vinho, o repositório do vinho e os repositórios de atualização
Nós adicionaríamos o repositório assim (
lsb_release -sc
buscará automaticamente o codinome ):Em seguida, instale a versão do Wine que você deseja usar:
Com base no desenvolvimento do vinho (estável) (por exemplo: 4.0)
Com base no desenvolvimento do vinho (estágio de teste) (por exemplo: 4.1)
Baseado no Wine-Staging (Bleeding Edge) (por exemplo: 4.1.1)
Última execução
no terminal para garantir que ele configure o Wine corretamente (nessa ordem). Você também precisará instalar
winetricks
(outro pacote de configuração, muito útil para instalar componentes do Windows como .NET Framework e outras bibliotecas necessárias). Então, depois disso, faça:Demonstração em vídeo mostrando o Wine 1.9.X em ação - Desempenho do Wine 1.9.X
1. Diferenças entre as versões Wine Stable, Development & Staging
Versões estáveis oferecem menos bugs com melhor estabilidade e recebem atualizações a cada 3-6 meses após o lançamento.
A versão de desenvolvimento é a próxima versão estável em desenvolvimento e recebe atualizações a cada 2 semanas.
A versão de teste é a mesma que a versão de desenvolvimento, mas inclui todos os patches e aprimoramentos do Wine-Staging
A decisão de ficar com a versão estável (versões de número par: 1.0, 1.2, 1.4...) ou com as versões instáveis (versões de número ímpar: 1.1, 1.3, 1.5...) fica a critério do usuário, a principal diferença é compatibilidade e desempenho que são aprimorados na versão de desenvolvimento. Você obtém as correções mais recentes que ele oferece e também se torna um testador que pode ajudar no ciclo de desenvolvimento.
2. Instalando a versão recomendada do Stable Wine (do PPA)
No terminal, digite o seguinte para adicionar o Wine PPA, atualizar os repositórios e instalar a versão mais recente do Wine & Winetricks:
ou você pode incluir o Wine 32-Bit Arch (melhor suporte) e configurar o winecfg (isso só deve ser aplicado a novas instalações, pois moverá a instalação existente do Wine para uma pasta chamada winebck):
3. Como saber quais componentes um aplicativo precisa
Para descobrir quais componentes um aplicativo precisa, procure no Wine Application Database . Ele lista se o aplicativo é utilizável, quais componentes ele precisa e como instalá-los.
4. Como instalar componentes adicionais, DLLS e bibliotecas no Wine
Para ter um ambiente Wine funcionando e aprimorado para seus jogos e aplicativos, sugiro que você
winetricks
instale componentes adicionais que ofereçam melhor compatibilidade com jogos. Para ter um sistema de trabalho melhor, faça o seguinte aqui é um exemplo para HL/HL2 (Não-Steam. Para a versão Steam, vá aqui: Como posso instalar o Steam? . Saiba que Half-Life e HL2 são suportados nativamente no Ubuntu):Para jogar HL/HL2 você precisa do Wine PPA como mencionado acima. Depois de abrir
winecfg
pelo menos uma vez no terminal, abrawinetricks
executandowinetricks --gui
e siga estas etapas:Selecione Selecione o wineprefix padrão
Selecione Instalar uma DLL ou componente do Windows
Instale tudo o que marquei (e qualquer adicional que você precisar). Isso abrange muitos aplicativos:
Clique com o botão direito do mouse no instalador do HL/HL2 e selecione Abrir com Wine . Ambos os jogos devem funcionar perfeitamente. Isso se aplica a aplicativos em geral e, dependendo do aplicativo, você precisará instalar mais ou menos componentes.
Você também pode instalar cada componente no terminal adicionando o nome do componente após o
winetricks
comando:winetricks vcrun2010
- Irá instalar o vcrun2010 usando winetrickswinetricks xna40
- Irá instalar o xna405. Solucionando problemas de um aplicativo Wine
Às vezes, ao executar um aplicativo, uma ou várias das seguintes ações podem ocorrer:
DLL, placa de vídeo ou componente não reconhecido
Para a maioria destes problemas existem soluções. Aqui estão as etapas recomendadas para você começar a solucionar problemas em um aplicativo Wine:
Sempre visite o site do aplicativo Wine para ver o que outros testadores fizeram para que o aplicativo funcione. Por exemplo, aqui estou eu testando Dead Island: Riptide , ao qual dei um Bronze, pois após a seleção do personagem, o jogo inteiro foi para uma tela preta. O que fiz para testar o que estava acontecendo foi ir até o terminal e rodar o jogo a partir daí. No terminal alguns dos erros sugeriam que estava faltando uma peça vital para o jogo funcionar. Depois de ler a saída do erro e fazer o que sugeria (Substituindo uma DLL corrompida), consegui instalar um componente que o jogo precisava e o jogo funcionou perfeitamente .
Saber o que o jogo precisa é crucial para que o jogo funcione corretamente. Definir as
winecfg
opções e o ambiente do SO é apenas uma pequena parte. Isso é apenas criar o ambiente para o aplicativo. Você precisa adicionar outras funcionalidades como DirectX, XNA, .NET Framework e mais que o aplicativo pode precisar para funcionar. Esses são os principais componentes de alguns aplicativos. Sem eles, mesmo que alguns aplicativos funcionem corretamente, outros não. Garantir que você tenha todos esses componentes oferece uma chance maior de cumprir o que um aplicativo precisa.Como você pode ver no meu teste Dead Island eu adicionei vários
winetricks
pacotes e também instalei 3 pacotes que os jogos vêm com (DirectX, Windows Media Format e Microsoft Visual C++ 2010). Com isso consegui garantir que o jogo começaria e seria jogável.Alguns aplicativos são criados apenas para determinadas versões do Windows, como visto no Dungeon Keeper . Para especificar uma versão específica do Windows para um aplicativo específico, você pode abrir,
winecfg
navegar até Aplicativos e selecionar Adicionar aplicativo , procurar o arquivo executável do aplicativo e clicar em Abrir . Agora selecione o aplicativo na lista e altere a versão do Windows para ele. Dessa forma, apenas este aplicativo terá uma versão específica do Windows atribuída a ele, em vez de alterar globalmente a versão do Windows para todos os aplicativos.Alterar a versão do Windows globalmente pode afetar os aplicativos que foram instalados com uma versão diferente do Windows. Por exemplo, instalar o Terraria em um ambiente Windows XP e alterá-lo depois de jogar para o Windows 7 fornecerá um dos dois erros, um, não encontrar os jogos salvos e dois não executar o aplicativo.
Executar um aplicativo para diagnosticar qual o problema pode ser feito através do terminal, que é a melhor maneira de saber o que o aplicativo está fazendo ou precisando. O aplicativo pode fornecer informações como:
Para DLLs ausentes, sugiro usar arquivos dll para baixar DLLs específicas ausentes que são necessárias para o APP. Normalmente você pode colar essas DLLs dentro da pasta do jogo ou na pasta Windows/System32 (ou ambas) e isso deve resolver o problema. Para componentes ausentes, use
winetricks
.Ao solucionar problemas de um aplicativo, sempre execute o aplicativo em uma janela da área de trabalho emulada. Abra
winecfg
vá para Graphics e habilite Emulate a Virtual Desktop . Em seguida, defina a resolução para ele. Dessa forma, se o aplicativo travar, sequestrar o foco do teclado e/ou mouse, pelo menos você terá uma maneira de eliminar o aplicativo em vez de deixá-lo em tela cheia onde você tem poucas opções:Para cenários de congelamento de um aplicativo em tela cheia, sugiro ativar o recurso "Kill X" encontrado na janela de layout do teclado, que pode economizar vários segundos ao tentar sair de um aplicativo Wine congelado:
Outra técnica de sair de um estado congelado é abrir um terminal e digitar
wineserver -k
ou matar o servidor X. Para isso, primeiro configure-o executandosudo dpkg-reconfigure keyboard-configuration
e na última opção que fala sobre matar o X, diga "SIM". Isso habilitará a combinação CTRL+ ALT+ .BACKSPACELembre-se de que, se um aplicativo precisar de um requisito mínimo ou recomendado de hardware no Windows, ele também precisará do mesmo no Linux. Se o aplicativo precisar de 512 MB de RAM e uma CPU de 2,0 Ghz, ele precisará do mesmo no Linux usando o Wine.
Às vezes, você encontrará um aplicativo em ISO ou qualquer outro formato de imagem que não consegue abrir ou instalar. O Ubuntu vem com várias ferramentas para abrir esses arquivos mas a melhor que testei até agora é o CDEMU que abrange vários tipos de imagens que trazem o formato Multi-Setorial ou Protegido. Este é o mais próximo que você chegará de algo semelhante ao DAEMON Tools. Casos como The Sims 3, Simcity 2000 e outros só podem ser abertos e instalados usando este aplicativo. Mais informações em Apps capazes de montar/desmontar imagens de CD/DVD com formato multissetorial ou protegido
Para os casos em que um aplicativo específico não está em execução, mostrando falhas gráficas, tela preta ou não executando com gráficos completos, recomendo a leitura de um dos seguintes links que se aplicam ao usuário final para suporte de vídeo:
Usuários da Nvidia - Como instalo os drivers da Nvidia?
Híbrido - Uma NVIDIA GeForce com Tecnologia Optimus é suportada pelo Ubuntu?
Ati - Qual é a maneira correta de instalar drivers de vídeo proprietários ATI Catalyst (fglrx) diretamente da AMD?
Além de verificar o acima, se você tiver os drivers corretos, eu também acrescentaria que você precisa verificar se sua placa de vídeo tem suporte a OpenGL. Para isso, eu instalaria primeiro o mesa-utils se ainda não estiver instalado:
sudo apt-get install mesa-utils
para testar o suporte a OpenGL. Basta executar uma verificação para ver se você tem suporte a OpenGL:
glxinfo|grep 'direct rendering'
que deve dizer Sim se você tiver suporte. Outra alternativa seria:
/usr/lib/nux/unity_support_test -p
Por fim, você pode correr
glxgears
para ter uma ideia de como sua placa de vídeo é renderizada e seu FPS para a renderização. Outro ponto muito importante é executar a aplicação a partir do terminal como emwine AppName.exe
, desta forma mostrará qual é o problema.Se o Unity Launcher não estiver se escondendo ao executar um aplicativo Wine ou estiver movendo o aplicativo para a direita, você pode fazer uma das duas coisas:
Segure a ALTtecla e clique e arraste o vinho para a esquerda
Na opção de aparência, selecione "Auto-Hide The Launcher" e defina a sensibilidade para um nível que você gosta. Desta forma, o launcher irá se esconder quando o mouse sair de sua área.
Shader Model 3.0 não é reconhecido no Wine (incluindo jogos Steam)
There are games that require Shader Models and output an error similar to Required OpenGL extension GL_EXT_texture_compression_s3tc. To fix this simply type the following in the terminal:
sudo apt-get install libtxc-dxtn-s2tc0
( note in recent version of Ubuntulibtxc-dxtn-s2tc0
is not longer needed )Wine has come a LONG way from the days where newer games could not be played. It has gotten to a point where playing in Ubuntu is effortless. Wine has even some support for SM4.0 and DirectX 10/11 on Wine 1.6. If the problem persists it means that either your video card does not support this or you are missing the correct libraries.
Another reason that Wine might not detect Shader Model is because it might be set to Disabled in the Winetricks. Open the Dash and type
winetricks
. Select your wineprefix then Change Settings. Then look for the glsl=enabled option and select it. This should solve the Shader Model issue. Cases like the game Limbo are solved this way.6. How do I open multiple Wine apps without them using the same Window (Overlapping)
You can setup multiple Wine windows by adjusting some Wine parameters before starting each individual Wine program. The fastest way is to open the terminal where the executable of the app you want to run exists. Let us assume it is the Wow.exe app. Then simply type the following:
This would open the Wow.exe executable with a Window titled "WOW", a resolution of 1024x768 for that specific Window and it would apply the parameters -opengl and -console to the Wow executable. Now assuming you have the game installed somewhere else, you would the following change:
This executes Wow.exe assuming it resides in the folder wow inside a partition called fun in your /media/USER folder. The output should be similar to this when running for example 4 apps:
There is a more easier way to accomplish this. The idea is to create a Desktop shortcut by right clicking on the Desktop and selecting New Document --> Empty Document. This should create an "Untitled Document" file on your desktop. Now open the file and paste in it the following:
Now save it and rename the file to the application you want to open but at the end add ".desktop". It will turn into an "Executable Windows Icon". Now right click the Icon again and go to Properties --> Permissions --> Activate Allow executing file as program. Now go to the Basic Tab and insert the information you need to execute that wine app. The end result should be something like this:
7. Does having Ubuntu 64 bit influence Wine
Yes, having Ubuntu 64 Bit will also set Wine as 64 bit. This will create several problems for many Windows apps that only work on 32 Bit, for example not being able to install several of the .NET Frameworks since they will only work on the 32-Bit version, which will result in the user not being able to run many Windows applications. To solve this you need to do the following after having succesfully installed the PPA version as I mentioned above. Immediately afer installing the PPA wine package and before opening
winecfg
open the terminal (Make sure you are at your home folder by typingcd ~
) and type the following:Change USER with your user account. For example in My case, that line would read
export WINEPREFIX="/home/cyrex/.wine"
With this method you have changed the Wine architecture to 32 bit and on the moment you open Winecfg, it will configure all the Windows versions available to 32 Bit.
8. Alternatives to Wine PPA
PlayOnLinux (PoL)
Although you can actually install and configure everything you need with Wine alone and it's complementing apps (winetricks, regedit, explorer) using PoL can save you some trouble and time when installing an application. With PoL you can find a list of apps that you can select and install in it's database:
and by simply selecting to install you achieve the following benefits:
Creating an independent container which holds the app installed, a specific Wine version for the app installed (In some cases, a specific Wine version works better for a specific app than the current Wine version).
Automatically installing any additional DLL and Components the app needs to function correctly.
Adding the appropriate registry keys the app needs
Create an independent way of running multiples apps without them overlapping each other with Windows version changes, regedit changed, specific Wine versions, etc..
Of course, it is important to know that PoL works side by side with Wine and it needs Wine to work correctly (It is based on it). In many cases, an app might not work with PoL but will work with the default Wine configurations I have mentioned in this guide. So if you find the app you want to use in PoL, great. But if you don't find it, remember you always have the alternative to using the default Wine to install and configure the app.
The benefits of installing the app using Wine and installing it using PoL is that with Wine, you can access and execute the App using the DASH, like in the images below:
CodeWeavers CrossOver (CC)
CC is very similar to PoL on how to install and configure apps. The main difference is that CC offers official support. They even have their own CodeWeavers Database which holds more than 10.000+ apps. Not only that but they have a ranking system similar to the one in Wine's AppDB. They have also contributed to the development of Wine some of which you can see in their Support.
DosBox (DB)
DB is to MS-DOS apps as Wine is to Windows apps. With DB you can run MS-DOS apps in your system. Simply install the
dosbox
package and you are done. Running an app is as simple as going to the folder where the app resides and executing the following:dosbox ./
This will open the current folder as a drive letter on the DB environment.
You can also mount a folder by doing the following after opening DB:
mount x: /Absolute/Path/To/Folder/Of/App
For example
mount c: /home/cyrex/Desktop/Dune2
Will create the C: Drive letter which contains the Dune2 folder. So if I simply execute dune2.exe I get the following:
9. What are some special parameters and tips I can use with Wine
There are a couple, for example:
COMMANDS
wine --version
- Shows the version of winewineserver -k
- Kills all wine versions for the specific user. This is useful if your Wine app is frozen, took the whole screen and does not let you use Ubuntu, has the mouse or keyboard focused on it and other Wine issues that might appear with some apps.wine explorer
- Will open an explorer similar to the Windows Explorerwine explorer /desktop=X,Y
- Creates a virtual desktop where X is the name of the Desktop Window and Y is the resolution of the Window. For example:wine explorer /desktop=WOW,1024x768 Wow.exe
regedit
- Will open the regedit version of Wine similar to the Windows one.wine uninstaller
- Will open the Add & Remove of Wine similar to the one in Windows. Here you will be able not only see which apps you have install and uninstall them, but also be able to install new apps if you wish.winetricks
- Will open the winetricks app to install missing Libraries, DLLS and Components essential for the correct functionality of many Windows apps.winecfg
- Will open the Wine Configuration where you can set Video, Sound and Windows version.wine ipconfig
- Shows you the IP that Wine can see. Similar to ipconfig.wine netstat
- Shows you the IP/Port connections made. Similar to netstat.wine start
- Sets the working directory for the executable. This option helps in cases where the executable only works from the same folder and not from a full path. An example is if you wanted to run a .bat file or simply execute a command from another folder (eg: Parent folder), you would do something like this, assuming we are not in the same folder as MetroLL.exe:This would do two things, it will first set the directory to the
Metro Last Light
folder and then it would run theMetroLL.exe
mentioned at the end. This is similar as running the executable from the same folder but it has the advantage of running the app from any other place. The thing to know here is that:\\
instead of\
C:\\
to make sure the executable will always work as it should.C:
drive, then add the corresponding letter. For example, to execute a Windows binary outside of Wine, you would use theZ:\\
letter sinceZ:
normally points to the Linux system's root directory./?
parameter, (eg:wine start /?
)export WINEPREFIX
- This variable is used to change the Wine Prefix to another location. For example if you wish to merge PoL and Wine (Not recommended since PoL has multiple Prefixes) you can do the following:Where PREFIX is the one you want to merge with Wine. You would have to run winecfg again.
TIPS
When dealing with a folder tha has spaces (eg: World of Warcraft), you can execute the Wow.exe file by adding the \ symbol in front of every space, this escapes the symbol. The end result would be something like "World\ of\ Warcraft\Wow.exe". If you do not want to add this escape symbols to your line of code, simply double quote the entire link, so it looks like:
wine explorer /desktop=WOW,1024x768 "/media/cyrex/My Partition/World of Warcraft/Wow.exe" -opengl -console
as you can see, there are 2 folders with spaces in them, "My Partition" and "World of Warcraft", but since I quoted the whole string, the need to include escape characters is not needed. If you wished to use the Wine Path (eg: C:/) then all slashes would be a double slash (eg: "C:\Program Files\App").
Parameters that are applied to an app should always be OUTSIDE the quoted strings. Using the example above, we can see -opengl and -console outside the quotes.
When dealing with apps that take hold of you mouse and/or keyboard, you can use
wineserver -k
to kill the app, or simply opening the App in Windows mode or setting the Windows mode with thewine explorer /desktop
parameter will save you from having this mouse/keyboard problems.10. Stability, Performance and App Support Wine offers to end users
APP SUPPORT
I have tried Wine since 2005 and seen how the developing process in Wine under Ubuntu has been quickly catching up to the latest games.
Before Wine 1.2 came out around 2012, it was difficult to get many apps working on Wine, but after Wine 1.2 came out it was a totally different result. Even more so after 1.4 came out in 2012, 1.6 in 2013 and then 1.8 in 2015. Many cases started to appear where they would work out of the box. Cases like Deep Space 2 which is/was one of the latest games I could play at that moment and which I tested 3 days after it was released. Alice in Wonderland (The new one I mean), The Sims 3, World of Warcraft, Amnesia and others. Even Skyrim could be played. These are games that demand powerful graphics and you can play them with little to no additional setups other than the normal install provided above.
To know what games you can play on Wine I recommend visiting the Wine App Database: http://appdb.winehq.org/ which holds more than 10K+. This includes information about their performance & stability and it helps in knowing if a game is playable.
The Wine App Database also offers a Ranking which determines what games can be played with less issues, if any. When you see this ranks, you have an idea if the App will work or not. Mind that you need to also take into consideration what hardware and Wine version the tester shows on the Wine Database. The rankings are as follow:
Platinum Rank - Means you have an almost 100% chance the app will work out of the box.
Gold Rank - Means you might find yourself doing a little bit of configuring but it will work out at the end.
Silver Rank - Means that the app will run, but might have graphical, sound or control issues.
Bronze Rank - Means the app will not work correctly.
Garbage Rank - Means the app still does not work and probably will not even install. The only way you could make it work would be when Superman starts eating kryptonian cereal in the morning.
For reference, a couple of years ago the amount of Platinum games was less than 50. In 2012 you could find More than 1.5K games out of which almost 200 were in the Latest Titles. Today there are more than 6K+ Games of which 4K+ are Platinum. The more people that participate in testing Wine apps, the better. Main reason I always recommend using the PPA from Wine.
PERFORMANCE
For performance information see Gaming performance difference between Windows and Ubuntu
11. How to Uninstall Wine
Uninstalling Wine can be done in 2 ways depending on your needs. If you only need to "Reset" Wine to the default values, you can simply delete the
.wine
folder and then create it again by runningwinecfg
. If you have apps on the.wine
folder that you wish to backup, now would be a good time before deleting the folder. To delete the folder simply do the following and it will take care of the whole Wine environment:rm -fr ~/.wine
rm -fr ~/.cache/wine
Now if you want to actually uninstall Wine from Ubuntu, you can do the following, but note that this will NOT delete your
.wine
or cached folder:sudo apt purge wine*
This would uninstall every package related to wine, including wine, wine1.9, winehq, winetricks and more. Basically removing anything related to wine.
Open your terminal, If you are using a 64-bit Architecture linux system, then enable 32-bit for better compatibility...
The following procedure can be used to install Wine directly using WinHQ packages. Start By Updating your linux system, using :
At this point we have the following WineHQ installations available: stable, staging and development version. Select the installation command to suit your environment:
Check version after Wine installation:
It should give you : wine-5.0
Check version after Wine installation:
It should give you : wine-5.2 (Staging)
Check version after Wine installation:
It should give you wine-5.2
Uninstalling Wine can be done in 2 ways depending on your needs. If you only need to "Reset" Wine to the default values, you can simply delete the .wine folder and then create it again by running winecfg. If you have apps on the .wine folder that you wish to backup, now would be a good time before deleting the folder. To delete the folder simply do the following and it will take care of the whole Wine environment:
Now if you want to actually uninstall Wine from your Linux Distro, you can do the following, but note that this will NOT delete your .wine or cached folder:
This would uninstall every package related to wine, including wine, wine 6.0, winehq, winetricks and more. Basically removing anything related to wine.
Nota especial para o Ubuntu 18.04 LTS (Bionic Beaver)
Se você não estiver satisfeito com as versões do Wine 3.6.x do repositório oficial , leia o método abaixo.
Para essa versão do Ubuntu, o repositório WineHQ perde as dependências do FAudio.
Eu relatei um bug 48513 para WineHQ bugzilla .
Portanto, precisamos seguir parcialmente o guia oficial do WineHQ para o Ubuntu :
Nota: se você tiver o repositório WineHQ adicionado - remova-o com
para evitar a confusão de repositórios e, em seguida, prossiga.
Então precisamos adicionar outro repositório do OpenSuse Build Service para
libfaudio0
instalar:e somente depois disso instale um dos pacotes WineHQ: