Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity Hub cannot install Unity when it needs to elevate privileges on Mac

Discussion in 'Unity Hub' started by pbhogan, Jan 24, 2018.

  1. Fantastic_Balage

    Fantastic_Balage

    Joined:
    Dec 12, 2019
    Posts:
    10
    Guys, this is seriously starts to become a joke.
    • Unity Hub does not ask for any permission (Unity Hub fault)
    • nor can I explicitly set any permission in System Preferences > Security & Privacy (OSX fault, lol)
    • If I move Unity Hub to the Bin, and launch Unity and play a projectt in editor which uses camera, it asks for permission (great hack...)
    • I have to move Unity Hub from Bin each time I want to test the camera in editor mode,
    • I have to restore Unity Hub each time I want to use collab...
    This is not the best user experience so far.

    I however congratulate to Unity to develop and maintain such a great platform since such a long time, but these small things just makes developers scream.
     
    AlejMC likes this.
  2. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    377
    Yeah, it's a pain when apps do this. JetBrains Toolbox suffers from the same issue.

    My workaround for Unity Hub is to set the Unity Editors Folder in the preferences to /Users/USERNAME/Applications/Unity

    Any user writeable folder would work, of course.
     
  3. Fantastic_Balage

    Fantastic_Balage

    Joined:
    Dec 12, 2019
    Posts:
    10
    @pbhogan thanks for your reply. I tried to install Unity editor via Hub to:
    • /Applications
    • /Users/USERNAME/Applications
    • /Users/USERNAME/Documents
    • /Users/USERNAME/Downloads
    The load bar goes to approx 1/3rd, then it vanishes completely. For me this indicates permission problems. So in System Settings > Security & Privacy I have added Unity and Unity Hub to:
    • Full disk access
    • Files & folders
    • Developer Tools
    No success. OSX Catalina.
     
    AlejMC likes this.
  4. Fantastic_Balage

    Fantastic_Balage

    Joined:
    Dec 12, 2019
    Posts:
    10
    Continuing this thread in here.
     
  5. leeprobert

    leeprobert

    Joined:
    Feb 12, 2015
    Posts:
    49
    Same issue today installing latest version of hub 2.3.1 and trying to install latest Unity. 2019.3.13 - install downloads but doesn't complete.
     
  6. gabearts

    gabearts

    Joined:
    Jun 30, 2014
    Posts:
    10
    This worked for me but will add that you can also choose your user account from the dropdown list of permissions and then add read/write permissions. Thank you!
     
    sika_js likes this.
  7. PuzzleEmptyM

    PuzzleEmptyM

    Joined:
    Jul 9, 2020
    Posts:
    1
    Still a problem. I tried installing Unity through Unity Hub and it failed at 100%. No explanation. I am doing this through a non administrator account, so that may be the problem. I will try again on an administrator account. Still a very annoying inconvenience to those who don't have the ability to download on an administrator account.
     
  8. VirginiaMSimpson

    VirginiaMSimpson

    Joined:
    Sep 3, 2020
    Posts:
    1

    Hello, I'm having a similar problem with Unity and installing it. It will download about 70%-80% and then it will say it failed to install. It does not give an error code or anything that would give me a clue as to why it won't install all of the way. What do I do?
     
  9. firstuser

    firstuser

    Joined:
    May 5, 2016
    Posts:
    147
    ROBYER1 likes this.
  10. EnergizedDane

    EnergizedDane

    Joined:
    Dec 7, 2020
    Posts:
    1
    This isn't only on Mac but also on Windows when using an office laptop where you don't have admin rights
     
  11. GunLengend

    GunLengend

    Joined:
    Sep 24, 2014
    Posts:
    54
    It's also happening with Unity Hub 2.4.2 on my Office PC running with Windows. I know it's blocked by permission but at least the Hub needs to show notification or something instead of fail in silent.
     
  12. fabischn_ethz

    fabischn_ethz

    Joined:
    Jan 18, 2021
    Posts:
    2
    Same issue on my Mac running macOS Catalina 10.15.7. Can install UnityHub as root user but cannot use or install any Unity version as non-root user.
     
    ROBYER1 likes this.
  13. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,450
    Is there still not a fix for this? Unbelievable.
     
  14. led789zxpp

    led789zxpp

    Joined:
    Jun 26, 2017
    Posts:
    1
    Ok, I finally found how to activate Unity Hub on mac. By the log, the Unity Hub tries to write temporary license file into the root location /Library/Application Support/Unity/Unity_lic.ulf, which not allowed(I think It's bug, the Unity Hub should ask me an access). So I manually moved into there, and done. The Unity_lic.ulf is from the manual license activation page.
     
  15. andreifilip

    andreifilip

    Joined:
    Feb 14, 2018
    Posts:
    2
    This worked for me too, thank you!
     
  16. DuchyofTheDutch

    DuchyofTheDutch

    Joined:
    Aug 10, 2022
    Posts:
    1
    4 years since the first post on this thread and it is still not working properly, my non-admin account is downloading but not installing.
     
  17. EdenSavings

    EdenSavings

    Joined:
    Jun 15, 2020
    Posts:
    1
    Just ran into this problem installing 2021.3.9f1 (Apple Silicon).

    How I worked around it:
    1. Navigate to /Applications/Unity/Hub/Editor in finder
    2. Right click > "Get Info"
    3. Click the small lock in bottom right to allow admin changes
    4. Under "Sharing & Permissions" change "everyone" from "Read Only" to "Read & Write"
    5. Click lock again
    6. Retry install in Unity Hub
    Worked for me, but would be nice if Unity fixed this.
     
    ebelkin likes this.
  18. EMP_Playz

    EMP_Playz

    Joined:
    Sep 8, 2022
    Posts:
    1
    How?
     
  19. BlobbyBlobb

    BlobbyBlobb

    Joined:
    Apr 14, 2020
    Posts:
    1
    I solved it by running the install in a folder in the desktop
     
  20. zoereichert1010

    zoereichert1010

    Joined:
    Nov 12, 2022
    Posts:
    1
    Installation fehlgeschlagen: Berechtigung verweigert, mkdir '/Applications/Unity/Hub'

    ich habe versucht unity hub mer rechte zu geben bringt nichts
     
  21. tjmerritt

    tjmerritt

    Unity Technologies

    Joined:
    Apr 26, 2018
    Posts:
    1
    Just ran into this problem. The Editor folder has a creation data of Jan 7 2022 when I moved to a new Laptop and the folder is owned by root. Changing the owner to myself allowed the installation of the editor to proceed.
     
  22. PlatinumDeveloper

    PlatinumDeveloper

    Joined:
    Feb 19, 2023
    Posts:
    2
    This is still a problem in 2023, I have opened the unity hub and the unity folder, > get info >sharing and permissions > access and set all to read and write and the problem still persists
     
  23. rowansimpson123456

    rowansimpson123456

    Joined:
    Sep 2, 2022
    Posts:
    5
  24. rowansimpson123456

    rowansimpson123456

    Joined:
    Sep 2, 2022
    Posts:
    5
  25. whiteb_unity

    whiteb_unity

    Joined:
    May 22, 2023
    Posts:
    1
    Five years later, this is still an issue when deploying Unity in environments where the end-user does not have Administrator rights.


    An error occurred while resolving packages:

    One or more packages could not be added to the local file system:

    com.unity.collab-proxy: EACCES: permission denied, mkdir '/Users/user/Library/Unity/cache'

    com.unity.editorcoroutines: EACCES: permission denied, mkdir '/Users/user/Library/Unity/cache'

    com.unity.ext.nunit: EACCES: permission denied, mkdir '/Users/user/Library/Unity/cache'

    com.unity.ide.rider: EACCES: permission denied, mkdir '/Users/user/Library/Unity/cache'

    com.unity....


    So after doing some testing, my fix for this is to give the logged in user ownership of the Unity folder that exists in /logged_in_user/Library/Unity

    Simple bash script for that:

    Code (JavaScript):
    1. #!/bin/sh
    2.  
    3. currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
    4.  
    5. sudo chown -R $currentUser /Users/$currentUser/Library/Unity
    I'll have to tell them to do that possibly after running unity (so the unity folder gets created) but before actually creating a project. I think? Need to test a little more to figure out order. Not sure I can automate it as the folder only gets created after they launch unity or sign-into unity for the first time.

    Edit 2: Ok, after doing some testing, I've come up with a script that you can deploy to computers that have Unity installed that will workaround permission errors for users that are not admin. (We use Jamf Pro for our MDM)
    - Script targets only computers that have Unity installed
    - Script is set to run on login, only once-per-user

    Script:

    Code (Boo):
    1. #!/bin/sh
    2.  
    3. currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
    4.  
    5. unityFolderPath="/Users/$currentUser/Library/Unity"
    6.  
    7. # Check if Unity folder exists, create it if it doesn't
    8. if [ ! -d "$unityFolderPath" ]; then
    9.     echo "Unity folder does not exist. Creating it..."
    10.     mkdir -p "$unityFolderPath"
    11.     if [ $? -eq 0 ]; then
    12.         echo "Successfully created Unity folder."
    13.     else
    14.         echo "Failed to create Unity folder. Exiting."
    15.         exit 1
    16.     fi
    17. else
    18.     echo "Unity folder already exists."
    19. fi
    20.  
    21. # Change the ownership of the Unity folder to the current user
    22. echo "Changing ownership of Unity folder to $currentUser..."
    23. sudo chown -R $currentUser "$unityFolderPath"
    24.  
    25. if [ $? -eq 0 ]; then
    26.     echo "Successfully changed ownership of Unity folder."
    27. else
    28.     echo "Failed to change ownership of Unity folder."
    29. fi
    We handle licensing via a separate script which is working great. Have not had any licensing-related Admin pop-ups. Only the ones where it's trying to make a directory in the Users Library folder.
     
    Last edited: May 23, 2023