Deploy Scanner Instance using Command-line virt-install

You can deploy a Scanner Instance using the command line virt-install.

Log into your KVM server and run the following commands to launch a scanner instance using the qCOW2 disk image:

virt - install --name < INSTANCE NAME > --memory < MEMORY > --vcpus < NO. OF CPU > --network < Network> --disk < LOCATION OF IMAGE FILE > --check disk_size=off –import

Example:

virt-install --name qualys_scanner --memory 2048 --vcpus 1 --network bridge=bridge0,model=virtio --disk qVSA-X.X.XX-X.qcow2 --check disk_size=off –import 

Once you run the command, an instance is created and the Scanner console is displayed where you need to enter the Personalization Code received in Step 1: Add your Virtual Scanner.

To view the console to see the progress of the launched instance, run: 
virt-viewer <  Instance Name > 

To view the console to see the progress of the launched instance, run the following.
Login to KVM server console and run  
virt - viewer <  Instance Name > 

View instance.

After the initial boot-up messages, the Scanner console is displayed where you need to enter the Personalization Code received in Step 1: Add your Virtual Scanner.

Personalize the Scanner Using Custom User Data

Scanner VM XML template can be used to inject custom user data. The user data includes a Personalization code. Optionally, Proxy details can also be included in user data. 
The custom user data needs to be in base64 encoded format.

Follow these steps to inject custom user data into the Scanner VM XML template:

  • Deploy KVM scanner VM.

    Do not power on the Scanner VM before completing all the steps.

  • Create base64 encoded user data.
  • On the Linux machine, run this command to encode user data: <<<$'PERSCODE=xxxxxxxxxx' gzip -c | openssl base64 -A

    This will generate base64 encoded data.

    Optional:

    With Proxy details included: <<<$'PERSCODE=xxxxxxxxxx\nPROXY_URL=user:pwd@proxyip:port' gzip -c | openssl base64 -A)

    Login to KVM host terminal and run - virsh edit <vm name> to edit the XML template.

    In XML template, you can view this section:
    <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.6.0'>hvm</type>
    <boot dev='hd'/>
    </os>

    Edit this section with the following:
    After <boot dev='hd'/>,

    add:

    <smbios mode='sysinfo'/>
    Add new section after </os>:
    <sysinfo type='smbios'>
    <system>
    <entry name='serial'>CONFIG:<base64 encoded data></entry>
    </system>
    </sysinfo>

    For element entry name='serial', add the encoded user-data generated in here.

    The updated XML is:

    <os>
     <type arch='x86_64' machine='pc-i440fx-rhel7.6.0'>hvm</type>
     <boot dev='hd'/>
     <smbios mode='sysinfo'/>
    </os>

    <sysinfo type='smbios'>
      <system>
     <entry name='serial'>CONFIG:<base64 encoded data></entry>
     </system>
    </sysinfo>

  • Power on the Scanner VM.

Next Step

Step 5: Deploying Scanner Appliance in Split Network Mode