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.
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
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 rsyslog to reload the configuration.