Ошибка could not get temp directory

В ферме RDS с использованием дисков профилей (User Profile Disks) возникает проблема с установкой плагинов в браузере Google Chrome:

«COULD_NOT_GET_TEMP_DIRECTORY»

Решение:

1. Создаем папку вида C:tempusername

2. Меняем пользовательские переменные среды для TMP и TEMP — напрявляем их в папку из п.1

изначально они имеют вид:

меняем на:

(возможно, пользователю на время придется дать права локального администратора)

3. Перелогиниваемся на тот же терминальный сервер

4. Успешно устанавливаем плагин

5. Затем можно все возвращать назад:
-меняем переменные среды на изначальное значение вида %userprofile%appdatalocaltemp
-удаляем созданную ранее папку C:tempusername

Table Of Contents

  1. Symptom
  2. Solution

Symptom

In this article, I will explain how to resolve the COULD NOT GET TEMP DIRECTORY error simply.

COULD NOT GET TEMP DIRECTORY

From my research this error appears on RDS (WS2012R2) servers using User Profile Disks (UPD).

This error occurs when a user tries to install an extension on Google Chrome, I first think of a problem of right, with the admin account I got the same message, so I search on Google and I came across this article (in English) which explains why and how to solve it.

I first tested the solution with an account made the changes by hand on the environment variables and I was able to install my Chrome extension.

Solution

First, you must create on each RDS server, a TEMP folder at the root of the C with write / modify rights for everyone.

Then you have to set up a GPO, which does two things:

  1. For each user who logs in to create a personal folder in the C: TEMP folder
  2. Modify TEMP and TMP environment variables

There are two settings to apply at the user level.

1 – Creating the personal folder in the TEMP folder:

2 – Modification of environment variables:

All you have to do is close and reopen the sessions to install the Chrome extensions without error.



You’re here because you or your users are receiving the error «Could Not Get Temp Directory» when you try and install a Chrome Extension within their RDP session that uses UPDs (User Profile Disks).

This happens from my research because the Chrome installation process doesn’t recognise the UPD mounted user volume as a valid local disk because there is no drive letter associate with it.

So how do you fix it? The best method I’ve found is to utilise a local TEMP folder with a sub-directory for each user that is created temporarily on each of the session hosts and change the Environment Variables for the TEMP and TMP folders to point to this location. In my case I created a C:Temp folder with permissions set for Domain Users to be able to modify content.

I created a GPO with the following settings and applied it to the users OU:

Then edit your newly created GPO and create two new Environment Variables by right clicking User Configuration > Preferences > Environment and selecting New > Environment Variable then apply the settings outlined below:

As an additional setting, ensure you add an Item-level Targeting option that only applies this GPO to the RDP session hosts. There is no need to apply this to all machines on the network.

Now we’re going to ensure the folders are created when the users log onto the RDP server. Follow the instructions on the screen shot below:

You’ve now complete the GPO portion of the setup. Now log onto your session host servers and apply the GPO via the command line by using:

gpupdate /force

For this to be applied to each user, they need to log off their RDP session properly, not just disconnect their session. Then log back on and now they should be able to install Chrome Extensions without issue.

If you’ve found this useful, you may want to sign up to our newsletter where you’ll receive notices on when we post new articles and helpful «how tos». Just fill out your details below and we’ll do the rest…

Google Chrome Help

Sign in

Google Help

  • Help Center
  • Community
  • Google Chrome
  • Privacy Policy
  • Terms of Service
  • Submit feedback

Send feedback on…

This help content & information

General Help Center experience

  • Help Center
  • Community

Google Chrome

Problem:  

RDP users cannot install Chrome extensions from the Chrome Web Store.

Errors:

  • Could not install package
  • COULD_NOT_GET_TEMP_DIRECTORY

Problem:  

RDP users cannot install Chrome extensions from the Chrome Web Store.

Errors:

  • Could not install package
  • COULD_NOT_GET_TEMP_DIRECTORY
Figure 1:  Chrome Temp Directory Error

Solution:

  1. User logs
    onto RDP.  User does not open Chrome.
  2. Admin creates a new directory on the system drive.  This new directory holds user Chrome AppData.  For example: 
    c:\mkdir c:TempRDP
  3. Move user’s Chrome AppData to the new directory.  For example:
    c:move "c:usersstevenjordanAppDataLocalGoogleChrome" "c:tempRDPstevenjordan"
  4. Delete
    original folder if necessary. 
  5. Create new
    symbolic junction where the old data was located.  This junction links to
    the new location:

c:mklink /j c:usersstevenjordanAppDataLocalGoogleChrome
"c:tempRDPstevenjordanChrome"

Junction created for c:userssmjordanAppDataLocalGoogleChrome
=== c:tempRDPstevenjordanChrome
Figure 2:  New Symbolic Junction for Chrome extension.

Analysis:

Chrome extensions reference DOS device paths.  Let’s consider how dynamic profile disks use symbolic junctions that point to different disks:

c:Users  dir 
02/23/2018  11:29 AM  bgates {??Volume{a5ae22c7-18b8-11e8-968e-00145de79140}

The junction link causes the problem.  Ironically, a second junction link fixes this issue:


c:UsersbgatesAppDataLocalGoogle dir
 
 Directory of c:UsersbgatesAppDataLocalGoogle

02/20/2018  10:58 AM   DIR
02/20/2018  10:58 AM   DIR
02/20/2018  10:58 AM   JUNCTION  Chrome c:tempRDPbgatesChrome
09/16/2015  07:46 AM   DIR       Chrome Cleanup Tool
05/14/2014  06:09 AM   DIR       CrashReports
03/11/2014  04:26 PM   DIR       Google Talk
12/04/2017  02:27 AM   DIR       Software Reporter Tool

0 File(s)              0 bytes
7 Dir(s)  36,942,458,880 bytes free

Note how the new junction link points to the system drive.

Additional Thoughts:

This solution is implemented on a per-user basis.  It does not universally «fix» Chrome extensions for all RDP users.  Nonetheless, it may be a good fit because it narrows the scope of untrusted applications.

Alternatively, use Group Policy to change user environmental variables:

Group Policy
→ Computer Configuration
      → Administrative Templates
         → System
            → Group Policy
               → Configure user Group Policy loopback processing mode:
                       Enabled:  On
                       Mode:  Merge

   → User Configuration
      → Windows Settings
         → Preferences
            → Environment (right-click) → New
               → New Environment Properties:
                      Action:  Update
                      User Variable=Check
                      Name=Temp
                      Value=c:TempRDP%USERNAME%
              → Environment (right-click) → New
                      Action:  Update
                      User Variable=Check
                      Name=TMP
                      Value=c:TempRDP%USERNAME%

This change has a wider-scoping impact.  It affects all related AppData programs -not just Chrome.  It impacts all RDP users (without GP filtering).  Avoid the system drive if possible -use a secondary disk instead.  In addition, loopback processing applies user configurations to computer objects (i.e., RDP servers).

That’s It!

References:
https://blogs.technet.microsoft.com/grouppolicy/2009/05/13/environment-variables-in-gp-preferences/
https://devtidbits.com/2009/09/07/windows-file-junctions-symbolic-links-and-hard-links/

https://blogs.msdn.microsoft.com/jeremykuhne/2016/04/21/path-format-overview/
https://blog.brankovucinec.com/2017/01/09/users-cant-install-google-chrome-extensions-on-rds-farm/

Network Administration

RDP

Возможно, вам также будет интересно:

  • Ошибка could not get debug privilege are you admin
  • Ошибка could not instantiate mail function cs cart
  • Ошибка could not get client dll
  • Ошибка could not initialize steam
  • Ошибка could not find zone call of duty

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии