Cannot access vtape and vdisk files on a shared drive

Problem

When running Charon-AXP or Charon-VAX/PDP on Windows, the shared drives cannot be accessed.

Affected versions:

  • Charon-AXP/SMA all versions
  • Charon-AXP, Charon-VAX and Charon-PDP:
    • Before version 4.8 if using the emulator as a service. (info) This does not affect emulators running from the Launcher if the current user has access to the shared drive.
    • All version starting from 4.8 as emulators always run as a service.


Charon-AXP log example:

20160404:134440:ERROR:2:000001BD:scsi_tape.( 832): (3) The system cannot find the path specified. : PKA_600: Failed to connect to Z:\charon\data.vtape.

This problem is due to the fact CHARON services are executed with the SYSTEM user account whereas the shared drive is created from another account.

For remote backups, direct access media is preferred, specially with OpenVMS (.BCK on a disk).


Solution

1) Open a cmd.exe command window as an administrator and run the following command to prevent mapped drives to be disconnected:

C:\Windows\system32>net config server /autodisconnect:-1

(question) This command has to be executed only once (use the "net config server" command to check the current configuration)


2) Get the psexec utility from the Windows Sysinternals kit to open a command window running as SYSTEM user. It can be downloaded here: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec

Once extracted from the zip file, to the "C:\Charon" folder for example, run the following command from the command line running as Administrator:

C:\...> C:\Charon\psexec -i -s cmd.exe


3) On the newly opened cmd.exe window (running then as SYSTEM), create the persistent mapped drive for the "SYSTEM" account with the command below and exit:

C:\Windows\system32>net use drive: \\servername\sharename /persistent:yes /savecred

The command completed successfully.

C:\Windows\system32>exit

(blue star) Drive letter ("drive"), "servername" and "sharename" in italic have to be adapted to your configuration

(question) Credentials will be requested depending on the nature of the share

(info) The command above will not survive Windows reboot and is used to verify the mapping syntax and completion

(lightbulb) For more, refer to Microsoft documentation or run "net use /?"


4) In the cmd.exe command window opened as administrator, create a scheduled job that will be executed at boot, with the SYSTEM user, to map the shared folder.

Example below is given for Z: drive from server "myserver" and share "myshare". It creates a scheduled job named "ConnectZ" in the CHARON folder:

C:\Windows\system32>schtasks /create /sc ONSTART /np /ru SYSTEM /tn "CHARON\ConnectZ" /tr "net use z: \\myserver\myshare /persistent:yes /savecred"

Note

It is not 100% guaranteed the mapping will be ready when a Charon virtual machine (service) will start if its startup type is set to automatic.

As a workaround, the Charon virtual machine startup type can be set to manual and a script can be created to execute the mapping and then start the service.

Example with a script starting a Charon virtual machine named "ds20vms" using the Z: drive from server "myserver" and share "myshare". Let's name it C:\Charon\start-ds20vms.bat:

net use z: \\myserver\myshare /persistent:yes /savecred

sc start ds20vms


Open a cmd.exe command window as an administrator and run the following command for the script to start at boot:

C:\Windows\system32>schtasks /create /sc ONSTART /delay 0000:10 /np /ru SYSTEM /tn "CHARON\Start ds20vms service" /tr "C:\Charon\start-ds20vms.bat"

Related articles



© Stromasys, 1999-2024  - All the information is provided on the best effort basis, and might be changed anytime without notice. Information provided does not mean Stromasys commitment to any features described.