Skip to content

1. Hoster Installation

Install project requirements

Login as root and install bash, curl and tmux

sudo su -
pkg update && pkg install -y bash curl tmux netdata node_exporter prometheus
service netdata enable
service node_exporter enable
service prometheus enable
chsh -s `which bash`

Log out and log back in

We've set bash as our new default shell. This requires us to log out and log back in, or simply execute:

bash

Set environment variables

This step is optional but highly recommended. Essentially, if you ignore to set any of these values - they will be set for you automatically.

export DEF_NETWORK_NAME=internal
export DEF_NETWORK_BR_ADDR=10.0.103.254
export DEF_NETWORK_SUBNET=10.0.103.0/24
export DEF_NETWORK_RANGE_START=10.0.103.10
export DEF_NETWORK_RANGE_END=10.0.103.200
export DEF_PUBLIC_INTERFACE=bge0
export DEF_UPSTREAM_DNS_SERVER=192.168.10.254

Set the ZFS encryption password (will be generated automatically, if you don't)

export DEF_ZFS_ENCRYPTION_PASSWORD="SuperSecretRandom_password"

Execute node initialization script

This script will download and execute the installation script.

curl -S https://raw.githubusercontent.com/yaroslav-gwit/HosterCore/main/node_init.sh | bash

At the end of the installation you will receive a following message:

╭────────────────────────────────────────────────────────────────────────────╮
│                                                                            │
│  The installation is now finished.                                         │
│  Your ZFS encryption password: it's right below this box                   │
│                                                                            │
│  Please save your password! If you lose it, your VMs on the encrypted      │
│  dataset will be lost!                                                     │
│                                                                            │
│  Reboot the system now to apply changes.                                   │
│                                                                            │
│  After the reboot mount the encrypted ZFS dataset and initialize Hoster    │
│  (these 2 steps are required after each reboot):                           │
│                                                                            │
│  zfs mount -a -l                                                           │
│  hoster init                                                               │
│                                                                            │
╰────────────────────────────────────────────────────────────────────────────╯
SuperSecretRandom_password

At this point take a minute and save the ZFS encryption password, otherwise you'll lose access to the encrypted dataset!

Reboot

Reboot the system, and once the it's back up online run hoster init to load any missing kernel modules or services:

Initialize Hoster

hoster init has to be executed after every reboot, as it will try to load all missing kernel modules, and start all internal services (dns_server, node_exporter_custom, traefik, etc)

hoster init

Mount encrypted ZFS datasets

Mount your encrypted ZFS dataset (also has to be executed after every reboot):

zfs mount -a -l

Deploy your first VM

Download debian12 image

Download your first Linux based image to start the virtualization journey with Hoster:

hoster image download debian12

Execute hoster image to list the available images:

hoster image

# EXAMPLE OUTPUT
🔗 OS Images available on the public server: https://images.yari.pw/
 almalinux8
 rockylinux8
 ubuntu2004
 ubuntu2204
 debian11
 debian12

Now you can finally deploy your VM

If you don't give any flags Hoster will deploy a VM named test-vm-1, using debian11 template. This is useful for rapid deployment and testing of any kind.

hoster vm deploy

But you also have the ability to specify the VM name, number of CPU cores, the amount of RAM, and if you'd like to start the VM right away:

hoster vm deploy -n newAwesomeVmName -c 1 -r 1G --start-now

or with long flags

hoster vm deploy --name newAwesomeVmName --cpu-cores 2 --ram 2G --start-now

Windows VMs support

Most of the time, Windows images prepared using our documentation work fine under Hoster, but just in case you have issues with the default storage driver (nvme in our case), then ahci-hd might be a good fallback.

{
    "disk_type": "ahci-hd",
    "disk_location": "internal",
    "disk_image": "disk0.img",
    "comment": "OS Drive"
},