From OCS Inventory NG
Jump to: navigation, search

How to install, start and configure the OCSInventory-NG virtual machine


The Virtual Machine ocsinventory-ng (or VMOcsinventory-ng) was created to provide an easy and ready-to-use system for those who want to test or run in a production environment the OCS Inventory Next Generation software.

These machines has been tested mainly in VMWare Server 2.x but they are compatible with other VMWare solutions like VMWare Player or VMWare ESXi.

Several distributions are available, allowing you to choose the one you prefer :

  • Debian 6.0 32 Bits
  • Debian 6.0 64 Bits
  • Ubuntu Server 11.04 32 Bits
  • Ubuntu Server 10.04 64 Bits
  • CentOS Server 5.7 32 Bits

Other virtual machines will be available soon, including Fedora and Centos.

The following services are enabled with OCS Inventory NG 2.0 stable :

  • Inventory
  • HTTP and HTTPS Web Administration
  • Ipdiscover
  • SNMP
  • Package deployment

Note: The SSL mode is also enabled. This allows secure inventory transmission and package deployment. Indeed, a control of the SSL certificate is performed when the agent contacts the server. You can disable this feature but for security reasons, we strongly advise aginst doing this.


You must ensure that you have :

  • An installed and operational VMWare solution
  • 8 GB hard disk space free
  • The host machine must know how to manage x64 instructions if you choose a 64-bit distribution


  • On Linux, by default, the profile root is associated with the password ocs.
  • On Mysql, by default, the couple ocs/ocs is associated to the ocsweb database.

Installing the Virtual Machine

You can retrieve the virtual machine (.tar.gz format) that suits you by going to the Download page.

Once recovered, unzip the archive in the storage folder of your other virtual machines.

In your application, add it in your inventory.

Warning: At ​​first startup, VMWare detect that your virtual machine does not come from that server and ask if it was moved or copied. Please answer MOVED.

Your virtual machine is ready, go setting it in your environment.

Configuring the Virtual Machine

Configuring IP

By default, the IP configuration of the virtual machine is :

  • IP :
  • Subnet mask :
  • Gateway :
  • DNS : /

To be consistent with your own network, you must edit the following files :

  • /etc/network/interfaces : set the right fields :
    • address : enter the IP address of your future OCS server.
    • netmask : enter the subnet mask.
    • network : enter the network address.
    • broadcast : enter the broadcast address.
    • gateway : enter the gateway.

  • /etc/resolv.conf : set the right fields :
    • nameserver : enter the DNS server address.

  • /etc/hosts : change IP address with the one you chose above.

Note: When finished, restart your virtual machine :
shutdown -r now

Configuring SAMBA

By default, the SAMBA configuration of the virtual machine inserts it in the workgroup WORKGROUP. If that does not fit into your network settings, please change the WORKGROUP= value by editing the file :

nano /etc/samba/smb.conf

Then restart SAMBA service :

service smbd restart

Configuring DNS

To ensure the proper functioning of the inventory and deployment on the agents, the ocsinventory-ng hostname must be resolved by the clients. In other words, the command ping ocsinventory-ng must return a positive result as shown in this image :

Ping ocsinventory-ng.png

To do this, either you use the DNS server on your network to point the name ocsinventory-ng to the IP address of the virtual machine (Howto for Windows Server), or you update the hosts file of each computer with the same information (usually located in %windir%\system32\drivers\etc\).

Warning: The SSL certificate generated in the virtual machine contains ocsinventory-ng hostname. It is very important that this step is respected as is, with the same name.

Générating SSL certificate

By default, the cacert.pem SSL certificate included in the virtual machine has expired. You must generate a new one.

To do this, in a terminal, type :

cd /ocs

Answer the questions asked while retaining ocsinventory-ng Common Name.

Once back at the prompt, restart Apache:

service apache2 restart

The certificate is automatically used by Apache and is available from a client under the address : \\ocsinventory-ng\ocs$.

Installing and configuring a client agent

Installation is the same as described in this documentation. However, let the Server URL field with http://ocsinventory-ng/ocsinventory address.

In addition, you must copy cacert.pem certificate, which is located in \\ocsinventory-ng\ocs$, in C:\ProgramData\OCS Inventory NG\Agent directory ( for Windows Vista/7/Server 2008 ) or in C:\Documents and settings\All Users\Application Data\Ocs Inventory NG\Agent directory ( for Windows 2000/XP/Server 2003 ).


You can also use ocspackage.exe to generate an installer including the certificate. For instructions, see this documentation.

If you want more ...

Updating time and date

By default, the virtual machine is configured on the Greenwich time zone. To update this, you can use the package ntpdate :

apt-get install ntpdate

Then configure it by editing the /etc/default/ntpdate file :

nano /etc/default/ntpdate

Pass the NTPDATE_USE_NTP_CONF value from YES to NO. Save everything and do update with :


It's Ok ;)

HTTPS Inventory transmission

If you want, you can also sent the inventory over HTTPS. The virtual machine is also configured to perform this operation. To use it, you just during the installation of the agent change the Server URL field with https://ocsinventory-ng/ocsinventory.

Secure your OCS Inventory NG Server

We recommend you to secure you OCS Inventory NG Server. Please follow this link to know how proceed :

Personnalize your OCS Inventory NG Server

You can personnalize your server with a lot of plugin created by the OCS Inventory NG Community. Please follow this link to know how proceed :