Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

shutdown sequence/reboot

Post Reply
ruamdro
8
8
Posts: 9
Joined: 2010-08-06 11:37

shutdown sequence/reboot

Post by ruamdro »

Hello
VNC ist installed on WXP x32.
On the server machine there are applications running which requires a user intervention <OK> on shutdown. (access for exampe).

If i start a reboot via VNC, the VNC connection is terminated instantly.
The the user dialog pops up, on the client, the shutdown process stops until someone presses OK..
A reconnection is not possible as the vnc driver seems to be already
down.

Using an RDP session does not work, because the old user is still logged on.
So the RDP asked "him" to shut down, but no one is there to say OK...
So i have to make little journey just to press "OK" on the VNC server...

I know that older versions of VNC terminates the connection instantly too, but a reconnect was possibile near to the final end (saving user setings -screen or so)

a) What can i do to lock the vnc server running until the bitter end
of the shutdown?
b) Is there an other way to shutdown remotely as a work arround?
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: shutdown sequence/reboot

Post by B »

I believe you're thinking about this wrong -- it's going to be a crapshoot as to just when VNC closes during a system shutdown.

Why not just identify the processes that you know require this sort of thing, and close them manually, e.g., via Task Manager, before shutting down?

Even more simply, just try using "shutdown -r -f" from the command line. That should close the applications regardless of their prompts.
ruamdro
8
8
Posts: 9
Joined: 2010-08-06 11:37

Re: shutdown sequence/reboot

Post by ruamdro »

[quote="B"]I believe you're thinking about this wrong -- it's going to be a crapshoot as to just when VNC closes during a system shutdown.

Why not just identify the processes that you know require this sort of thing, and close them manually, e.g., via Task Manager, before shutting down?

Even more simply, just try using "shutdown -r -f" from the command line. That should close the applications regardless of their prompts.[/quote]

Thanks, but i did't ask for an analysis of my mind :-)
I think my thinking is pretty OK so far:-))

I know i am a human. I know i make mistakes. I know it's very likely to
over see a running thread. So it's very likely to lock noneself out.# with the current configuration of VNC.
OK it's not common practise to shutdown a PC remote. But so it's a greater booby trap to step in.

I know older version of vnc did not show this behaviour.
(maybe because it uses the mirror driver? I can't make it run with that lastest stablke 1.0.8, there seems to be only an older version avaiable, which is not accepted by 1.0.8. But that should not matter.)

Why is it usefull to shut down the (remote!) video first?
Please tell my. I really do not see any sense in doing so.

I know that for example cisco router have a "commit <time>" command, just in case the admin is so stupid to shoot himself into the foot.
If the admin do not commit the setting during <time> (because him can't reach box anymore) the setting will be reverted to the previous state.

If i could enter that shutdown, why can't UVNC can do it?
But that would be only a work arround, because usually the final dialog makes sense, for example in "access" to remove the lock file.

I too could program some magic batch that emulates some kind of
"commit timeout" in the shoutdown sequence and restarts the vnc server
(if still possible) if the shutdown down lasts more than 30sec.
But there i would have the same problem:How to prevent that watchdog beeing shutdown first?

Or: why can't VNC warn before the shutdown that there are still running tasks?

So, what's the best way to windows not to shutdown the vnc server first?
ruamdro
8
8
Posts: 9
Joined: 2010-08-06 11:37

Re: shutdown sequence/reboot

Post by ruamdro »

[quote="B"]I believe you're thinking about this wrong -- it's going to be a crapshoot as to just when VNC closes during a system shutdown.
[/quote]

BTW:
What do you exactly mean with the term "crapshot"?
And what is crapshooted in your opion?
Why should it be "rsísky"?
(English is not my mother tongue as you might have noticed)
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: shutdown sequence/reboot

Post by B »

Sorry, I'm really not understanding you.

1. By "crapshoot" I meant that there's just no good way to determine exactly when VNC itself will shut down, after you have initiated a global Windows shutdown sequence. So it would be foolish to rely on VNC access after the shutdown has begun. You would never be able to be certain that you would have control at any given moment. (I didn't use the word risky.)

2. You've lost me completely with your post above; I have no idea why you mention video, and I don't understand what you're trying to say. My apologies.

3. The comment about "thinking about this wrong" is not a personal judgment -- it's a criticism of your approach to what I THINK is your issue.

I believe your issue is as follows:

When you are connected to a remote system via VNC, you may wish to REBOOT the machine. Sometimes other applications (such as Microsoft Access) are running, and these applications halt system shutdown until their prompts are answered. You want to retain VNC control long enough so that you can answer those prompts.

(If that summary is NOT accurate, please let me know.)

And I'm saying you're doing it wrong. Shut down the offending applications manually <b>before</b> you initiate the Windows shutdown, or force them to close via Task Manager, or force them to close by using the command line Windows shutdown utility I showed you (INSTEAD of clicking Start, Shutdown, Restart) with the correct command line parameter to force all applications to close.

Good luck.
ruamdro
8
8
Posts: 9
Joined: 2010-08-06 11:37

Re: shutdown sequence/reboot

Post by ruamdro »

B wrote:Sorry, I'm really not understanding you.

1. By "crapshoot" I meant that there's just no good way to determine exactly when VNC itself will shut down, after you have initiated a global Windows shutdown sequence. So it would be foolish to rely on VNC access after the shutdown has begun. You would never be able to be certain that you would have control at any given moment.
Pardon, AFAIK every OS has a predefined/definable sequence when it starts and stops. That's a must. (It would make no sence to kick disc driver out or turn the screen off at the first moment of a shutdown).

At least in the startup phase i know that there is a registry key that states:
Launch login only after all systems are ready.
There must be similar for a shutdown.
I believe your issue is as follows:

When you are connected to a remote system via VNC, you may wish to REBOOT the machine. Sometimes other applications (such as Microsoft Access) are running, and these applications halt system shutdown until their prompts are answered. You want to retain VNC control long enough so that you can answer those prompts.

(If that summary is NOT accurate, please let me know.)
You got it! Exactly. But sometimes shutdown is sufficient.

And sometimes it's not me who inititated the shutdown sequence but
Windows update (WUA), not stoppable, giving only few seconds to leave the session. (I don't know if WUA would be able to kill acces e.g. without asking the user).
And I'm saying you're doing it wrong. Shut down the offending applications manually <b>before</b> you initiate the Windows shutdown, or force them to close via Task Manager, or force them to close by using the command line Windows shutdown utility I showed you (INSTEAD of clicking Start, Shutdown, Restart) with the correct command line parameter to force all applications to close.
And in the moment you think you have stopped all and pressed Shutdown, the task scheduler starts a new task...

Too there might be task waiting to inihibit the shutdown, launched on the shutdown event...
Not all programms are visible in the taskmanager.
And maybe i have no admin rights on the remote box. So i'm not allowed to kill some tasks...but allowed to klick "OK" to terminate them.

There are so many cons which would be no problem if VNC would be stopped as late as possible, defined.


So I think -as a work arround- it would be wiser to logoff before attempting to shut down!
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: shutdown sequence/reboot

Post by B »

Yeah, I know there's a defined start sequence (though I certainly wouldn't rely on it happening the same way every boot) but I'm not aware of a similar shutdown sequence.

I agree with you -- logging out first is a good, appropriate workaround.
ruamdro
8
8
Posts: 9
Joined: 2010-08-06 11:37

Re: shutdown sequence/reboot

Post by ruamdro »

B wrote: I agree with you -- logging out first is a good, appropriate workaround.
Meanwhile i made some further "investigations" :)

Meanwhile i could install the mirror driver. (Had to start the batch several times. The popup dialog box was too short to be read, but after the 3rd or 4th start all was well...).
If i do now a reboot/shutown the connection is killed, but some few seconds later a can connect again and, found me logged out.
So the reboot attempt only lead to a logout. (i have multiuser login, if that matters).
But that's better than having a half dead box, waiting for a non existing user pressing "OK" but whithout a vnc..

So the second tip would be:
Install the mirror driver.
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: shutdown sequence/reboot

Post by B »

Quite possibly related to the "Can't Shut Down" bug documented in my post at [topic=18351][/topic]

and at

[topic=18341][/topic]
ruamdro
8
8
Posts: 9
Joined: 2010-08-06 11:37

Re: shutdown sequence/reboot

Post by ruamdro »

B wrote:Quite possibly related to the "Can't Shut Down" bug documented in my post at [topic=18351][/topic]

and at

[topic=18341][/topic]
Interessinting, thanks.

Seettungs:
multi connect: Disconnect all other on new connection

on disconnect (last): don't change anything
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: shutdown sequence/reboot

Post by B »

You know, I was testing that thread author's situation (with "When last client disconnects log off") but is it possible the problem exists for <b>any</b> remote rebooting situation?

That would be terrible; surely more people would have complained by now? (I don't use UltraVNC much myself.)
ruamdro
8
8
Posts: 9
Joined: 2010-08-06 11:37

Re: shutdown sequence/reboot

Post by ruamdro »

B wrote:You know, I was testing that thread author's situation (with "When last client disconnects log off") but is it possible the problem exists for <b>any</b> remote rebooting situation?

That would be terrible; surely more people would have complained by now? (I don't use UltraVNC much myself.)
I don't know. But i use reboot very seldom. Currently i am setting up a new machinewhich requires some reboots. But that machine is currently only one seat away, so it's not so very annoying.

I'll see tomorow if i'll find something more.

Any hints/suggestions here to look?
rculpan
Posts: 2
Joined: 2008-06-16 14:54
Location: Cambridge, UK
Contact:

Re: shutdown sequence/reboot

Post by rculpan »

I just got caught out by the same issue when remotely rebooting an old Windows 2000 box (using UVNC server 1.0.8.2); something hung on shutdown and Windows was showing the "terminate application now" box.

But the UltraVNC server had already shut down...or at least was was trying to shut down; error boxes "The application failed to initialize because the window station is shutting down" were appearing (I think these were being generated by the UltraVNC tray icon's process)

Interestingly, I was still able to to connect to that machine by using Windows NetMeeting (remote desktop sharing); that process doesn't seem to shut down until after the user is successfully logged off). Maybe the UltraVNC server should do the same upon system shutdown/reboot?

Regards,
Richard
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: shutdown sequence/reboot

Post by B »

I don't see the point of the first link, but the second link is really good.

Thanks.

Still, it doesn't indicate there's any way to control the order in which applications are shut down.
rculpan
Posts: 2
Joined: 2008-06-16 14:54
Location: Cambridge, UK
Contact:

Re: shutdown sequence/reboot

Post by rculpan »

B wrote:...but the second link is really good....

...Still, it doesn't indicate there's any way to control the order in which applications are shut down.
Although the order of things shutting down isn't controllable, from my limited (progamming novice) understanding of that document it appears that services running in Session 0 are sent the shutdown signal after everything to do with the logged-on user (in Session 1) has been shut down (and the user is logged off).

So my feeling is that if the UVNC server could be made to run like a "system service" in session 0 it wouldn't be shut down until after the user was logged off (so they could see hung applications or programs wanting the user to save open documents etc.)

Regards,
Richard
Post Reply