Integrating VNC on Windows PE 2.0
Author: Trevor Sullivan
Company: OfficeMax Corporation
Versions: 1.0 – April 24, 2008 – original document
Synopsis
Integrating VNC on Windows PE allows a remote user, such as a support person, to remotely control a Windows pre-execution environment, and perform administrative tasks such as deploying an operating system image, or diagnosing hardware and software problems using 3rd party tools. This image can be remotely booted in a LAN environment using the IDE-R feature of Intel AMT.
Requirements
- Microsoft Windows AIK v1.1 (downloadable from Microsoft)
- A working Windows PE 2.x CD (can be built from WAIK)
- UltraVNC 1.02 (downloadable from Internet)
- ImageX (to mount WIM files) - included with WAIK
Setting up UltraVNC
Install UltraVNC 1.02 on a development system
You can optionally install UltraVNC 1.02 to an Altiris SVS virtual layer to avoid making permanent changes to your development system
After UltraVNC is installed:
1. Execute VNC in user-mode
2. Run the following command: winvnc –defaultsettings
3. You should be presented with a configuration dialog
4. Set a password for VNC and choose to disable the tray icon
5. Confirm the settings dialog, and stop Winvnc by running: winvnc –kill
6. Extract the following registry tree: HKLM\Software\ORL (vnc.reg)
7. Add the password to the default key
a. Open the registry file (vnc.reg)
b. Create a new section (key) for HKLM\Software\ORL\Default
c. Copy the password value from ORL to the Default key
Gathering Source Files
Copy the following list of files from the UltraVNC installation directory on the source computer into a separate working folder:
- Authadmin.dll
- Authssp.dll
- Ldapauth.dll
- Logging.dll
- Logmessages.dll
- Mslogon.acl
- Unzip32.dll
- Vnchooks.dll
- Vnchooks_settings.reg
- Vncviewer.exe
- Winvnc.exe
- Workgrpdomnt4.dll
- Zip32.dll
- Vnc.reg (from previous section)
- Vnc.vbs (see below)
Trevor developed a short script to get around a problem with winvnc hanging when I’d execute it. This executes winvnc.exe asynchronously so that it continues to run in the background, but startnet.cmd will be allowed to continue. The script source is included below:
ScriptPath = Left(Wscript.ScriptFullname, len(Wscript.ScriptFullName) - len(Wscript.ScriptName))
set sh = CreateObject("Wscript.Shell")
sh.Run "regedit /s " & ScriptPath & "vnc.reg", 1, true
sh.Run "wpeutil disablefirewall", 0, true
sh.Run ScriptPath & "winvnc.exe", 1, false
Modifying the PE Disc
- Mount WIM file on filesystem using ImageX
- Copy all source files to folder on root of WIM mount path
- Modify startnet.cmd to execute VNC vbscript using cscript.exe
- Use the fully qualified path to the script file (eg. “cscript X:\vnc\vnc.vbs”)
Notes
- Winvnc does not work under service mode on Windows PE; Winvnc must be run under user context
- The registry value “password” must exist under HKLM\Software\ORL\Default, otherwise winvnc will prompt for a password upon startup
Trevor Sullivan
Systems Engineer
OfficeMax Corporation
