October 23, 2017
Windows 10 and Windows Server 2016 contain a curious problem affecting interactive windows services. When you switch to Session 0, you cannot use the keyboard and mouse. This frustrating flaw makes it impossible to interact with any window displayed in Session 0. You can’t even click the “Return Now” button to go back to your regular desktop!
Hopefully Microsoft will fix this bug soon. But if you are using RDP to connect to the server running AlwaysUp, you can use the free and reliable VNC software instead, to resume normal operation in Session 0.
What is VNC?
VNC (which stands for Virtual Network Computing) is a cross-platform technology facilitating remote desktop sharing and control. It is very similar to Microsoft’s RDP. With VNC, you install a software component on the machine you wish to view/control (“the server”) and run another component installed on your local computer (“the client”) to access the server’s desktop.
Which version of VNC should I use?
Several implementations of VNC are available for Windows. We have used (and can recommend) RealVNC, UltraVNC and TightVNC, but this article will focus on TightVNC because it is:
- actively maintained
- free for both personal and commercial use
- fully supported on Server operating systems
- already installed and in daily use on our Windows Server 2016 QA/test server! 🙂
Note however that TightVNC does not currently encrypt desktop traffic. Look to UltraVNC or RealVNC Professional Edition if that is an important consideration.
How to Use TightVNC to Access Session 0 Remotely
-
Download TightVNC for Windows
-
Install TightVNC on the Remote Server
-
Run the installer on your server (the computer running AlwaysUp):
-
Accept the terms and click Next. When you get to the Choose Setup Type screen, click the Custom button:
-
On the Custom Setup Type screen, configure the tree so that TightVNC Server will be installed. We decided to omit the TightVNC Viewer since we have no need for that component on the server:
Click Next to continue.
-
We recommend sticking with the defaults on the Select Additional Tasks screen. It is best to run VNC as a windows/system service so that it starts promptly after a reboot, without anyone having to log in first:
-
The rest of the installation process should be straightforward so please proceed with your good judgment. Be sure to set strong passwords when you get to the Set Passwords step!
-
Install TightVNC on the Client
-
Launch the installer to your client computer — most likely your PC with the physical keyboard and mouse attached.
-
When you get to the Choose Setup Type screen, once again click the Custom button:
-
On the Custom Setup Type screen, configure the tree so that only TightVNC Viewer will be installed:
Click Next to continue.
-
Again, the defaults on the Select Additional Tasks screen are probably fine:
-
Follow the remaining prompts to complete the installation.
-
Run the Viewer to Connect to the Server & Switch to Session 0
-
Start the Viewer application (C:\Program Files\TightVNC\tvnviewer.exe) on your client PC. Type in the host name (or IP address) of the server and click the Connect button:
-
Next, enter the password you specified for the server (in step 2e) and click OK:
-
A window showing your server’s desktop will appear. Click the Ctrl+Alt+Del button on the toolbar to sign in to Windows:
-
Once you are in, switch to Session 0 — either from the Tools menu in AlwaysUp, or via our free Switch to Session 0 utility. You will be able to use your keyboard and mouse!
Here is our Windows Server 2016 machine with both winver.exe and Notepad running in Session 0:
Grab the latest 64-bit or 32-bit installer from the TightVNC download page. It will only be a couple of megabytes large.
We will run the installer on both the server and client machines.
After installing, TightVNC Server will be running in the background as a windows service (and will start automatically when your server boots). Check it out in Services.msc:
TightVNC Viewer will be available in the C:\Program Files\TightVNC folder. You may want to place a shortcut to the viewer application (tvnviewer.exe) on your desktop for convenience.
Caveat: Not a solution for one computer
Using the VNC remote access software won’t work if you only have a single computer setup. VNC cannot view itself — not without incurring the wrath of infinity. 🙂 For the single computer scenario, you have to wait for the folks in Redmond to wave their magic wand and fix the bug…
You may also like…
Modified on: Sun, 22 Dec, 2024 at 5:05 PM
TABLE OF CONTENTS
- What is Session 0?
- Deploy FireDaemon Zero and ZeroInput
- Reinstall your graphics drivers to avoid Session 0 black screen
- Fully patch Microsoft Windows
- Use specific service user accounts to avoid application issues on Session 0
- Keyboard and mouse does not work on Session 0 on Windows 10, 11, Server 2016, 2019, and 2022
- Session 0 is inaccessible on Windows Server Core variants
- Interactive Services Detection Service removed On Windows 10 Version 1803, 11, Server 2019, and 2022
- RDP Behaviour Changes on Windows 10, Server 2019, and 2022
- Legacy Console Mode
- Operating System Choice Considerations
- RDP Disconnections, Freezes and Hangs
- Workaround 1
- Workaround 2
What is Session 0?
Session 0 is a specialised Windows Session where all aspects of a Windows and FireDaemon Pro services including interactive GUI components (e.g. windows, dialogs, popups etc.) and other aspects (e.g. mapped drives, environment variables etc.) are displayed/instantiated in complete isolation from your regularly logged in Windows desktop session. This segregation is intentional, by design and enforced by the operating system. Session 0 Isolation first appeared in Windows Vista and Server 2008 to mitigate various security risks including shatter attacks. Session 0 Isolation is not present on earlier versions of Microsoft Windows, including Windows XP and Server 2003.
The Interactive Services Detection Service (UI0Detect) is a built-in Windows service that, when enabled, allows you to switch back and forth between your currently logged-in desktop session and session 0. The UI0Detect service has been removed from the most recent versions of Windows 10, 11, Server 2019, and Server 2022.
«Features» to note about Session 0:
- You cannot log in to it directly — you must switch to it — akin to Fast User Switching or Switch User
- It is «user-less» meaning there is no specific user account associated directly with Session 0
- It has no «normal» session characteristics (e.g. Windows Explorer, 3D graphics acceleration, screen saver, screen lock and so forth)
- It is inaccessible by default on all Windows installations. It must be enabled
- Once enabled, you may be greeted with the Windows default Session 0 «nag dialog» in your logged-in session task tray. Use this dialog to switch to Session 0.
- You may see errors or warnings in the Windows Event Logs concerning services running interactively in Session 0 being «invalid», «in error» or «disallowed». These can generally be safely ignored
- You may lose all network connectivity if you switch to Session 0. This can be problematic if you are using RDP or other remote control software
- You may see a black screen when you switch to Session 0
- You may see badly redrawn application windows and dialogs on Session 0
- You will be automatically logged out after 30 seconds of inactivity and returned to the Windows Login screen. If connecting via RDP, your RDP session will be terminated
- If you are running Windows 10, 11, Server 2016, 2019, or 2022 your keyboard and mouse will be completely ignored on Session 0 (i.e. your keyboard and mouse will appear to not work)
- Session 0 is available but inaccessible on Windows Server Core and other «headless» Windows operating system
- Legacy applications that do not have an application manifest and cannot elevate properly may not work as expected when run under FireDaemon Pro, especially those that require UAC virtualization
- Cut and paste between user sessions and Session 0 may not work.
The various sections below outline how to resolve the limitations listed above. Despite these limitations, you can continue to use FireDaemon Pro to create and run your program, application, or script as an interactive Windows service.
Deploy FireDaemon Zero and ZeroInput
Please consider deploying FireDaemon Zero and optionally FireDaemon ZeroInput if you are creating interactive services using FireDaemon Pro and you must work interactively on Session 0. These two products assist in resolving most of the issues above.
Reinstall your graphics drivers to avoid Session 0 black screen
When you switch desktop to Session 0 for the first time you might just see a completely black screen. This is completely normal. To resolve this you must completely uninstall and then reinstall your graphics drivers. If you are seeing this in a virtual machine, then uninstall and reinstall the corresponding virtual machine «helper» drivers — for example, VMware Tools. If you are running Windows 10 Version 1803 or later or Server 2019 and experience this then you will need to deploy our ZeroInput driver.
Fully patch Microsoft Windows
We have seen several Session 0 issues resolved just by patching Windows. Hence, before deploying any FireDaemon product and before attempting to use Session 0 you should fully patch your Microsoft Windows operating system via Windows Update. This means all critical and recommended patches and updates including IE11, Edge and root certificates.
Use specific service user accounts to avoid application issues on Session 0
Windows Services can run under a variety of user credentials. When using FireDaemon Pro the application will be run by default as the user LocalSystem. This account is a specialised highly privileged user account used by the Windows Service Control Manager. Running as this account might cause your application to not work properly. If you experience application issues, you should try and run the service as the specific user under which you installed the software originally. That user should always be a member of the local or domain administrator group, especially if your service is to interact with the desktop on Session 0. You can change the FireDaemon Pro Windows Service Logon Account in the logon section of that particular service.
Keyboard and mouse does not work on Session 0 on Windows 10, 11, Server 2016, 2019, and 2022
If you switch to Session 0 on Windows 10, 11, Server 2016, 2019, or 2022 your keyboard and mouse will not work. Please refer to this articlefor a detailed discussion and possible workarounds.
Session 0 is inaccessible on Windows Server Core variants
Server Core is the headless version of Microsoft Windows. Server Core is designed to be centrally managed via Server Manager. You can enable RDP on Server Core (via the sconfig utility) however, once you RDP in, you will only be presented with a single command prompt. Additionally, many GUI-based applications are not installed, or if they are installed you will need to launch them via the command line manually. Note that the Interactive Services Detection Service (UI0Detect) is not installed at all on Server Core. Whilst it’s possible to install FireDaemon Pro and set up FireDaemon Pro-based services, it’s impossible to switch to Session 0 by virtue of the Interactive Services Detection Service (UI0Detect) and all supporting features being absent.
Interactive Services Detection Service removed On Windows 10 Version 1803, 11, Server 2019, and 2022
Microsoft has removed the Interactive Services Detection Service (UI0Detect) on Windows 10 Version 1803, Windows 11, Server 2019 or later versions of Microsoft Windows.
RDP Behaviour Changes on Windows 10, Server 2019, and 2022
In the past, you could simply RDP to your machine and switch desktop to Session 0. The latest releases of Windows 10, 11, Server 2019, and 2022 impose the following restrictions:
- On Windows 10 1809 and Server 2019 when you switch back from Session 0 you will be returned to the Windows login prompt.
- On Server 2019, if you switch to Session 0 on the console session, all RDP sessions may freeze and may be terminated.
- On Windows 10 1903 and later, Server 2019, and Server 2022 or later you can now no longer switch desktop to Session 0 via RDP. Your RDP session will be terminated. You will need to use an alternate remote control product that provides access to the Windows Console Session such as VMware Remote Console, TeamViewer, TSplus or TightVNC. These products allow you to access your machine’s console session. If you use TightVNC ensure you deploy the DFMirage driver to ensure console applications running on Session 0 are displayed properly.
Legacy Console Mode
Recent versions of Microsoft Windows have a new console application mode which means console-based applications may not be displayed at all on Session 0. To ensure console applications are displayed properly you may need to enable Legacy Console Mode. This is set on a user-by-user basis. So if you are running an interactive FireDaemon Pro service then you will need to set this via the registry or manually. To set via the registry, logon as the user you intend to run the service as and set HKEY_CURRENT_USER\Console\ForceV2 to 0. Otherwise, you can set Legacy Console Mode by logging into your computer, starting a Windows Command Prompt then setting the Legacy Console Mode as per the screenshot below (right-click the top left icon in the Command Prompt):
Operating System Choice Considerations
If it’s imperative for you to continue to have access to Session 0 to manage your Interactive Windows service, then you still have the following options available to you (i.e. the operating system still has the UI0Detect / Interactive Services Detection Service present):
- Deploy Windows 8.1 or any version of Windows 10 up to and including Windows 10 1709.
- Deploy Windows 10 LTSC / LTSB instead of the retail version of Windows 10
- Deploy Server 2012 R2 or Server 2016.
RDP Disconnections, Freezes and Hangs
You may experience the following when switching to Session 0 over RDP:
- Your RDP Session will be immediately terminated or appear to hang
- You won’t be able to connect to the server again for a significant amount of time (e.g. 20+ minutes)
- All applications running in Session 0 that utilise the Microsoft message queue will freeze during that time, resuming once the blockage self-corrects.
This is a known bug in Microsoft Windows (specifically observed Windows Server operating systems). This is due to either the RDP display driver running on Session 0 crashing or the RDP User Mode Port Redirector crashing. Check the Windows Event logs to determine what is failing. This issue might also be caused by VMware’s SVGA Driver. Please see this article Switching to Session 0 Causes Desktop Failure on VMware Virtual Machines. We have no fix for this situation. Sorry about that. Try the following workarounds to see if they alleviate the problem:
Workaround 1
- Cease using RDP to connect to your machine entirely
- Use an alternate remote control product that gives you access to your machine’s console session, such as your hypervisor VM console (e.g. VMware vSphere Web Console or VMRC), TeamViewer, TSplus or TightVNC. Ensure you thoroughly test your setup to ensure access to your server and switching to Session 0 works as expected.
Workaround 2
- Ensure Windows is fully patched — everything — don’t skip anything
- Ensure you upgrade your network card and graphics drivers to the very latest available
- If your operating system is virtualised ensure your hypervisor is fully patched and you have the latest helper tools installed (e.g. VMware Tools)
- Ensure you have 3D hardware acceleration enabled for your video adapter (e.g. enable accelerate 3D graphics in VMware virtual machines and allocate at least 512MB to guest graphics memory)
- Ensure you are using the latest version of the RDP client (10.2 or later). If you are RDP’ing to Server 2016 or 2019 ensure you do so from Windows 10, 11 or other Server 2016 or 2019 computers. Avoid Windows 7, 8, or 8.1 RDP clients if possible.
- When you RDP to the problem server, ensure you have disabled all forms of drive, printer, clipboard, and audio mapping and redirection across the RDP session. This can be achieved by changing settings in your RDP client via Group Policy or Local Policy on the remote server. The screenshot below shows what needs to be changed in your RDP client configuration.
Did you find it helpful?
Yes
No
Send feedback
Sorry we couldn’t be helpful. Help us improve this article with your feedback.
Related Articles
Содержание
- Windows соединяется с сессией 0 — полное руководство
- Что такое подключение Windows к сеансу 0?
- Подробное объяснение функции подключения Windows к сеансу 0
- Основные преимущества и цели подключения Windows к сеансу 0
- Как настроить подключение Windows к сеансу 0?
- Проблемы и решения при подключении Windows к сеансу 0
- Обзор основных команд и функциональности подключения Windows к сеансу 0
- Альтернативные способы подключения Windows к сеансу 0
Windows соединяется с сессией 0 — полное руководство
В операционных системах Windows выше версии Windows Vista введено понятие сеанса 0 — это сеанс, который связан с системной консолью и является первичным для всех пользователе. Сеанс 0 — это специальный сеанс, который запускается при загрузке операционной системы и остается активным на протяжении всего времени работы компьютера.
Когда пользователь входит в систему, он или она подключается к одному из пользовательских сеансов, обычно это будет сеанс с идентификатором больше 0. Тем не менее, некоторые задачи и службы могут требовать доступа к сеансу 0, чтобы выполнять определенные функции или взаимодействовать с системой на более низком уровне.
Однако, начиная с Windows Vista и выше, для обеспечения безопасности и защиты системы было введено ограничение доступа к сеансу 0. Теперь, даже при наличии прав администратора, пользователь по умолчанию не имеет доступа к сеансу 0.
Тем не менее, есть несколько способов получить доступ к сеансу 0. Например, вы можете использовать инструменты, такие как PsExec или сеанс для подключения к сеансу 0 и выполнения команд или запуска программ на этом сеансе.
Важно отметить, что доступ к сеансу 0 должен быть тщательно контролируем и использован только для конкретных задач, таких как установка служб или отладка системы. Ошибочное использование сеанса 0 может привести к нестабильности системы или нарушению безопасности.
В этой статье мы более подробно рассмотрим, что такое сеанс 0, как получить к нему доступ и какие могут быть возможности использования сеанса 0 для разных задач. Мы также обсудим меры предосторожности и лучшие практики для работы с сеансом 0 в Windows.
Что такое подключение Windows к сеансу 0?
Обычно пользователь работает в рабочем сеансе, который создается при входе в систему, но он не имеет прямого доступа к Сеансу 0. Однако есть ситуации, когда подключение к Сеансу 0 может потребоваться.
Цель подключения Windows к Сеансу 0 может варьироваться в зависимости от конкретных потребностей пользователя или системного администратора. Одним из примеров может быть необходимость управления службами, работающими в Сеансе 0, или отладка приложений, запущенных на низком уровне операционной системы.
Подробное объяснение функции подключения Windows к сеансу 0
Обычно доступ к сеансу 0 ограничен пользовательскими интерфейсами из соображений безопасности, но в некоторых случаях необходимо подключаться к этому сеансу. Например, чтобы управлять системными службами или иметь доступ к функциям, которые требуют привилегированного доступа к операционной системе. Режим сеанса 0 также используется для автоматического входа на компьютер без взаимодействия пользователя в определенных ситуациях.
В Windows 8.1 и выше функция подключения к сеансу 0 была перенесена в черный список по умолчанию из соображений безопасности, но ее можно разблокировать при необходимости. Чтобы подключиться к сеансу 0, вам понадобятся привилегии администратора и следующие шаги:
- Откройте командную строку с правами администратора.
- Введите команду «sc config UI0Detect start= auto» и нажмите Enter.
- Введите команду «sc start UI0Detect» и нажмите Enter.
- Теперь вы можете подключиться к сеансу 0 с помощью специальных инструментов, таких как Sysinternals PsExec.
Основные преимущества и цели подключения Windows к сеансу 0
Одним из главных преимуществ подключения Windows к сеансу 0 является возможность удаленного администрирования серверов. Это особенно важно в случае наличия нескольких серверов, для которых требуется доступ к одному единственному рабочему столу. Подключение к сеансу 0 позволяет администраторам управлять серверами удаленно, настраивать и обслуживать их, не прерывая работу.
Кроме того, подключение Windows к сеансу 0 часто используется в области виртуализации. В случае, когда требуется запустить несколько виртуальных машин на одном компьютере, подключение к сеансу 0 позволяет пользователям одновременно работать с несколькими виртуальными окнами, без необходимости переключаться между ними. Это существенно повышает эффективность работы и удобство использования виртуализационных решений.
В целом, подключение Windows к сеансу 0 является важным инструментом для различных сценариев работы с компьютерами и серверами. Оно обеспечивает удобство удаленного администрирования и управления, а также повышает эффективность работы при использовании виртуализации. Поэтому все больше пользователей обращаются к этому методу подключения, осознавая его преимущества.
Как настроить подключение Windows к сеансу 0?
Windows может подключаться к сеансу 0, чтобы позволить пользователю удаленно управлять компьютером через интерфейс командной строки. Это полезная функция для системных администраторов, которым нужно выполнять задачи на удаленных компьютерах без необходимости физического доступа к ним. Но как настроить это подключение в Windows?
Первым шагом является открытие командной строки с правами администратора. Для этого в меню «Пуск» найдите «Командная строка», нажмите правой кнопкой мыши на результате поиска и выберите «Запустить от имени администратора». В открывшемся окне командной строки введите следующую команду:
- sc config UI0Detect start= auto
Эта команда настраивает службу обнаружения сеанса 0 на автоматический запуск. Затем введите следующую команду, чтобы запустить службу:
- sc start UI0Detect
Теперь, когда служба запущена, вы можете подключиться к сеансу 0, используя команду «mstsc /admin». Например, введите следующую команду в командной строке:
- mstsc /admin
Это откроет окно удаленного рабочего стола, которое позволяет вам управлять компьютером, подключившись к сеансу 0. Теперь вы можете выполнять необходимые задачи на удаленном компьютере, не покидая свое рабочее место. Удачи с настройкой подключения Windows к сеансу 0!
Проблемы и решения при подключении Windows к сеансу 0
Проблемы с подключением к сеансу 0 обычно связаны с изменениями, внесенными в безопасность операционной системы Windows. В более новых версиях Windows были введены ограничения на вызов функций API от имени пользователей, работающих в безопасном режиме. Это означает, что приложения, запущенные в сеансе 0, не имеют доступа к ресурсам и настройкам, связанным с текущим пользователем.
Однако существуют решения для подключения к сеансу 0. Одним из них является использование стороннего программного обеспечения, такого как PsExec, который позволяет запускать программы в сеансе 0. Другим решением является использование служб вместо пользовательских программ. Службы не ограничены ограничениями, связанными с сеансом, поэтому они могут запускаться и работать в сеансе 0 без проблем.
Обзор основных команд и функциональности подключения Windows к сеансу 0
Если вы хотите подключиться к сеансу 0, вы можете использовать команду «tscon». Команда «tscon» позволяет подключиться к определенному сеансу, используя его ID. Например, если вы хотите подключиться к сеансу 0, вы можете выполнить команду «tscon 0». После успешного выполнения команды вы будете перенаправлены на рабочий стол сеанса 0.
Подключение Windows к сеансу 0 — это мощная функциональность, которая предоставляет пользователю гибкость и контроль над рабочим столом и службами операционной системы. Зная основные команды и функции, связанные с подключением к сеансу 0, вы сможете эффективно использовать данный ресурс и выполнять необходимые задачи.
Альтернативные способы подключения Windows к сеансу 0
Один из способов подключения к сеансу 0 — использование программного обеспечения удаленного рабочего стола. С помощью подключения к удаленному рабочему столу, вы можете получить доступ ко всем службам и процессам, работающим в сеансе 0, даже если вы находитесь в другом сеансе пользователя или на другом компьютере. Этот способ требует наличия соответствующего программного обеспечения и прав доступа к сеансу 0, чтобы получить полный доступ ко всем его функциям и возможностям.
Другой альтернативный способ — использование инструментов командной строки Windows, таких как PsExec или Task Scheduler. С помощью этих инструментов вы можете запускать процессы в сеансе 0 без необходимости прямого подключения к нему. Использование командной строки может быть сложным для некоторых пользователей, поэтому рекомендуется ознакомиться с соответствующей документацией или получить помощь от специалиста, чтобы правильно использовать эти инструменты.
Альтернативные способы подключения Windows к сеансу 0 предоставляют пользователю большую гибкость и возможности для выполнения задач в фоновом режиме. Важно помнить, что использование этих способов требует хорошего понимания операционной системы и правильного настройки, чтобы избежать возможных проблем или нарушений безопасности. Перед использованием любого из этих способов, рекомендуется ознакомиться соответствующей документацией или получить помощь от компетентного специалиста.
Когда Windows подключена к сеансу 0, пользователь может контролировать все активные процессы и службы, работающие на компьютере. Это означает, что пользователь может управлять системными ресурсами, настройками безопасности и задачами без необходимости физически находиться перед компьютером. Такой удаленный доступ к сеансу 0 позволяет эффективно выполнять административные задачи и устранять проблемы с системой.
Связь с сеансом 0 также важна для разработчиков и тестировщиков программного обеспечения. Взаимодействие с сеансом 0 позволяет им отлаживать приложения и проверять их работоспособность в режиме реального времени. Это значительно упрощает процесс разработки и позволяет быстро выявлять ошибки и улучшать программное обеспечение.
Таким образом, подключение Windows к сеансу 0 имеет большую значимость для пользователей, предоставляя им удобство удаленного управления и обеспечивая возможность эффективно работать с системными ресурсами. Эта функциональность особенно полезна для администраторов систем и разработчиков программного обеспечения. Подключение к сеансу 0 способствует повышению производительности и эффективности работы с операционной системой Windows.
When you Remote Desktop to a Windows XP Professional computer, you always connect to the console session. This is the default for Remote Desktop to Windows XP Professional. When you remote desktop to a Windows Server 2003 computer, the default is to start a new session. But you can easily connect to the console session of a Windows Server 2003 computer using the /console switch. This is nice because at work I run Windows Server 2003 as my operating system. Then when I go home and Remote Desktop to my work computer, I can get to all of my currently running applications without having to start them up again.
To start Remote Desktop in console mode, run this from the command-line:
mstsc /console
UPDATE (8/15/2008): Windows Vista remote desktop client does not use the /console switch anymore. It now uses a different switch (/admin) to get to the console session on the server (thanks Drewskie):
mstsc /admin