Tuesday, April 27th 2021

Create new Debian machine on VPS

Short and to the point...

First install the VPS with debian distribution and get the IP settings for network interface (in my example vio0):

- ip address, {IPADDRESS}

- gateway, {IPGATEWAY}

- dns server, {DNSSERVER}

Create virtual machine in Virtualbox and configure it

We must use a Virtualbox image as base.

Created new virtual machine in virtualbox with harware parameters as your OVH machine (CPU,RAM,HDD).

Select additionally following parameters:


- Version: OpenBSD (64bit)

- RAM(with size as your VPS plan): 2048 MB

- Memory kontroller: AHCI

- Disk (with size as your VPS plan): openbsd.vmdk

- network: paravirtualized network (virtio-net)

Then boot it and install from official OpenBSD iso image.

After reboot configure basic network settings using values from debian and write it in the file /etc/hostname.vio0

inet {IPADDRESS} 0xffffffff
!sleep 2
!route add -inet {IPGATEWAY}/32 -link -iface vio0
!route add -inet default {IPGATEWAY}


nameserver ${DNSSERVER}

Change default SSHD port, add SSH-keys and any other settings you want.

Convert, upload and use it

Convert disk image from vmdk to raw and gzip the image

VBoxManage clonehd --format raw openbsd.vmdk openbsd.vmdk.raw
gzip openbsd.vmdk.raw

reboot your ovh vps instance to rescue mode, This starts a live linux with the VPS blockstorage on /dev/vdb or /dev/sdb .

OVH provider will email you a root password for the rescue mode, when ready.

ssh root@${IPADDRESS}
umount /mnt/vdb1 or /dev/sdb1

Now transfer your raw image and block copy it to the storage.

cat openbsd.vmdk.raw.gz | ssh root@${IPADDRESS} "gunzip | dd of=/dev/sdb bs=1M"

After reboot you should be able to reach and login to machine.