VIRTLIX
🔐 Account & Security
Two-Factor Authentication
Docs / Multi-Server & Licensing / Selling VPS Hosting Through WHMCS

Selling VPS Hosting Through WHMCS

↓ Download the module (.zip)

This is a separate module from Virtlix's own License module (the one that provisions a Virtlix panel license itself, used on virtlix.com's own WHMCS). The VPS module below is for you - install it on your own WHMCS to sell VPS/VM hosting to your own customers, provisioned automatically on your Virtlix panel.

Install

  1. Download the module above and copy the virtlix_vps folder into your WHMCS's modules/servers/ directory. (It's also already sitting on your panel's own server, at whmcs-integration/virtlix_vps/, if you'd rather copy it from there instead of downloading a fresh copy.)
  2. Setup → Products/Services → Servers → Create New Server
    • Hostname: your panel's address, e.g. panel.example.com or IPv4 - a scheme prefix isn't required, the module adds http:// automatically if you leave it off.
    • Access Hash: an admin-role API token from your panel's Configuration → API Tokens page. It must be admin-role - the module sets an explicit VM owner on every request, which only an admin token is allowed to do.
    • Module: Virtlix VPS
  3. Setup → Products/Services → Products/Services → Create a New Product
    • Module Name: Virtlix VPS
    • Assign the Server from step 2 (WHMCS's own built-in Server field - needed for real provisioning calls later) and save the product.
    • Reopen the product's Module Settings tab. Set Virtlix Panel to that same server (this second, module-managed dropdown is what actually powers the live Plan list - WHMCS doesn't reliably hand a product's assigned Server credentials to this settings page the way it does for real orders), then save again.
    • Reopen the tab once more - Virtlix Plan is now a live dropdown of your panel's real named Plans, plus a Custom option (see below). Pick one.
    • Virtlix Virtualization: choose KVM or LXC to match whichever OS Template you'll pick next, then save again - the OS Template list only shows templates matching whichever Virtualization was last saved.
  4. Still on the product, open the Custom Fields tab and check OS Template - see the reference table below for what it (and every other custom field) does.

Custom Fields reference

The module manages these automatically - nothing to create by hand under normal use. All are scoped to the product (type=product), so every service under that product shares the same definitions.

Field Type Client-facing? Purpose
OS Template Dropdown Yes - required, shown on order form and invoice The customer's OS choice at checkout, scoped to only the templates matching the product's Virtualization (KVM or LXC). Refreshed automatically every time an admin with a resolved Virtlix Panel opens Module Settings. Set a Default Value and untick "Show on Order Form" instead, if you'd rather fix one OS per product.
Custom Plan vCPU Text No - admin only Only used when Virtlix Plan is set to Custom - the VM's vCPU count.
Custom Plan Memory (MB) Text No - admin only Only used when Virtlix Plan is set to Custom - the VM's RAM in MB.
Custom Plan Disk (GB) Text No - admin only Only used when Virtlix Plan is set to Custom - the VM's disk size in GB.
VM ID Text No - admin only The panel's internal VM id, written by the module right after provisioning. Used internally for every later action (start/stop/reinstall/suspend/etc).
Hostname Text No - admin only The VM's current hostname, kept in sync whenever changed from the client area.
Root Password Password (WHMCS-encrypted) No - admin only The VM's current root/Administrator password, kept in sync on creation, reinstall, and any password change - shown to the customer in their client area, never stored in plain text in WHMCS's own database.

If Utilities → Logs → Module Log ever shows a "missing ... custom field" or "could not auto-create/refresh" entry, something failed unexpectedly on your WHMCS's schema - add the field by hand in that case, matching the Type/Client-facing columns above (Root Password as a Password Field, OS Template as a Dropdown with Required/Show on Order Form/Show on Invoice all ticked and Admin Only unticked, everything else as a plain Text Box, Admin Only ticked).

Custom-sized plans

Set Virtlix Plan to Custom to size a product directly with vCPU/Memory/Disk instead of matching a named Plan on your panel - useful when a product's specs don't match anything in your Plan catalog. Fill in the Custom Plan vCPU/Memory (MB)/Disk (GB) fields from the table above; the order is refused with a clear error if any of the three are left blank when Plan is set to Custom.

What happens automatically

Event What happens
Order accepted Finds-or-creates a Virtlix panel account for the client (matched by email - safe to run twice, never duplicates), then creates a VM sized from the configured Plan (or Custom vCPU/Memory/Disk).
Suspend (e.g. an overdue invoice) Force-stops the VM and locks it - the customer can't start, reboot, reinstall, or open a console again until unsuspended.
Unsuspend Lifts the lock.
Terminate Permanently deletes the VM.
Admin-triggered password reset Applied live from WHMCS's own Change Password action.

What the customer sees

  • At checkout: an OS Template dropdown (if you left "Show on Order Form" ticked), scoped to the product's own KVM/LXC type.
  • In the client area, once provisioned:
    • Live status, IP address, and specs (vCPU/RAM/disk).
    • Live Usage - a self-refreshing CPU / Memory / Disk / Network panel that updates every few seconds while the VPS is running.
    • Start / Stop / Reboot.
    • Change Hostname and Change Password - applied live, no support ticket needed for either.
    • Reinstall - pick any OS Template matching the VPS's own type, and set a new root/Administrator password twice for confirmation before anything is wiped.
    • Open Console - a one-time, 5-minute VNC link. The customer is never given a login to your actual panel.

Good to know

  • One panel, many WHMCS products. Point as many products at the same Server entry as you like.
  • A suspended VM is truly locked, not just stopped.
  • Check Utilities → Logs → Module Log in WHMCS for the real reason behind any failed action.