Vnx-rootfsopenbsd
How to create a KVM OpenBSD root filesystem for VNX
Follow this procedure to create a KVM OpenBSD based root filesystem for VNX. The procedure has been tested with OpenBSD 7.2.
Contents
Basic installation
- Create the filesystem disk image:
qemu-img create -f qcow2 vnx_rootfs_kvm_openbsd64-7.2.qcow2 20G
wget http://ftp.eu.openbsd.org/pub/OpenBSD/7.2/amd64/install72.iso mv install72.iso /almacen/iso/openbsd-install72.iso
vnx --create-rootfs vnx_rootfs_kvm_openbsd64-7.2.qcow2 --install-media /almacen/iso/openbsd-install72.iso --mem 2G --arch=x86_64
- When asked about the network interface, answer "done" to not configure the network now.
- Answer 'yes' to the question "Change the default console to com0" to enable serial console.
- Add a user named "vnx".
- Use the whole "wd0" or "sd0" disk and "Auto layout".
- Choose cd0 for the "location of sets". Choose the default "sets".
chroot /mnt config -ef /bsd disable mpbios quit
halt -p
The OS installer will offer to reboot, but do not do that. Instead, close the VM console window and then, from the host OS, destroy the virtual machine:
# virsh list Id Nombre Estado ---------------------------------------------------- 33 vnx_rootfs_kvm_openbsd64-7.2.qcow2-7440 ejecutando # virsh destroy 33
Configuration
- Start the system with the following command:
vnx --modify-rootfs vnx_rootfs_kvm_openbsd64-7.2.qcow2 --update-aced --mem 2G --arch x86_64 --vcpu 2
Note: ignore the errors "timeout waiting for response on VM socket".
# virsh list Id Name State ---------------------------------------------------- 31 vnx_rootfs_kvm_openbsd64-7.2.qcow2-912 running # virsh console 31
tty00 "/usr/libexec/getty std.9600" dialup off secure
to:
tty00 "/usr/libexec/getty std.9600" vt100 on secure
Reboot the system after modifying the ttys file.
dhclient re0
export PKG_PATH=ftp://ftp.eu.openbsd.org/pub/OpenBSD/`uname -r`/packages/`machine -a`/
pkg_add -r bash usermod -s /usr/local/bin/bash root usermod -s /usr/local/bin/bash vnx echo "export PKG_PATH=ftp://ftp.eu.openbsd.org/pub/OpenBSD/`uname -r`/packages/`machine -a`/" > ~/.bash_profile
Note: in case pkg_add does not progress, try using another openbsd mirror in PKG_PATH variable.
pkg_add -r p5-XML-LibXML p5-NetAddr-IP
mount_msdos /dev/wd1i /mnt # if virtio=no in vnx.conf mount_msdos /dev/sd1c /mnt # if virtio=yes in vnx.conf perl /mnt/vnxaced-lf/install_vnxaced
sed -i 's#bin/sh#bin/ksh#' /etc/rc.d/vnxaced
VER=v0.25 OS=OpenBSD 7.2 DESC=Basic OpenBSD 7.2 root filesystem without GUI
vnx_halt
If everything went well, your root filesystem will be ready to be used with VNX. You can make a simple test using the simple_openbsd64.xml scenario distributed with VNX.
Installing additional software
To install additional software or to modify your root file system, you just have to:
- Start a virtual machine from it:
vnx --modify-rootfs vnx_rootfs_kvm_openbsd64-7.2.qcow2 --arch x86_64
dhclient re0
vnx_halt
Known problems
OpenBSD tips
To upgrade OpenBSD to the next release, the OpenBSD site provides useful hints. For instance, to upgrade from 7.1 to 7.2, you can follow the instructions provided in http://www.openbsd.org/faq/upgrade72.html