* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * How to set up a test environment for FreeBSD VPS * * * * Klaus P. Ohrhallinger, http://www.7he.at/freebsd/vps/ * * * Last modified: Feb 10 2014 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Install FreeBSD 10.0-RELEASE * Configure your network interfaces (following instructions assume you are using ethernet). * In order to use the live migration feature, ssh and root login have to be enabled: /etc/rc.conf: sshd_enable=YES /etc/ssh/sshd_config: PermitRootLogin yes * * * * Install VPS from binary package * * * * Lookup URL for the right package on the website. For example: vps-amd64-dbg-r215.txz means: suited for FreeBSD 10.0; VPS revision 215; amd64 machine; debug version The debug versions are much slower than the prod(uction) versions; but give more output for debugging and diagnostics. # fetch http://www.7he.at/freebsd/vps/... # pkg add vps-*txz * * * * --- * * * * * Reboot # sync # shutdown -r now * Execute setup script (has to be redone after reboot, but you can add it to /etc/rc.local): # /etc/rc.vpssetup.sh (Ignore any errors about non-existent sysctls.) Output of kldstat should like like this: # kldstat Id Refs Address Size Name 1 25 0xffffffff80200000 f23488 kernel 2 1 0xffffffff81212000 f0d if_vps.ko 3 1 0xffffffff81213000 1c22 vps_dev.ko 4 1 0xffffffff81215000 aa5 vps_ddb.ko 5 1 0xffffffff81216000 1905 vps_libdump.ko 6 1 0xffffffff81218000 5db9 vps_snapst.ko 7 1 0xffffffff8121e000 917d vps_restore.ko 8 1 0xffffffff81228000 1ab5 vps_suspend.ko 9 1 0xffffffff8122a000 1ef5 vps_account.ko 10 1 0xffffffff8122c000 37e8 vpsfs.ko 11 1 0xffffffff81230000 3f55 sysvmsg.ko 12 1 0xffffffff81234000 4dcd sysvsem.ko 13 1 0xffffffff81239000 3bd9 sysvshm.ko # * * * * Creating virtual instances * * * * * Create the virtual instance's filesystem: # mkdir /usr/vps/test01 # fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.0-RELEASE/base.txz # tar Jxpf base.txz -C /usr/vps/test01 * Create /usr/vps/test01/etc/rc.conf: root_rw_mount=NO hostname="test01.lo" * Create /usr/vps/test01/etc/rc.local: The addresses you choose have to be of the host's external subnet. Don't use other netmasks/prefixlengths. ifconfig vps0 inet 192.168.98.100 netmask 255.255.255.255 up route add default -iface vps0 ifconfig vps0 inet6 2001:1234:1:2::100 prefixlen 128 route add -inet6 default -iface vps0 * Optionally configure DNS: cp /etc/resolv.conf /usr/vps/test01/etc/resolv.conf * Set a root password: chroot /usr/vps/test01 /usr/bin/passwd * Create /etc/vps/vps_test01.conf (minimal example): NAME = 'test01' FSROOT = '/usr/vps/test01' INIT = '/sbin/init' NETIF_0_ADDRESS = '192.168.98.100, 2001:1234:1:2::100' * Start it up: # vpsctl start test01 # vpsctl list * To open a shell in 'test01'; do # vpsctl shell test01 * For more information about the vpsctl command, see # man vpsctl * * * * End Of File * * * *