Table of Contents

This guide explains how to configure V-Ray Swarm for work without an active internet connection.


Overview


By default, Swarm 2 automatically downloads V-Ray distributions as needed. It fetches the archive one, unpacks it into the appropriate directory, verifies it, and generates a meta-file describing the distribution. However, in cases where automatic downloads are not possible, such as no internet connection or access to Chaos servers, a manual workaround can be used through the VRAY_LIB_PATH environment variable.



Using Swarm Without Internet Access


The VRAY_LIB_PATH variable serves as a workaround to add a local V-Ray distribution to Swarm.

The value of the variable must indicate the folder containing the various directories and files of the V-Ray distribution, including the bin/ folder. This feature works with only one version of V-Ray at a time. If you need to install V-Ray into Swarm 2, follow these steps:


1. Stop the Swarm 2 service (if it is running as an original node process, terminate it).

2. Delete all contents from the source folder, for example - /home/username/vray_for_test2.

3. Unpack a different version of V-Ray into that folder.

4. Start the service again (note that the folder is not monitored for changes).


If the process is successful:

  1. A message appears in the log file of the Swarm 2 service indicating that V-Ray was found and copied to the correct folder. The message looks like this, confirming that V-Ray's version is 6.20.10:

    [2024-12-13T09:51:57.244248+0200 - INFO - dl] Copied /home/username/vray_for_test2 (6.20.10 e8197af2) to /var/lib/Chaos/V-Ray/Swarm2/data/VRay/6.20.10-e8197af2

  2. The folder /var/lib/Chaos/V-Ray/Swarm2/data/VRay/6.20.10-e8197af2 contains the bin/ folder as well as other folders and files. Additionally, it includes the vray.info meta-file, which describes the V-Ray contents in a format similar to this JSON

    {"_builds":null,"_lnkDir":null,"_lnkProp":null,"_ready":true,"_url":"file:/home/user/prj/vray_for_test2","_urls":null,"_vrayFac":{"contents":{"_revHash":"e8197af2","_ver":{"_major":6,"_minor":20,"_release":10}},"tag":"VrayAppsdkVF"}}

  3. The installed V-Ray version becomes visible in the Web UI.



Ensure that the environment variable VRAY_LIB_PATH is set at the system or OS level so it is accessible for services, especially if Swarm 2 is running as a service, which is the typical configuration. If this variable is set only for a user, the user sees it, but the operating system services do not, leading to potential issues where Swarm 2 cannot access the variable after a restart.

If the copying process encounters an error, which is noted in the log file, and the destination folder contains a corrupted version of V-Ray:

  1. Stop the service.
  2. Remove the corrupted folder.
  3. Start the service again. 

This prompts the service to attempt to copy V-Ray from the source folder (indicated by VRAY_LIB_PATH) to the appropriate destination folder.


Windows


Set the VRAY_LIB_PATH by following standard procedures. You have a few options:


  1. Use the command line (run with Administrator rights) with the following command:  setx VRAY_LIB_PATH folder_name /M
  2. Use PowerShell.
  3. Use the standard graphical tools in Windows. Navigate to System Properties and adjust the System variables.



Linux


Setting the environment variable in /etc/profile or similar files when Swarm 2 is running as a service is not available for Linux. These files are only used for user shell initialization, not for system services. In this case, set the environment variable as follows (note that sudo prompts you for your password if you have permission to execute commands with it):


  1. Run the command:

    sudo systemctl edit swarm

  2. This opens your system editor (either vim or nano, and you can install a different editor if you want to configure it with the EDITOR environment variable).
  3. Add the following lines to the editor, replacing /home/user/... with your actual path:

    [Service]
    Environment="VRAY_LIB_PATH=/home/user/prj/vray_for_test2"

  4. Save the changes and exit the editor.
  5. Then, run the following commands to reload the system manager configuration and restart the Swarm service:

    sudo systemctl daemon-reload
    sudo systemctl restart swarm


  6. Check if the service status is active (running).
  7. Finally, to confirm that V-Ray has been installed correctly, check the log file or the Web UI.




macOS


For macOS, the setup process is similar to that for Linux.

 Modification of the shell profile files is not available in this case.


  1. Run the command

    sudo vim com.chaos.vray.swarm.plist

  2. This opens the text editor Vim. Ensure that the EnvironmentVariables line is formatted as follows:

    <key>EnvironmentVariables</key>

         <dict>

         <key>VRAY_LIB_PATH</key>

         <string>/Users/user/vray/vray-dr2-20240522</string>

         </dict>

  3. After making the changes, place V-Ray in the specified folder and restart the service using these commands:

    sudo launchctl unload /Library/LaunchDaemons/com.chaos.vray.swarm.plist

    sudo launchctl load /Library/LaunchDaemons/com.chaos.vray.swarm.plist

  4. To verify that the Swarm 2 service has stopped, run:

    pgrep -l swarm

  5. If this command returns nothing, it means that the service is stopped; if it displays any output, it is still running.
  6. To confirm that V-Ray has been installed correctly, check the log file or the Web UI.





Directories


Windows:

Bins

%ProgramFiles%\Chaos\V-Ray\Swarm 2

Settings

%SystemRoot%\System32\config\systemprofile\AppData\Roaming\Chaos\V-Ray\Swarm 2

Logs

%ProgramData%\Chaos\V-Ray\Swarm 2\logs

Templates

%PUBLIC%\Documents\Chaos\V-Ray\Swarm 2

Data

%ProgramData%\Chaos\V-Ray\Swarm 2\data

Linux:

Bins

/usr/Chaos/V-Ray/Swarm2

Settings

/etc/Chaos/V-Ray/Swarm2

Logs

/var/log/Chaos/V-Ray/Swarm2/logs

Templates

/usr/share/Chaos/V-Ray/Swarm2

Data

/var/lib/Chaos/V-Ray/Swarm2/data


macOS:

Bins

/Applications/Chaos/V-Ray/Swarm2

Settings

/Library/Chaos/V-Ray/Swarm2

Logs

/Library/Chaos/V-Ray/Swarm2/logs

Templates

/Library/Chaos/V-Ray/Swarm2/templates

Data

/Library/Chaos/V-Ray/Swarm2/data



V-Ray Distribution


The value of VRAY_LIB_PATH must be the full path to a directory with a V-Ray distribution. There are two ways to obtain this path.

When you have already installed V-Ray for SketchUp or for Rhino, this is the plugin installation path. (default for Rhino is C:\Program Files\Chaos\V-Ray\V-Ray for Rhinoceros\vrayappsdk).

Another possibility is to download an installer for V-Ray for SketchUp or for Rhino and unpack it without installation. To do this, execute the following command in a terminal: .\vray_70001_rhino_win_x64.exe -unpackInstall DIR_NAME. Then the full path for VRAY_LIB_PATH would be C:\Downloads\DIR_NAME\vrayappsdk.

Was this helpful?