Search Unity

Error on build machine: Error opening default X display

Discussion in 'Linux' started by fika_paus, Aug 11, 2016.

  1. fika_paus

    fika_paus

    Joined:
    Jul 22, 2016
    Posts:
    5
    5.4.0f3 on a host without graphics

    Any tips on what might be going on?

    Running:
    Editor/Unity -batchmode -nographics -quit

    Logfile:
    BATCHMODE ARGUMENTS:
    Editor/Unity
    -batchmode
    -nographics
    -quit
    -logFile
    /tmp/unity.log
    /images/personal/empty_project
    UpdateMenuTitleForLanguage: 10
    Error opening default X display

    (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/X11Quarantine.cpp Line: 152)

    Receiving unhandled NULL exception
    Launching bug reporter
    #0 0x007fffdd325600 in _L_unlock_13
    #1 0x007fffdd325a68 in _XimLocalSetICValues
    #2 0x007fffdd325a70 in _XimSetICDefaults
    #3 0x007fffdd325ae0 in _XimSetICDefaults
    #4 0x007fffdd325b50 in _XimLocalCreateIC
    #5 0x007fffdd325d80 in XCreateIC
    #6 0x007fffdd325e90 in InitializeX11()
    #7 0x007fffdd325eb0 in InitX11ToSDL()
    #8 0x007fffdd326640 in InputInit()
    #9 0x007fffdd326650 in InitializeEngineNoGraphics()
    #10 0x007fffdd326690 in Application::InitializeProject()
    #11 0x007fffdd326d10 in InitializeUnity(void*)
    #12 0x007fffdd326e50 in main
    #13 0x007fffdd3271f0 in __libc_start_main
    #14 0x007fffdd3272b0 in _start
     
  2. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    Currently you still need a display for the Linux editor, even in nographics mode.
    This is a known issue which we plan to address (but there's no timeframe right now).
     
  3. fika_paus

    fika_paus

    Joined:
    Jul 22, 2016
    Posts:
    5
    Good to hear
    Thanks for letting us know
     
  4. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    Hi,

    still (Unity 5.5.0f3 (64-bit)) the problem is not resolved.
    I want to compile the game remotely in Linux
    through this script named as "starter.sh"

    #/bin/bash
    projectPath=`pwd`
    echo "Building in project ${projectPath}"
    /opt/Unity/Editor/Unity -batchmode -nographics -logfile stdout.log -force-opengl -quit -projectPath ${projectPath} -buildWindowsPlayer "builds/myg3.exe"


    without any display (through webmin custom command) but I get :

    Error opening default X display
    (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/X11Quarantine.cpp Line: 152)

    Receiving unhandled NULL exception
    #0 0x007ffc5596eb40 in funlockfile
    #1 0x007ffc5596f0c8 in _XimLocalSetICValues
    #2 0x007ffc5596f0d0 in _XimSetICDefaults
    #3 0x007ffc5596f140 in _XimSetICDefaults
    #4 0x007ffc5596f1b0 in _XimLocalCreateIC
    #5 0x007ffc5596f3d0 in XCreateIC
    #6 0x007ffc5596f4d0 in InitializeX11()
    #7 0x007ffc5596f4f0 in InitX11ToSDL()
    #8 0x007ffc5596fc80 in InputInit()
    #9 0x007ffc5596fc90 in InitializeEngineNoGraphics()
    #10 0x007ffc5596fcf0 in Application::InitializeProject()
    #11 0x007ffc559703d0 in InitializeUnity(void*)
    #12 0x007ffc55970510 in main
    #13 0x007ffc559708c0 in __libc_start_main
    #14 0x007ffc55970980 in _start

    Executing the script (sh starter.sh) from command line (not with root user) it works.

    It would be nice if

    1) root user can also run the script.sh because most of the web clients run as root
    2) the need of a display is removed (servers do not have a display).

    BR,
    jimver04
     
  5. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    Latest update.
    The xvfb generates a virtual display (actuall a framebuffer) as it is suggested by other threads.

    By sending the following command through php

    xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' /opt/Unity/Editor/Unity -batchmode -nographics -logfile stdout.log -force-opengl -quit -projectPath [writehereyourprojectpath] -buildWindowsPlayer "builds/myg3.exe"

    I get the following

    /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.10' not found (required by /opt/Unity/Editor/Unity) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/Unity/Editor/Unity) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /opt/Unity/Editor/Unity) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /opt/Unity/Editor/Unity) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /opt/Unity/Editor/Data/Tools/libfreeimage.so.3) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/Unity/Editor/Data/Tools/libfreeimage.so.3) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /opt/Unity/Editor/Data/Tools/libfreeimage.so.3) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.10' not found (required by /opt/Unity/Editor/libcef.so) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /opt/Unity/Editor/libcef.so) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/Unity/Editor/libcef.so) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /opt/Unity/Editor/libcef.so) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/Unity/Editor/Data/Tools/libumbraoptimizer64.so) /opt/Unity/Editor/Unity: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /opt/Unity/Editor/Data/Tools/libumbraoptimizer64.so)
     
  6. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    This error means that the version of libstdc++ on your server is not recent enough.
     
  7. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    Indeed,

    I found two versions of libstdc++ in my system
    a) /usr/lib/x86_64-linux-gnu/
    libstdc++.so.6
    and its dependency
    libstdc++.so.6.0.21

    b) /opt/lampp/lib/
    libstdc++.so.6
    and its dependency
    libstdc++.so.6.0.8

    the 6.0.21 includes the missing files whereas 6.0.8 is not.
    ( the command to run to see it is strings /opt/lampp/lib/libstdc++.so.6 | grep GLIBCXX )

    by replacing the two old files with the recent ones I thought the problem will be solved but it is not. I get now

    terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid Aborted (core dumped)

    Is this related to Unity or to any other library ?

    I have checked the libstdc++ package files:

    http://packages.ubuntu.com/xenial/amd64/libstdc++6/filelist

    /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
    /usr/share/doc/libstdc++6
    /usr/share/gcc-5/python/libstdcxx/__init__.py
    /usr/share/gcc-5/python/libstdcxx/v6/__init__.py
    /usr/share/gcc-5/python/libstdcxx/v6/printers.py
    /usr/share/gcc-5/python/libstdcxx/v6/xmethods.py
    /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21-gdb.py

    and apart to the two aforementioned I do not see anyone else related directly to them so I guess this is a problem of Unity.

    This the end of the quest with this way. I will try with ssh and putty.

    D.
     
    Last edited: Jan 9, 2017
  8. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    It still seems like something pretty basic is going wrong - can you send your editor log from a session that aborts this way?
     
  9. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    Can't get home directory! (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 262) mono profile = '/opt/Unity/Editor/Data/Mono/lib/mono/2.0' Initialize mono Mono path[0] = '/opt/Unity/Editor/Data/Managed' Mono path[1] = '/opt/Unity/Editor/Data/Mono/lib/mono/2.0' Mono path[2] = '/opt/Unity/Editor/Data/UnityScript' Mono path[3] = '/opt/Unity/Editor/Data/Mono/lib/mono/2.0' Mono config path = '/opt/Unity/Editor/Data/Mono/etc' Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56606 Can't get home directory! (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 262) CreateDirectory '/Unity' failed: (current dir: /opt/lampp/htdocs/SimpleUnityGameProjectTemplate_v4) Can't get home directory! (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 262) Can't get home directory! (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 262) DisplayProgressbar: Unity license Can't get home directory! (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 262) Request Timeout while processing request "https://public-cdn.cloud.unity3d.com/config/production", HTTP error code 0 .Cancelling DisplayDialog: Failed to activate/update license. Missing or bad username and password. Please try again using valid credentials or contact support@unity3d.com This should not be called in batch mode. (Filename: /home/builduser/buildslave/unity/build/Editor/Platform/Linux/EditorUtility.cpp Line: 219)

    I suppose that this have to do with the fact that I am calling unity from the web user "daemon" but not the user that installed Unity3d from the ubuntu interface. By running the command from the terminal as me (jimver user) everything works.

    I have tried to state my username and password explicitly from command line ( -username -password arguments) but no lack. I am afraid that the "This should not be called in batch mode" is something like a firewall for the command line.
    I am stating below what I have tried.

    starter.sh

    #/bin/bash
    xvfb-run --auto-servernum --server-args='-screen 0 1024x768x24:32' /opt/Unity/Editor/Unity -username jimver -password [mypassgoeshere] -batchmode -nographics -logfile -force-opengl -quit -projectPath [projectpathhere] -buildWindowsPlayer "builds/myg3.exe"


    and this is my calling php

    <?php error_reporting( E_ALL );
    $output = shell_exec('sh starter.sh');

    echo "<pre>".print_r($output)."</pre>";
    print("END");
    print_r(error_get_last());
    ?>

    Still I am searching for the solution
     
  10. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    I have changed the httpd.conf standard web user to be me (jimver) instead of daemon and now I get a different message

    Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on. ATTENTION: default value of option force_s3tc_enable overridden by environment. [0110/115845:ERROR:sandbox_linux.cc(308)] InitializeSandbox() called with multiple threads in process gpu-process No sufficient permissions while processing request "https://core.cloud.unity3d.com/api/login", HTTP error code 401 .Cancelling DisplayDialog: Failed to activate/update license. Timeout occured while trying to update license. Please try again later or contact support@unity3d.com This should not be called in batch mode. (Filename: /home/builduser/buildslave/unity/build/Editor/Platform/Linux/EditorUtility.cpp Line: 219)

    Any ideas ? Should I try to search for SUID sandbox ?
     
  11. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    I think the key here is "Failed to activate/update license" - have you activated a Unity license on this server?
     
  12. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    Do i need a commercial license? Why from ubunu terminal is working but not from php-lampp ? If i am going to buy a license do you warranty that will work or other problems may occur?

    BR,
    D.
     
  13. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    You can use a personal, plus, or pro license (whatever's appropriate for your usage) - but it needs to be activated.
     
  14. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    I have activated my personal license during unity installation in windows. I then change machine to ubuntu and downloaded the linux version in ubuntu and installed it with ubuntu gui interface with the same username and password as in windows (i did not want to make a second account).
    So I have two paths to check:
    a) I guess that although my personal license is activated, it is not for linux but for windows. Am I right ? or
    b) should I install and activate somehow the license in linux in headless mode?
     
  15. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    You need to activate every Unity installation.
    If you've already activated the installation on the server for your user, then you don't need to pass the -username and -password arguments on the batch mode command line (when you do, it thinks you're trying to update your activation).
     
  16. Improbable-Licences

    Improbable-Licences

    Joined:
    Mar 2, 2016
    Posts:
    6
    We have the same problem. It works on cloud Windows VMs running on GCE, expect the same from AWS instances. Linux doesn't. Will give it a go with xvfb or XDummy. Here there is some more info related to xvfb and the audio warnings https://medium.com/@h0lycattle/runn...ized-headless-ubuntu-environment-1adf95c05994

    On other VMs we have on-site work on all platforms Win, Linux (require the user to be logged in to the session) and Mac.
     
  17. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    I have already solved the xvfb problem. My problem is on compiling the game through a web browser, i.e. with php
    <?php
    shell_exec("my xvfb command");
    ?>
    Today is the third day I am trying.
     
  18. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    There is something going wrong with the unity authentication.
    In ubuntu16 with xampp, the php 5.6.24 runs as daemon user and it can not create the necessary folders for the compiling (that are very spread withing ubuntu system).
    The only solution was to do a change the opt/lampp/etc/httpd.conf , i.e. to replace the daemon user in

    <IfModule unixd_module>
    #
    # If you wish httpd to run as a different user or group, you must run
    # httpd as root initially and it will switch.
    #
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # It is usually good practice to create a dedicated user and group for
    # running httpd, as with most system services.
    #
    User daemon
    Group daemon
    </IfModule>

    with the registered in unity user which in my case is jimver

    and the new error I get now is:

    DisplayProgressbar: Unity license [0111/095517:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on. ATTENTION: default value of option force_s3tc_enable overridden by environment. [0111/095517:ERROR:sandbox_linux.cc(308)] InitializeSandbox() called with multiple threads in process gpu-process Cancelling DisplayDialog: Failed to activate/update license. Missing or bad username and password. Please try again using valid credentials or contact support@unity3d.com This should not be called in batch mode. (Filename: /home/builduser/buildslave/unity/build/Editor/Platform/Linux/EditorUtility.cpp Line: 219)

    obviously the SUID sandbox is not loaded because "InitializeSandbox() called with multiple threads in process gpu-process" which means that Unity is initializing by using the gpu? and why multiple threads? I am using it only once.
     
  19. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    Are you still passing the -username and -password arguments? You shouldn't be.
     
  20. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    No I am not -username -password anymore.
     
  21. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    Hi, finally I got it working. My system is Ubuntu16.03.

    Here are the steps

    1) Be sure to uninstall totally unity with: sudo apt-get remove unity-editor -y
    and install Unity 5.5.0p1 (64-bit) from http://beta.unity3d.com/download/59c25c92588f/public_download.html

    install but do not run it yet.

    2) In case your lampp does not have the latest libstdc++ library, use (strings /opt/lampp/lib/libstdc++.so.6 | grep GLIBCXX) command to see if you have up to GLIBCXX_3.4.15 support

    install the latest libstdc++ library to opt/lampp/lib folder. If you have ubuntu16 do the following

    take

    a) /usr/lib/x86_64-linux-gnu/
    libstdc++.so.6
    libstdc++.so.6.0.21

    and copy them in

    b) /opt/lampp/lib/

    where
    libstdc++.so.6
    libstdc++.so.6.0.8
    exist


    hint: backup old file libstdc++.so.6 just to be safe

    3)
    Make a new unity account and ubuntu account with the same username (be sure first that it is available at Unity site)
    Change the httpd.conf user to have the same username.
    Change the permissions of the php files to have the same username owner,
    Change also the folder and subfolders where your unity project is to have the same username owner (otherwise new files can not be written from php exec)

    (I also installed php7.0-client to test running php from terminal aka: sudo apt-get install php7.0-cli but I can not confirm that this is relevant)

    Login to unity with this account you have made for unity.

    For some reason, log off-log on from ubuntu was needed to allow unity to write at /run/[myusername_numeric_id]/ directory


    4) and finally after 3 days of search,

    IT WORKS!!! (I hope it is stable)


    Now I can compile the game remotely with php from a firefox or whatever browser.
    http://mydomain/compile_request.php


    Here are the php and the called bash file that you should be inside your unity project root folder


    compile_request.php
    --------------------

    <?php
    $output = shell_exec('sh starter.sh');
    print_r($output);
    ?>


    starter.sh
    ----------

    #/bin/bash
    projectPath=`pwd`
    echo "Building in project ${projectPath}"
    xvfb-run --auto-servernum --server-args='-screen 0 1024x768x24:32' /opt/Unity/Editor/Unity -batchmode -nographics -logfile -force-opengl -quit -projectPath ${projectPath} -buildWindowsPlayer "builds/myg3.exe"



    with the -logfile parameter without stating any file, the result of the xvfb will be written in $output php variable.

    Thanks for the help Mr. Tak,

    jimver04
     
  22. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    Hi,

    after some months of inactivity I tried to compile again the project remotely with php to my linux unity3d but it does not compile the project showing various errors 1) it could not write to folder /root/.pki/nssdb; 2) that username and password did not match, 3) some SUID Sandbox errors, 4) sqlite 3 errors. I completely erased .pki and the related message dissappeared. I fixed the license use by deactivating the license from other machines and activating it only in the linux unity3d and the message dissappeared. Now I have only this which I am trying for 7 hours to solve:

    [0320/082846:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
    Failed to load cookie file from cookie: Permission denied
    ATTENTION: default value of option force_s3tc_enable overridden by environment.
    [0320/082846:ERROR:sandbox_linux.cc(308)] InitializeSandbox() called with multiple threads in process gpu-process
    [0320/082846:ERROR:connection.cc(1060)] Cookie sqlite error 14, errno -2: unable to open database file, sql: -- sqlite3_open()
    [0320/082846:ERROR:connection.cc(1060)] Cookie sqlite error 14, errno -2: unable to open database file, sql: -- sqlite3_open()

    - I uninstalled unity3d (5.5.0p1) from my ubuntu 16 and installed it again (5.5.0xp1). (What is xp ? vs p?. p version has dissapeared from downloads).
    - deactivated the license from any other machine
    - reactivate the license only in linux unity3d
    - I saw thread https://forum.unity3d.com/threads/s...-preferences-directory-fedora-22-lxde.351135/ that was stating the same problem. I erased /home/myusername/.config/unity3d to get rid of cache problems but nothing.

    - I suspect that the problem is either in file permissions or sqlite.

    - I install unity3d with ubuntu graphic environment but i uninstall it with the following command
    sudo apt-get remove unity-editor -y
    is it correct?
    Are there any remainings left from previous installations ?

    - I installed also the latest version 5.6.0b10
    but it failed to open my project from 5.5.0

    - Which folders and database are affected by Unity3d apart from the following ones?
    - opt/lampp
    - root/.pki
    - home/username/.config/unity3d

    I have not looked in sqlite3. Is there any special sqlite by unity3d or does it use the ubuntu sqlite server?

    From a search I learned that "SUID sandbox, force_s3tc_enable, InitializeSandbox() called with multiple threads" related errors are problems of compatibility of the chrome (or chromium) with the GPU card in linux systems only.

    So my search focuses now on Why sqlite3 can not open the
    home/myusername/.config/Unity3d/Unity/Browser/Cookies/Cookies.sqlite3 database file

    I gave 0777 permissions and updated the user and group but no luck yet.

    From the ubuntu terminal, I can compile the game succesfully. However, not from php remotely. So I guess that php user has not full access to open sqlite3 databases remotely.

    Thanks in advance,
    jimver04
     
    Last edited: Mar 20, 2017
  23. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    It seems that Google Chrome browser conflicts with chrome-sandbox. I completely uninstalled Chrome browser from linux and rebooted the machine. Now chrome-sandbox can access sqlite3 but I get another message:

    [0320/110807:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
    ATTENTION: default value of option force_s3tc_enable overridden by environment.
    [0320/110807:ERROR:sandbox_linux.cc(308)] InitializeSandbox() called with multiple threads in process gpu-process
    no/lib/mono/2.0'
    Mono config path = '/opt/Unity/Editor/Data/Mono/etc'
    Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56290
    Can't get home directory!

    (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 262)

    CreateDirectory '/Unity' failed: (current dir: /opt/lampp/htdocs/SimpleUnityGameProjectTemplate_v4)
    Can't get home directory!

    (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 262)

    Can't get home directory!

    (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 262)

    DisplayProgressbar: Unity license
    Can't get home directory!


    Some explanation:

    - I think for some reason Unity tries to find "home" directory inside my project /opt/lampp/htdocs/SimpleUnityGameProjectTemplate_v4 because I see it has generated a Certificates/CACerts.pem file
     
  24. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    Well after 7 hours on Friday and 6 hours today I managed to compile the project with php and 5.6.0xb10Linux version of unity. My version of ubuntu is the same one, i.e. 16.04.

    Here are the steps:
    - If you have "Chrome browser" remove it because it conflicts with chrome-sandbox of Unity
    - Remove previous unity version with "sudo apt-get remove unity-editor -y" . However, some remainings are left in many places. Delete manually the following folders:


    /root/.pki
    /root/.cache/unity3d
    /root/.config/unity3d
    /root/.local/share/unity3d

    /home/myusername/.pki
    /home/myusername/.cache/unity3d
    /home/myusername/.config/unity3d
    /home/myusername/.local/share/unity3d

    and from any other home/username/ if you have install it with another username.

    - Install the 5.6.0xb10Linux version with "Ubuntu Software" graphic tool.

    - Run Unity3d and activate a license (personal). It is important that the myusername of unity is the same with the web daemon. See my previous posts in the current thread. You do not have to create a new project after activating a license.

    Be careful not to use the same username to login to unity in another machine because it will pop out the other one in the server.

    - Be sure that the php script has the same myusername owner and it is executable.

    - Make manually the folders

    /root/.cache/unity3d
    /root/.config/unity3d
    /root/.local/share/unity3d

    and be sure that they have as owner the web daemon user which is also the unity user (myusername). I do not know about how safe it is to have at /root/ folders that belong to a certain user. Do it at your own risk.

    Thats all,
    jimver

    My major note is why when uninstalling unity3d the corresponding unity3d folders in root and home/username are not deleted !!! This costs time to find.
     
  25. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    I had to update Unity3d to the latest version 5.6.3xf1Linux or 2017.2xb6Linux on my Ubuntu 16.04.

    Unfortunately the same bug came up and the aforementioned solution is not working.

    When I try to compile the game from command line in terminal of Ubuntu it is ok. However, whenever I try to compile the game through php I get for 2017.2xb6Linux version:



    [0901/143724:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
    ATTENTION: default value of option force_s3tc_enable overridden by environment.
    [0901/143724:ERROR:sandbox_linux.cc(308)] InitializeSandbox() called with multiple threads in process gpu-process
    directory!
    (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 308)

    CreateDirectory '/Unity' failed: (current dir: /opt/lampp/htdocs/envisage/authortool/wp-content/uploads/testcompiledimitrisUnity)
    DisplayProgressbar: Unity license
    Can't get home directory!
    (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 308)

    Can't get home directory!
    (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 308)

    Can't get home directory!
    (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 308)

    Can't get home directory!
    (Filename: /home/builduser/buildslave/unity/build/PlatformDependent/Linux/SystemInfo.cpp Line: 308)

    Cancelling DisplayDialog: Failed to activate/update license. Missing or bad username and password. Please try again using valid credentials or contact support@unity3d.com
    This should not be called in batch mode.
    (Filename: /home/builduser/buildslave/unity/build/Editor/Platform/Linux/EditorUtility.cpp Line: 216)



    It seems that for some reason Unity3d tries to make the /Unity folder inside my game folder which is wrong! The correct place to make the /Unity folder is at /home/myusername/.local/share/unity3d/

    What is in Line 308 at SystemInfo.cpp ???
    How can I change the settings during compiling so that I can point to the correct folder ?

    BR,
    Dimitrios
    jimver04
     
  26. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    Try setting the HOME environment variable for that user.
     
  27. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    Wow you have right

    I have put this line in my php call

    putenv("HOME=/home/myusername"); // where myusername is the daemon of php and the logged in user of Unity3d (they should be the same

    just before the following command (See previous comments)

    $output = shell_exec('sh starter.sh');

    and now it finally works.

    Many thanks,
    jimver04