~ read.

Freebsd on OVH VPS

Quick! and easyish, Not a very well-formatted article. but now it is out there at least.

The basic trick is to use a Virtualbox image as base, for example the one from the previous post.

First install the VPS with ubuntu and get the IP settings
cat /etc/networks.d/* Results below

auto eth0  
iface eth0 inet static  
        address ${IPFROMNETWORKS}
        post-up /sbin/ip route add ${DEFGWFROMNETWORKS} dev eth0
        post-up /sbin/ip route add default via ${DEFGWFROMNETWORKS} 
        pre-down /sbin/ip route del default via ${DEFGWFROMNETWORKS} 
        pre-down /sbin/ip route del ${DEFGWFROMNETWORKS}  dev eth0
        dns-nameserver ${DEFDNS}
        dns-search ovh.net

Note the settings and change your image to reflect
edit rc.conf to reflect your settings.

ifconfig_vtnet0="inet ${IPFROMNETWORKS} netmask broadcast ${IPFROMNETWORKS}"  
static_routes="net1 net2"  
route_net1="${DEFGWFROMNETWORKS} -interface vtnet0"  
route_net2="default ${DEFGWFROMNETWORKS} "  


search ovh.net  
nameserver ${DEFDNS}  

Add SSH-keys and any other settings you wish.

Convert from vmdk to raw and gzip the image

VBoxManage clonehd --format raw Freebsd1.vmdk Freebsd.vmdk.raw  
gzip Freebsd.vmdk.raw  

reboot your ovh vps instance to rescue mode, This starts a live linux with the VPS blockstorage on /dev/vdb. Ovh will email you a root password for the rescue mode, when ready.

ssh root@${IPFROMNETWORKS}  
umount /mnt/vdb1  

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

cat freebsd1.raw.gz | ssh root@${IPFROMNETWORKS} "gunzip | dd of=/dev/vdb bs=1M"  

when booting the VPS you need to provide the Geli password via the KVM console then it boots.

  • Routes does not get set at boot.
    • Add manually, and you'll be able to ssh route add xyz
comments powered by Disqus