Running Unity on Linux through Wine
For how to run the Unity Web Player on Linux native browsers see the Running Unity Web Player on Linux using Pipelight page.
Officially Unity Technologies only support creating executable standalone games/3D applications which can then be run on Linux, specifically Ubuntu 10.04 or newer(Source). This is done by using the Unity Editor in Microsoft Windows and OS X operating systems. Unity Technologies do not provide a Linux version of the Unity Editor. Unity Editor can still be launched on Linux by using the Windows version of the editor with mimicked Windows libraries provided by the Wine software. Stability of the editor depends on particular Linux distributions and the video/graphics cards.
If you would like Unity Technologies to create a Linux version of Unity Editor, please vote for it on Unity Feedback. This feature has been the most requested feature for many months.
- An operating system/distribution that is able to run Wine, also see 'Tested successfully on distributions' section within this wiki page.
- Newest stable drivers for your graphics card
If you plan to use the lengthy PlayOnLinux method of installing Unity you will also need:
- PlayOnLinux - Software that is able to manage multiple versions of Wine.
- Most recent Wine on PlayOnLinux - This is installed from within PlayOnLinux, a native installation of Wine is not required.
- Official Windows installer file for Unity (Versions of 4.X.X and 5.X.X are the ones tested )
Tested successfully on following distributions
Users from the community have reported of getting Unity working on the following operating systems/distributions:
- openSUSE 13.1 (reported to be most stable at running the Unity editor)
- Ubuntu 12.10/13.10/14.04, Lubuntu 13.10/14.04/14.10 and Xubuntu 14.04 (for now the only distros that receive Unity Technologies support for Linux Standalone Unity applications and Valve Software's support for running Steam)
- Fedora 19/20
- RedHat 7 Beta
- Debian Jessie
Installing Unity using the terminal with a winetricks script (Experimental, yet quicker)
User "Doctor Jellyface" saw the use of PlayOnLinux as unnecessary way to install Unity, even with the better graphics interface that PlayOnLinux offers. So he created a winetricks script that installs Unity and all the necessary libraries to make Unity work on a native Wine.
1. Install Wine, by following instructions from its official website for your Linux distribution.
2. Download the newest Unity installation script from github.
3. If you have a 64 bit operating system, then it best to set the default Arch to 32 bit for new Wineprefixes as winetricks does not have much support for 64bit wineprefixes. So before proceeding with the next step, set the environment variable through your terminal:
$ export WINEARCH=win32
(Example given for Ubuntu Linux, this environment variable will only last in that terminal session, which is enough while installing Unity)
4. Open up a terminal, move to the location of the downloaded ".verb" script and run the script using winetricks(installed by default with some "Wine" distro packages, if not see winetricks install page):
$ winetricks -q "./unity3d.verb"
If this does not fully complete, remove the "-q" argument to debug.
5. A 'Unity' shortcut should be on your desktop. Wine should be launching it. If it does not then the Unity prefix should be located under "~/.local/share/wineprefixes/unity3d".
Installation with PlayOnLinux
PlayOnLinux is a program that is able to manages different wine versions for cases when a Windows application works on one wine version but not on another and so it allows easy switching between them without breaking another Windows application.
Most of these numbered steps come from a user called 'Tomza', you can read his blog post on this issue for reference.
Follow the installation instructions provided by PlayOnLinux for your distribution.
Download the Windows Unity Installer
Download the Windows installer of Unity from the official site. Do not run/execute the file.
PlayOnLinux first launch
When you run PlayOnLinux for the first time, you will see the PlayOnLinux Wizard:
- Possible first warning
PlayOnLinux cannot find wine (from Wine) You should install it to use PlayOnLinux
- The reason for this warning is that PlayOnLinux wanted add the natively installed Wine as one of available Wine versions, which sometimes might not be present.
- Click OK.
- Possible second warning
PlayOnLinux cannot find 7z (from P7ZIP full) You should install it to use PlayOnLinux
- 7zip is an archive creator, extractor. We don't need this now.
- Click OK.
- Possible third warning
Windows Fonts useful for all programs you will run on PlayOnLinux Install Windows fonts
- Linux does not come with Windows fonts. This is solved by the script, no need to worry about it.
- Click Next.
When all is over, you should see Enjoy using PlayOnLinux.
Managing wine versions
- From PlayOnLinux's window header choose "Tools" -> "Manage Wine Versions".
- Choose a recent Wine version, 32 bit if you're on a 32 bit system or you're going to install the 32 bit editor, 64 bit otherwise.
Warning: Remember that the newest Wine can be unstable (Wine 1.6.2 is stable), but, at the same time, some bugs can be fixed in the recent version, and that’s why it can be the best way to go for you; fortunately, you can choose the Wine version in PlayOnLinux you like even after installing an application; the recent version is recommended for running Unity3D because of 3D driver improvements.
- Click the arrow to install your version of Wine.
Getting the script
A PlayOnLinux script has been created by the Unity Community to easily install Unity. Save the following script to your disk in plain text. You can call it as you want, but the .pol extension should be kept so that PlayOnLinux can recognize it as its script.
You can find the script on GitHub.
- Warning for Ubuntu users
- This script will fail with an due to system wide parameter called 'ptrace_scope'. See Regarding ptrace_scope fatal error for a fix.
Adjusting the wine version
Depending on your installed wine versions you may want to change the Wine version before running the script.
Just change this line accordingly:
- From PlayOnLinux, go to Tools→Run a local script.
- Choose the script and click Next.
- You will see the warning that the signature of the script isn’t valid. It is an unofficial script, so you can safely ignore it. Click Next.
- You will be able to review the script. If it's fine, check I agree and click Next.
- Then you will see the installation wizard, click Next, the following should appear:
The script is running a virtual drive is being created first – it will be the place where your whole installation will be placed. a/ The environment for the virtual disk
When you run PlayOnLinux for the first time, some extra software may be installed.
PlayOnLinux should now be installing the components it needs for Unity3D and MonoDevelop to work on Wine. The list of their names is included in the script you are using. They are really important, so wait patiently.
- When the script installs up the components, find the Unity setup executable on your disk through the PlayOnLinux window.
- Install Unity3D just like in Windows. Follow the instructions during the installation. You may want to install the AngryBots project to test your installation of Unity. If errors appear, don't worry about them too much – they probably aren't show-stoppers.
- Click Finish in the Unity installation wizard and the PlayOnLinux installation wizard. You will see the Unity icon in the main PlayOnLinux window – you can start Unity from here if you want.
- You can see two Unity icons on your desktop. Delete the one called simply "Unity", which is created by the Unity installer and might not work. "Unity3D" is the one created by the script.
- If you haven't launched Unity yet, do it.
- Do everything Unity wants you to do (Activate your Unity License – free or pro, log in to your Unity account). Click Start using Unity to start using Unity, obviously.
- When you see the Project Wizard dialog, you may want to open the AngryBots project (if you chose to install it) for testing purposes. It is located under "C:\users\Public\Documents\Unity Project\". Disk Z: is your Linux disk.
- If everything is working fine, celebrate.
Editing image assets with a native Linux Image Manipulation Program
By default Unity will open image files with Internet Explorer. While it is possible to set a Linux executable to be run by Unity in its preferences, the file path that Unity will provide is a Windows styled one '/PlayOnLinux Drive/C:\UnityProject\Assets' which the image manipulation program will probably not recognize.
Wine has a tool that can translate Windows styled paths to Unix styled paths. A shell script can be used as the target to translate the path before giving it to the desired program, in this case GIMP:
#!/bin/sh if [ -z "$1" ] then echo "No file specified" exit 1 fi # Change 'gimp' to the command name of your desired image manipulation program. gimp "`wine winepath -u "$1"`" # Note that the 'wine winepath', which translates Windows path name to Unix, is the natively installed 'wine'. echo "Opening $1 with GIMP" exit 0
Save it to a file that Unity can see and set it as an executable(like 'chmod 755' through the terminal), then set the shell script as the Image Manipulation program in Unity Preferences.
NOTE: A native 'Wine' version needs to be installed for this script to work. TODO: Make the script use PlayOnLinux's installed Wine to translate file paths.
Editing scripts with a native Linux script editor
Depending if you installed Unity with MonoDevelop, then Unity will open script files with either Notepad or MonoDevelop by default. Same when double-clicking on script errors and warnings. While it is possible to set a Linux executable to be run by Unity in its preferences, the file path that Unity will provide is a Windows styled one '/PlayOnLinux Drive/C:\UnityProject\Assets' which the editor will probably not recognize.
Wine has a tool that can translate Windows styled paths to Unix styled paths. A shell script can be used as the target to translate the path before giving it to the desired program and also providing the line of code to jump to.
#!/bin/sh if [ -z "$1" ] then echo "No file specified" exit 1 fi # Change '/opt/sublime_text/sublime_text' to the path of your executable for desired IDE. /opt/sublime_text/sublime_text "`wine winepath -u "$1"`:$2:$3" # Note that the 'wine winepath', which translates Windows path name to Unix, is the natively installed 'wine'. echo "Opening '$1' on line '$2' column '$3' with Sublime Text" exit 0
#!/bin/sh if [ -z "$1" ] then echo "No file specified" exit 1 fi # We assume that the kate executable is lies in '/usr/bin/'. Change the path if necessary. /usr/bin/kate "`winepath -u "$1"`" -l "$2" # Note that the 'wine winepath', which translates Windows path name to Unix, is the natively installed 'wine'. echo "Opening '$1' on line '$2' with Kate" exit 0
Save it to a file that Unity can see and set it as an executable(chmod 755), then set the shell script as the External Script Editor program in Unity Preferences with correct format in its arguments, for this shell script it's '"$(File)" $(Line)' (without the '').
User Radivarig created a script to use a native (Linux) version of MonoDevelop as the editor. It handles pretty much everything, and the functionality shouldn't be different than on Windows.
You can find the script on GitHub.
Usage: 1. Download the script and give it execution rights like so (assuming you installed Unity into the default wine prefix):
wget https://raw.githubusercontent.com/Unity3D-Wine-Support/Unity3D-on-Wine/master/text-editors-MonoDevelop/unity3d_native_monodevelop.sh mkdir ~/.wine/drive_c/Program\ Files/Editors mv ./unity3d_native_monodevelop.sh ~/.wine/drive_c/Program\ Files/Editors chmod +x ~/.wine/drive_c/Program\ Files/Editors/unity3d_native_monodevelop.sh2. Set the script as the editor in Unity: navigate to Edit->Preferences->External Tools and set the script as the editor, with arguments
You can use this script as a base to make your own editor launcher.
First see if your issue hasn't already been resolved by someone in GitHub Closed/Resolved Issues.
If it is not, raise your issue there in GitHub Open Issues.
The following may not be up to date.
Unity Asset store does not work in Unity 4 and down (has a workaround)
The Asset store window/tab shows up gray, but some elements on the window are picked up judging from that the mouse cursor changes. Some believe it is a WebKit issue.
However, user dialytica found a neat workaround: you can search on the Asset Store, login, download and import assets simply by searching in the Project View, ticking "Asset Store", and clicking on the search results.
WineHQ bug report: http://bugs.winehq.org/show_bug.cgi?id=34039
Issue on GitHub: https://github.com/Unity3D-Wine-Support/Unity3D-on-Wine/issues/5
Project Creation: "Specified path is not valid..." error message
While it might seem strange, this is an Internet Explorer issue. It is fixed by installing Internet Explorer 8. Preferably using winetricks "ie8" or in PlayOnLinux case, "Internet Explorer 8" component.
"-force-opengl" option crashing Unity (Experimental fix)
By default Unity Editor for Windows uses Direct3D to render graphics and Wine redirects Direct3D calls to OpenGL calls, which has compatibility and performance issues. Unity Technologies have included "-force-opengl" argument to force Unity to use OpenGL.
The reason for the crash is supposedly "because Unity 3/4 does something with OpenGL contexts that is acceptable for WGL, but not for the Linux equivalent layer called GLX.". But there exists a patch for Wine that allows Unity to run in OpenGL mode, but, to add the patch, Wine has to be compiled with it included.
Performance gains are reported to be between 10% to 400%.
How to fix: If you have a 32bit Linux distribution, follow instructions in this script(note that it is for Ubuntu), you may skip the following numbered steps.
1. If you have a 64bit Linux distribution, then it should be noted that winetricks does not have full support for 64bit Wine as of yet. Follow the instructions on how to compile a 32bit Wine on a 64bit OS here, only up to the point of getting the source code.
2. Before compiling Wine, add the patch to the source code folder through the terminal:
- > wget https://raw.githubusercontent.com/Unity3D-Wine-Support/Unity3D-on-Wine/master/Compile-Wine/WGL-ShareList-Hack.patch
- > cat ./WGL-ShareList-Hack.patch | patch -p1
3. Compile Wine.
4. Run Unity with the new Wine using something like
- > env WINEPREFIX="~/.local/share/wineprefixes/unity3d" ~/wine32/wine ~/.local/share/wineprefixes/unity3d/drive_c/Program\ Files/Unity/Editor/Unity.exe -force-opengl
Ubuntu: Windows cannot be fully maximized
This might actually be an issue for all Wine applications contained within a window. See the following answered question for the way in fixing this issue: http://askubuntu.com/questions/267843/how-can-i-fully-maximize-wine-applications
Unity dashboard is all grayed out
This bug may appear when the Linux system's timezone is set as a "named" timezone (like "America/Sao Paulo"). Switch the timezone to another, which is not named and has only the GMT code, like 'GMT+3'.
To do this, open up a terminal.
For Ubuntu/Debian type: sudo dpkg-reconfigure tzdata
In the menu that opens up, go down and choose "etc" and set right timezone code according to your location in GMT.
NVIDIA: Unity does not refresh windows often enough
When selecting a game object, the inspector might not refresh at the right time, showing the previous game object. Same thing may happen when writing text in a text input and seeing the previous state.
Steps to reproduce:
- Click on a GameObject.
- In inspector click on show/hide Transform tag multiple times until the line is turns up gray as if it is opened, but doesn't seem like it.
- When this happens, click the inspector tab(to refresh the window) and then on a parameter. When writing you should see only the previous state of the text.
- Ubuntu 13.10/14.04
- Wine 1.7.15/.16/.17/.18
- Graphics card: NVIDIA Geforce 9600GT/GT320M
- NVIDIA driver (proprietary) 319/331.38
- NVIDIA driver (open-source) 331.67/334.21/337.12/337.25 (These are made available when adding ppa:xorg-edgers/ppa repository)
Most likely culprit:
NVIDIA graphics drivers, although in -force-opengl mode other vendor graphics cards also experience this bug.
How to solve:
- Enable "Strict Draw Ordering". You have to add a key to the registry, see [UsefulRegistryKeys]. For PlayOnLinux installation of Unity, there is an option in its configuration. This might impact performance.
- Use the Nouveau graphics driver, which does not have up to date 3D acceleration.
Built-in MonoDevelop doesn't launch
This sometimes happens because Wine launches MonoDevelop in a new wineprefix. Luckily, Radivarig created a script to fix this. Simply download the script, give it execution rights and set it as the editor in Unity.
You can find the script on Github.
If you have a Github account, it is recommended to set this repository as "Watch" in order to be notified of enhancements and bugfixes.
Github Unity3D-on-Wine Issues page
First see if your issue hasn't already been resolved by someone in Closed/Resolved Issues.
If it is not, raise your issue there in Open Issues.
Unity Forum Thread
Visit and contribute in the forum thread created on the Official Unity Forum.
Wine Application Database (AppDB)
Unity Editor page - https://appdb.winehq.org/objectManager.php?sClass=application&iId=11075
If you have used the Unity Editor for notable amount of time, then it would be helpful to vote for the closest compatible test done within AppDB or make your own test.