Configure a Server Image


Before creating a cloud server from a custom image, you should properly configure the image to ensure correct installation and full functionality of the control panel.

Below are the checks and configurations you should perform to successfully create the server.

Basic Configuration
Copy link

Partition Table
Copy link

Check the disk partitioning scheme. We recommend using MBR or GPT; both are supported by most Linux distributions using tools like fdisk, gdisk, etc.

Example command:

gdisk -l /dev/vda

Example output:

GPT fdisk (gdisk) version 1.0.5
Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present

If another partitioning scheme is used, you’ll need to recreate the image with the correct one.

Disk Layout
Copy link

If the disk contains a single root partition using the ext3 or ext4 file system, the system will automatically resize the filesystem during server creation to match the configured disk size.

For example, if the image block device is 10 GB and the server is created with a 15 GB disk, the block device and filesystem will expand to 15 GB.

Bootloader
Copy link

The virtual machines use SeaBIOS, so the OS must have a BIOS-compatible bootloader installed.

If a UEFI bootloader is installed, it must be removed and replaced with a BIOS-compatible one.

If using GRUB2, refer to its installation guide.

/etc/fstab Configuration
Copy link

For stable booting, use UUID-based mounting in /etc/fstab for the root partition.

Example:

UUID=f19002a1-6e7a-45ac-91cd-24b7cc0e4cd9 / ext4 defaults 0 1

To get the UUID of a partition:

blkid

Example output:

/dev/vda1: UUID="f19002a1-6e7a-45ac-91cd-24b7cc0e4cd9" TYPE="ext4" PARTUUID="f7a1fae1-01"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"

Root User
Copy link

A password for the root user will be generated when creating the server. Ensure that the root user exists (i.e., hasn't been manually removed).

qemu-guest-agent
Copy link

Make sure the qemu-guest-agent is installed and running. It is needed for operations such as backups from the control panel.

Check its status:

  • Systemd:

systemctl status qemu-guest-agent.service
  • OpenRC / init.d:

/etc/init.d/qemu-guest-agent status

Or:

service qemu-guest-agent status

Install if missing:

  • Debian/Ubuntu:

apt-get install qemu-guest-agent
  • CentOS / RHEL:

yum install qemu-guest-agent
  • Alpine Linux:

apk add qemu-guest-agent

Enable on boot:

  • Systemd:

systemctl enable qemu-guest-agent.service
  • init.d:

chkconfig --add qemu-guest-agent
  • OpenRC:

rc-update add qemu-guest-agent

These configurations are enough for creating a cloud server from the image.

Other settings below are recommended for convenience and usability.

Additional Settings
Copy link

Installing Zabbix
Copy link

To collect server statistics, we use the Zabbix agent.

Install it using the following script:

wget -O - http://repo.hostman.com/zabbix-install.sh | bash

Network Settings
Copy link

Ensure network connectivity after the server boots.

Configure a DHCP client to automatically obtain an IP address.

Most systems have DHCP clients installed. We recommend using dhclient with the following config:

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, domain-search, host-name,
        netbios-name-servers, netbios-scope, interface-mtu,
        rfc3442-classless-static-routes, ntp-servers;

timeout 300;

SSH Access
Copy link

SSH is used to access the server. Make sure it is installed and enabled on boot.

Check status:

  • Systemd:

systemctl status ssh.service
  • OpenRC / init.d:

/etc/init.d/ssh status

Or:

service ssh status

Install if missing:

  • Debian/Ubuntu:

apt-get install openssh-server
  • CentOS / RHEL:

yum -y install openssh-server openssh-clients
  • Alpine Linux:

apk add openssh

Enable on boot:

  • Systemd:

systemctl enable ssh.service
  • init.d:

chkconfig --add ssh
  • OpenRC:

rc-update add sshd

Also, ensure your firewall allows access to port 22 (default SSH port).

Disable Swap
Copy link

It is recommended to disable swap.

Check if swap is active:

swapon --show

Example output:

NAME      TYPE SIZE USED PRIO

Disable swap:

swapoff -a