A possible way to make VirtServer start automatically is to run it as an operating system service on Windows or daemon on Linux and macOS. This way VirtServer can start even if no user is logged in on the computer where it is installed. You can use this approach if you cannot start VirtServer in other ways.
Services (daemons) are a special type of executables. VirtServer is a console application. One possible way to run it as a service (daemon) is to “convert” it to a service with a special utility like nssm. On Windows, a more preferable way is to use a special service executable that is installed as part of the VirtServer installation. On Linux, you can create special configuration files for running VirtServer as a service. See below.
Before you start using VirtServer, you need to activate its license. As services (daemons) often run in non-interactive user sessions, you may be unable to activate your VirtServer license normally, since the activation requires that you enter data. You can use any of the following workarounds:
Run VirtServer for the first time from the command line to activate the license, and then run VirtServer as a service.
– or –
Activate the license with the ReadyAPI License Manager. Also, read instructions on activating licenses in silent mode.
To run VirtServer as a Service with a SmartBear ID-based license, please activate or deactivate your SmartBear ID-based license using the following commands:
java -jar virtserver-cli-1.15.0.jar -s localhost:9090 -activatelicense -licenseserver http://184.108.40.206:40892 - licenseaccesskey 3881e8c2-7898-4d5c-aa6e-2e47fc5e2538 -licenseissuer SLM
java -jar virtserver-cli-1.15.0.jar -s localhost:9090 -deactivatelicense -licenseserver http://220.127.116.11:40892 - licenseaccesskey 3881e8c2-7898-4d5c-aa6e-2e47fc5e2538 -licenseissuer SLM
Please enter your own parameter values as appropriate.
-licenseserver http://18.104.22.168:40892 - add the SLM license server address and specify port http://40892 is added as default.
-licenseaccesskey 3881e8c2-7898-4d5c-aa6e-2e47fc5e2538 - please enter your access key as provided in your onpremise license portal. Access key is required if authentication is configured.
-licenseissuer SLM - this is always required if you are using a SmartBear ID-based license.
The VirtServer installation program offers an option to install VirtServer as a Windows service. Simply select it in the installation wizard:
Another option you can select is Autostart Service. If you select it, the operating system will run the service automatically on startup.
Note that to run VirtServer, you need to create a user on it first. If you have not done it yet, the service will not start (you will get error #1067):
So, create a user on VirtServer and then run the service.
After you install VirtServer as a service, it is important to change the user account you use to run this service to the account for which your VirtServer license is activated. To do this, open the operating system’s Services list, right-click the VirtServer Service in the list and select Properties from the context menu. In the subsequent dialog, switch to the Log On tab and specify the user account and password there.
To automate the start of VirtServer, you may use a system configuration. Below is an explanation of how you can do this in RedHat Linux. In other Linux versions the procedure is similar.
Open a text editor and create the following file in the /etc/systemd/system folder.
Note: To save the file, you will need write permissions for the /etc/systemd/system directory. So, you may need to start the text editor with the
Replace user-name with your user name. It is important to specify the user name you used to activate the VirtServer license.
Also, you may need to correct the VirtServer folder name if you are using a version different from the one we used above.
Run the following command to enable the VirtServer daemon to start automatically on the system startup:
sudo systemctl enable virtserver.service
Restart your computer. The operating system should run VirtServer as a service (daemon).
If you want to run the daemon manually, use a command like this one:
sudo systemctl start virtserver.service
To run VirtServer, you need to create a user in VirtServer. If you have not done this yet, do this now. VirtServer will not start until you create a user. See Manage VirtServer Users.
In the example above, the lines starting with
SyslogIdentifier command the operating system to output VirtServer’s messages to the syslog using the VirtServer identifier. If you want to log VirtServer messages to a file, then do not enter these three lines. Follow these steps:
Create the following file in /etc/rsyslog.d:
if $programname == 'virtserver' then /var/log/virtserver.log
if $programname == 'virtserver' then ~
sudo systemctl restart rsyslogto reload the configuration.