Selling VPS Hosting Through WHMCS
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
- Download the module above and copy the
virtlix_vpsfolder into your WHMCS'smodules/servers/directory. (It's also already sitting on your panel's own server, atwhmcs-integration/virtlix_vps/, if you'd rather copy it from there instead of downloading a fresh copy.) - Setup → Products/Services → Servers → Create New Server
- Hostname: your panel's base URL, e.g.
https://panel.example.com - 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.
- Hostname: your panel's base URL, e.g.
- Setup → Products/Services → Products/Services → Create a New Product
- Module Name: Virtlix VPS
- Assign the Server from step 2 and save the product first, then reopen its Module Settings tab - Virtlix Plan and Virtlix OS Template are live dropdowns fetched straight from your panel (your real Plans and OS Templates), so they only populate once the product knows which panel to ask.
- Virtlix Virtualization: choose KVM or LXC to match whichever OS Template you pick (the Template dropdown shows each one's type as a suffix, e.g. "AlmaLinux 9 (KVM)"). A mismatch is refused at order time with a clear error instead of silently provisioning the wrong kind of guest.
That's the whole setup. The module automatically creates the three Admin Only custom fields it needs (VM ID, Hostname, Root Password - the last one using WHMCS's own encrypted Password Field type) the first time an order provisions, if they aren't already there.
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 exactly from the Plan you configured. | | 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
Opening the service in the client area shows:
- 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, right from the client area, no support ticket needed for either.
- Reinstall - the customer picks any OS Template matching the VPS's own type (a KVM VPS is only ever offered KVM templates, an LXC one only LXC), and sets a new root/Administrator password twice for confirmation before anything is wiped. This action is irreversible and clearly labeled as such.
- Open Console - a one-time, 5-minute VNC link. The customer is never given a login to your actual panel - every action goes through WHMCS, using your admin API token, on the server side only.
Good to know
- One panel, many WHMCS products. Point as many products at the same Server entry as you like - each product just picks a different Plan/OS Template combination.
- A suspended VM is truly locked, not just stopped.
- Check Utilities → Logs → Module Log in WHMCS for the real reason behind any failed action - every hook logs its own error message there rather than failing silently.