Difference between revisions of "Vnx-rootfsopenbsd"
(→Configuration) |
(→Configuration) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
qemu-img create -f qcow2 vnx_rootfs_kvm_openbsd.qcow2 12G | qemu-img create -f qcow2 vnx_rootfs_kvm_openbsd.qcow2 12G | ||
# 64 bits | # 64 bits | ||
− | qemu-img create -f qcow2 | + | qemu-img create -f qcow2 vnx_rootfs_kvm_openbsd64.qcow2 12G |
<li>Get OpenBSD installation CD. For example:</li> | <li>Get OpenBSD installation CD. For example:</li> | ||
# 32 bits | # 32 bits | ||
− | wget http://mirror.meerval.net/pub/OpenBSD/5. | + | wget http://mirror.meerval.net/pub/OpenBSD/5.9/i386/install59.iso |
− | mv | + | mv install59.iso /almacen/iso/openbsd-install59-i386.iso |
# 64 bits | # 64 bits | ||
− | wget http://ftp.eu.openbsd.org/pub/OpenBSD/5. | + | wget http://ftp.eu.openbsd.org/pub/OpenBSD/5.9/amd64/install59.iso |
− | mv | + | mv install59.iso /almacen/iso/openbsd-install59-amd64.iso |
<li>Create the virtual machine with:</li> | <li>Create the virtual machine with:</li> | ||
# 32 bits | # 32 bits | ||
− | vnx --create-rootfs vnx_rootfs_kvm_openbsd.qcow2 --install-media /almacen/iso/openbsd- | + | vnx --create-rootfs vnx_rootfs_kvm_openbsd.qcow2 --install-media /almacen/iso/openbsd-install59-i386.iso --mem 512M |
# 64 bits | # 64 bits | ||
− | vnx --create-rootfs vnx_rootfs_kvm_openbsd64.qcow2 --install-media /almacen/iso/openbsd- | + | vnx --create-rootfs vnx_rootfs_kvm_openbsd64.qcow2 --install-media /almacen/iso/openbsd-install59-amd64.iso --mem 512M --arch=x86_64 |
<li>Follow OpenBSD installation menus to install a basic system:</li> | <li>Follow OpenBSD installation menus to install a basic system:</li> | ||
<ul> | <ul> | ||
Line 27: | Line 27: | ||
<li>Answer 'yes' to the question "Change the default console to com0" to enable serial console.</li> | <li>Answer 'yes' to the question "Change the default console to com0" to enable serial console.</li> | ||
<li>Add a user named "vnx".</li> | <li>Add a user named "vnx".</li> | ||
− | <li>Use the whole "wd0" disk and "Auto layout".</li> | + | <li>Use the whole "wd0" or "sd0" disk and "Auto layout".</li> |
− | <li>Choose cd0 for the "location of sets" | + | <li>Choose cd0 for the "location of sets". Choose the default "sets".</li> |
</ul> | </ul> | ||
− | <li>After ending installation, but before shutting down the virtual machine, you | + | <li>After ending installation, but before shutting down the virtual machine, you have to disable mpbios, as follows:</li> |
chroot /mnt | chroot /mnt | ||
config -ef /bsd | config -ef /bsd | ||
Line 43: | Line 43: | ||
Id Nombre Estado | Id Nombre Estado | ||
---------------------------------------------------- | ---------------------------------------------------- | ||
− | 33 vnx_rootfs_kvm_openbsd-5. | + | 33 vnx_rootfs_kvm_openbsd-5.9-v025.qcow2-7440 ejecutando |
# virsh destroy 33 | # virsh destroy 33 | ||
Line 60: | Line 60: | ||
Id Name State | Id Name State | ||
---------------------------------------------------- | ---------------------------------------------------- | ||
− | 31 vnx_rootfs_kvm_openbsd64-5. | + | 31 vnx_rootfs_kvm_openbsd64-5.9-v025.qcow2-912 running |
# virsh console 31 | # virsh console 31 | ||
Line 80: | Line 80: | ||
pkg_add -r p5-XML-LibXML p5-NetAddr-IP | pkg_add -r p5-XML-LibXML p5-NetAddr-IP | ||
<li>Install VNX autoconfiguration daemon:</li> | <li>Install VNX autoconfiguration daemon:</li> | ||
− | mount_msdos /dev/wd1i /mnt | + | 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 | perl /mnt/vnxaced-lf/install_vnxaced | ||
<li>Create a file /etc/vnx_rootfs_version to store version number and informacion about modification:</li> | <li>Create a file /etc/vnx_rootfs_version to store version number and informacion about modification:</li> | ||
Line 109: | Line 110: | ||
vnx_halt | vnx_halt | ||
</ul> | </ul> | ||
+ | |||
+ | == Known problems == | ||
+ | |||
+ | == OpenBSD tips == | ||
+ | |||
+ | To upgrade OpenBSD to the next release, the OpenBSD site provides useful hints. For instance, to upgrade from 5.8 to 5.9, you can follow the instructions provided in http://www.openbsd.org/faq/upgrade59.html |
Revision as of 20:42, 16 May 2016
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 5.8.
Contents
Basic installation
- Create the filesystem disk image:
# 32 bits qemu-img create -f qcow2 vnx_rootfs_kvm_openbsd.qcow2 12G # 64 bits qemu-img create -f qcow2 vnx_rootfs_kvm_openbsd64.qcow2 12G
# 32 bits wget http://mirror.meerval.net/pub/OpenBSD/5.9/i386/install59.iso mv install59.iso /almacen/iso/openbsd-install59-i386.iso # 64 bits wget http://ftp.eu.openbsd.org/pub/OpenBSD/5.9/amd64/install59.iso mv install59.iso /almacen/iso/openbsd-install59-amd64.iso
# 32 bits vnx --create-rootfs vnx_rootfs_kvm_openbsd.qcow2 --install-media /almacen/iso/openbsd-install59-i386.iso --mem 512M # 64 bits vnx --create-rootfs vnx_rootfs_kvm_openbsd64.qcow2 --install-media /almacen/iso/openbsd-install59-amd64.iso --mem 512M --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_openbsd-5.9-v025.qcow2-7440 ejecutando # virsh destroy 33
Configuration
- Start the system with the following command:
# 32 bits vnx --modify-rootfs vnx_rootfs_kvm_openbsd.qcow2 --update-aced --mem 512M # 64 bits vnx --modify-rootfs vnx_rootfs_kvm_openbsd64.qcow2 --update-aced --mem 512M --arch x86_64
Note: ignore the errors "timeout waiting for response on VM socket".
# virsh list Id Name State ---------------------------------------------------- 31 vnx_rootfs_kvm_openbsd64-5.9-v025.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
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
VER=v0.25 OS=OpenBSD 5.8 DESC=Basic OpenBSD 5.8 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_openbsd.xml (32 bits) or simple_openbsd64.xml (64 bits) 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:
# 32 bits vnx --modify-rootfs vnx_rootfs_kvm_openbsd.qcow2 # 64 bits vnx --modify-rootfs vnx_rootfs_kvm_openbsd.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 5.8 to 5.9, you can follow the instructions provided in http://www.openbsd.org/faq/upgrade59.html