Applies to ReadyAPI 2.8, last modified on August 16, 2019

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.

Licensing

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 –

Windows

The VirtServer installation program offers an option to install VirtServer as a Windows service. Simply select it in the installation wizard:

Service virtualization: Installing VirtServer as a windows Service

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):

Service virtualization: Error on starting VirtServer as a service

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.

Linux

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.

  1. 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 sudo command.

    /etc/systemd/system/virtserver.service

    [Unit]
    Description=VirtServer Service
    After=network.target

    [Service]
    Type=simple
    User=user-name
    ExecStart=/home/user-name/SmartBear/VirtServer-2.8.0/bin/virtserver.sh
    Restart=on-abort
    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=virtserver

    [Install]
    WantedBy=multi-user.target

    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.

  2. Run the following command to enable the VirtServer daemon to start automatically on the system startup:

    sudo systemctl enable virtserver.service

  3. 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 Installing and Running VirtServer.

In the example above, the lines starting with StandardOutput, StandardError and 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:

  1. Create the following file in /etc/rsyslog.d:

    /etc/rsyslog.d/virtserver.conf

    if $programname == 'virtserver' then /var/log/virtserver.log
    if $programname == 'virtserver' then ~

  2. Run sudo systemctl restart rsyslog to reload the configuration.

See Also

Different Ways to Run VirtServer
Configuring and Using VirtServer

Highlight search results