The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


Interactive Services Detection Service Removed in Windows 10 (so no more Switching to Session 0)

Session 0 is Off Limits

Microsoft has finally done it. Session 0 is officially off limits.

The Interactive Services Detection Service — necessary to switch to Session 0 — has been removed in Windows 10 Version 1803 (released in April 2018). While applications running in Session 0 will happily create windows and prompts, no one will be able to see them.

But this is no big surprise. The geeks in Redmond have been marching in this direction for many years.

A brief history of Session 0 and Interactive Windows Services

Windows NT (1993)

The concept of multiple login sessions in solidified in this foundational release of Windows. Session 0 is created at boot, interactive Windows Services are supported and the first user to log in is placed in Session 0.

Windows Vista (2007)

To avoid shatter attacks, Vista prohibits users from logging in to Session 0. That new world order is dubbed “Session 0 Isolation”. The Interactive Services Detection service is introduced to allow users to temporarily access Session 0 — a band-aid for interactive Windows Services that show windows and prompts.

Windows 8 & Windows Server 2012

Microsoft continues to discourage interactive services. The NoInteractiveServices registry value, which enables the Interactive Detection Service and switching to Session 0, is set to 1 by default. This prevents anyone from switching to Session 0 (unless the registry is updated).

Windows 10 & Windows Server 2016

The keyboard and mouse no longer function in Session 0. This unwelcome behavior was widely thought to be a bug that Microsoft would eventually resolve, but it now looks like a deliberate action intended to cripple interaction with Session 0.

Windows 10, version 1703 (2017)

Microsoft promises to remove the Interactive Services Detection service in this Spring Creators Update but for some reason the service remains.

Windows 10, version 1803 (2018)

The Interactive Services Detection service is officially removed. Switching to Session 0 is forbidden.

So what exactly are the ramifications of losing the Interactive Services Detection service?

Consequence #1: You won’t be able to switch to Session 0 from AlwaysUp on Windows 10

While your application will continue to run as normal in Session 0, attempting to switch to Session 0 will result in an error (reported on the Status Bar):

AlwaysUp: Switch to Session 0 fails
To see your application’s windows on your desktop, please restart your application in the current session. That option is available from the Application menu:
Restart in the Current Session

Consequence #2: Our Switch to Session 0 utility won’t work on Windows 10

Switch to Session 0 will run happily in your taskbar but you will encounter an error when you try to switch. Not surprisingly, the message says that the Interactive Services Detection service “does not exist as an installed service”:

Switch to Session 0 Error

Sayonara Session 0!

Posted in Windows Services | Tagged , , , , , | 8 Comments

Q & A: How can I see my Java Console Window when Running as a Service with AlwaysUp?

Q & A -Show Java Console Window
  I am running a Java application as a windows service with AlwaysUp. My JAR starts up fine and seems to be working as expected but I can’t see the Java console window to make sure that there are no errors. How can I see the console window?

— Alain Thiré, Thikro

Hi Alain. You cannot see your Java console window because it is running in a different Windows “Session”.

Let me explain a bit about Sessions and how they work:

  1. When you log into your PC, Windows creates a Session for you. That Session holds your desktop and all the programs you start. All your applications (processes) run inside that Session. Think of the Session as your own private room, holding all your things.

  2. If your wife logs in, she receives her own Session to hold all the applications she uses. Her Session is completely separate from yours and any program she starts will only be visible to her on her desktop. She gets her own private room.

  3. When your computer starts, windows creates a special Session for all services. That is, Windows Services have their own room. And because this is the first Session created, it is named Session 0.

Now when AlwaysUp starts your application as a Windows Service, it launches it in Session 0 (the home for all Windows Services). And because you are logged into a completely different Session (perhaps Session 1 or Session 2), you will not be able to see your application’s windows on your desktop. Your Java application isn’t in your room.

But fortunately that is not the end of the story. Here are three ways to see what Java is printing to the console.

Solution #1: Temporarily Switch to Session 0

Windows gives you the opportunity to view the Session 0 desktop whenever a window is displayed there. Click View the message when the Interactive Services Detection alert pops up:

Interactive Services Detection Dialog

AlwaysUp allows you to access Session 0 at any time. Simply select Tools > Switch to Session 0 from the menu:

Switch to Session 0 from the Menu

Or click the “monitor” button on the toolbar to do the same:

Switch to Session 0 from the Toolbar

Now be warned — Session 0 is a strange looking place! You won’t see a task bar, desktop icons or the familiar start button. Here is what the austere Session 0 looks like with Notepad running:

Session 0 with Notepad Running

Click Return now to revert to the safety of your normal desktop.

Note: Switching to Session 0 may not be a viable option on Windows 10 and Windows Server 2016 because you will be unable to use the keyboard and mouse in Session 0. Unfortunately there is no workaround and we cannot confirm if/when Microsoft will address this annoying problem.

Solution #2: Restart your Java application in your Session

A second way to view the Java window is to have AlwaysUp restart your Java application in your login session. Select Application > Restart in this session to have the console appear on your desktop, alongside your other windows:

Restart in this session

AlwaysUp will automatically return your application to Session 0 after you log off (or you can return it manually).

The obvious downside of this approach is that your application has to be stopped. Might a brief interruption cause problems? If so, restarting in your session may not be the solution for you.

Solution #3: Capture the Java console output to a file

The final solution reframes the problem. Instead of seeing the Java console window, is viewing the text printed in the window good enough?

If so, setup AlwaysUp to capture the console output to a text file. Activate the option and specify the full path to the log file on the Extras tab:

Capture Java console output

Simply open the text file to see what Java has printed to the console. Or even better, use a free “tail” utility to follow the file’s additions in real time. Both Powershell’s Get-Content cmdlet and Tail for Win32 have worked well for our team.

Best of luck with your Java application/service!

Posted in AlwaysUp | Tagged , , , , , | Leave a comment

Q & A: Why is AlwaysUp Reporting the Wrong CPU and Memory for Backup and Sync?

Q & A - Backup and Sync
  I am using AlwaysUp for Google Backup and Sync as a windows service. My files are syncing but in checking the processes on the server, Backup and Sync is showing 30% CPU usage and 688 MB memory. Yet AlwaysUp in its daily reports quite often shows CPU as 0/0 and Memory as 2.2/11. As you can see the average is suspect and the peak is way off. Am I missing something in setting up the daily reports?

— Oscar Romo, TECHsperience

Hi Oscar. Your configuration is not to blame. That puzzling situation is the result of how Backup and Sync operates. Let me explain.

Backup and Sync runs in an executable named googledrivesync.exe. The Task Manager will show that process running on your server:

googledrivesync.exe in Task Manager

But wait — why are there two googledrivesync.exe processes??

If we pull out the big guns (i.e. Microsoft’s excellent Process Explorer) to investigate, we see that the first instance of googledrivesync has spawned the second as part of normal operation. And furthermore, while the first process is idle, the second/child process seems to be working pretty hard (its CPU is almost 50%):

googledrivesync.exe in Process Explorer

This “two-process operation” explains the discrepancy you have noticed.

When AlwaysUp launches Backup and Sync, it monitors the first googledrivesync.exe process that was created. Because that process doesn’t use much CPU or RAM, AlwaysUp will present very modest numbers in its daily and weekly summary reports.

However, when you check the processes on the server, you are likely looking at the second googledrivesync.exe process. That child process seems to be doing the heavy lifting, leading to higher CPU and RAM values in Task Manager.

The end result is that the CPU & memory measurements in AlwaysUp’s reports may not be very useful when running Backup and Sync as a service. Sorry about that. Rest assured that your files will always be copied though, which is the main job you hired our software to perform. 🙂

Please be sure to get in touch if you have any followup questions.

Happy syncing!

Posted in AlwaysUp | Tagged , , , | Leave a comment

Running Multiple Windows Services? AlwaysUp 11 is Here to Help!

Check out what's new in AlwaysUp 11

With all the excitement of a freshly minted high-school graduate, we are pleased to announce the release of AlwaysUp version 11!

This major update maintains laser focus on the software’s singular purpose — running your important applications and programs 24×7, as Windows Services.

But if you are one of the thousands of individuals and companies managing more than a single application, pay attention. These changes may deliver delight. 🙂

Introducing Tags for Applications

You can now associate one or more tags with each application. Tags are specified on the General tab when editing your application:

Adding Tags to a Windows Service

The new “Tags” column on the main window lists all the tags you have assigned to your applications:

AlwaysUp Application Tags

Managing Tags for Multiple Applications

Instead of adding or removing tags from each application individually, you can also update multiple applications at once. To do so, select the applications you would like to change and choose the appropriate operation from the “Application” menu:

AlwaysUp Tags Menu

Selecting Add… brings up the Add Tags window. Enter (or choose) the tags you wish to apply to the selected services and click Next to proceed:

Add Tags to Multiple Services

Remove All summons the Remove Tags window to wipe away all tags from the selected applications:

Remove All Tags from Multiple Services

Filtering the List of Applications

The new Filter Pane allows you to easily filter the list of applications. Select View > Filter Pane (or hit the F3 key) and the new controls will appear underneath the toolbar:

AlwaysUp Filter Pane

The list of applications can be filtered in three ways:

  1. By tag: Select a tag to show only applications with that tag
  2. By text: Type in text to match only applications featuring that text
  3. By disabled/enabled status: Easily exclude applications that have been disabled.

When filtering by text, cells containing the search text will be highlighted:

Filter Pane: Text Highlighting

See More Applications by Hiding List Headers

Screen space is precious when managing 50+ services. To help with that situation, you can now select View > List Headers to hide the attractive (but hefty) panel above the list of applications.

But why stop there! Hide the Toolbar and Status Bar (also via the View menu) to produce a spartan, streamlined look:

Filter Pane: Text Highlighting

Other fixes & improvements

  • Loading the Activity Panel could take several seconds if your Windows Event Logs contained thousands of entries. With AlwaysUp 11, the same process will take less than a second.

  • When capturing your console application’s output to a file, the data is flushed more frequently. This makes the process highly responsive. Long periods of inactivity are handled with greater efficiency as well.

  • To stop a customer running over 80 applications from slapping himself in the head whenever he accidentally selected “Start All” from the “Application” menu, AlwaysUp now confirms some lengthy operations involving more than 5 applications.

  • The setting on the Logon tab to hide the application’s windows in Session 0 (to avoid unwelcome alerts from the Interactive Services Detection service) has been renamed for clarity.

As usual, please review the version history for the full list of features, fixes and improvements included in this release.

Upgrading to AlwaysUp Version 11.0

As per our upgrade policy, if you purchased AlwaysUp version 10 (after January 2017) you can upgrade to version 11.0 for free. Just download and install “over the top” to preserve your existing applications an all settings. Your registration code will continue to work.

If you bought AlwaysUp version 9 or earlier (before January 2017), you will need to upgrade to use version 11.0. Please purchase upgrades here — at a 50% discount.

Enjoy!

Posted in AlwaysUp | Tagged , , | Leave a comment

Manage Your Windows Services with Windows Admin Center

In April 2018, Microsoft released Windows Admin Center (WAC) — a new web-based tool for managing PCs remotely.

With Windows Admin Center, administrators can perform many routine tasks from the browser, including:

  • List all processes on your PC
  • Start a new program or terminate one already running
  • Start, stop or restart any windows service
  • Browse the event logs
  • Navigate the registry
  • Change an account’s password

Check out WAC’s left sidebar to get an idea of what is possible:

Windows Admin Center: Overview

As experts in Windows Services, we were very excited to see what Microsoft is doing in that area! This article highlights the functionality we discovered in the Services section.

Working with Windows Services

When you click Services in the left sidebar, a list of all windows services installed on your computer is displayed on the right. Here we see that there are a whopping 241 services available on our Windows 10 machine!

Windows Admin Center: Services

The ability to search comes in handy when you are looking for a specific service. Type in a few characters to match on the name, display name and description fields:

WAC: Search Windows Services

Select a service from the list to reveal its very basic details in the panel below. Only the service’s name, display name, description and a list of dependent services are shown:

WAC: Windows Service Details

You can start, stop, pause or resume the selected service using the buttons at the top. There is no button to restart the service, but obviously that can be achieved by stopping then starting again.

To show additional details and update the service, click the Settings button at the top. Here is what we see for the important Dhcp service:

WAC: DHCP Service: General Settings

In the General section, you can change the service’s startup mode to dictate when Windows launches the service. Curiously, Automatic (Delayed Start) is not an option!

WAC: No Automatic (Delayed Start) Startup Mode

Microsoft will surely rectify that oversight soon.

Another surprise: You can alter the service’s command line (path to executable)! In that respect, WAC is more powerful than the venerable Services Control Panel application, which shows the image path as read-only.

If you click over to the Log On section, you can set the account in which the service will run. No surprises there:

WAC: DHCP Service: Log On Settings

In the Recovery section, specify one of four actions to be taken if the service fails:

WAC: DHCP Service: Recovery Settings

Note that not all options available in Services.msc are configurable here. For example, you cannot append a fail count to the end of a command line or configure options when restarting the computer:

WAC: Missing Service Recovery Options

Be cautious when changing your service’s recovery settings from WAC!

Installing Windows Admin Center: The Fine Print

While we were clearly able to get WAC up and running, we encountered a few obstacles along the way. We mention them here for future travelers:

  • WAC only runs on Microsoft’s newest operating systems. We had to upgrade our Windows 10 machine to Build 1709 (the lone desktop OS supported).

    Windows 10 Build 1709
  • WAC has only been tested with the Microsoft Edge and Google Chrome browsers on Windows 10. Firefox fanatics and Safari supporters may be out of luck.

  • If you have trouble with authentication, make sure that the WinRM service is running. Despite being configured to start automatically, that service wasn’t running and we had to start it manually on our PC.

    Run NET START WinRM to do the honors.

  • After we added our PC to the list and tried to connect, WAC repeatedly told us that our credentials weren’t valid. We tried several accounts (all with admin access) to no avail.

    The problem? Our PC is in a Workgroup instead of a Domain and we’re not using the builtin admin account. Fortunately we came across this page which advised us to run this magical command (verbatim) from an elevated prompt:

    REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1

  • Check out the full list of admin center troubleshooting tips if you run into anything else.

Enjoy!

Posted in Windows Services | Tagged , , , | Leave a comment