Difference between revisions of "Vnx-rootfsopenbsd"

From VNX
Jump to: navigation, search
(Basic installation)
Line 24: Line 24:
 
<li>Follow OpenBSD installation menus to install a basic system:</li>
 
<li>Follow OpenBSD installation menus to install a basic system:</li>
 
<ul>
 
<ul>
<li>Add a user named "vnx"</li>
+
<li>When asked about the network interface, answer "done" to not configure the network now.</li>
<li>When asked about the network interface, answer "done"</li>
 
 
<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>Notice that if you have downloaded installXX.iso, you can specify installation from CD in the setup program, instead of downloading packages from network. Later, you can update the system.</li>
+
<li>Add a user named "vnx".</li>
 +
<li>Use the whole "wd0" disk and "Auto layout".</li>
 +
<li>Choose cd0 for the "location of sets" question if you have installed from the .iso disk as proposed here (you can alternatevely downloading packages from the network using http). Besides, you can update the system later. Choose the default "sets".</li>
 
</ul>
 
</ul>
 
<li>After ending installation, but before shutting down the virtual machine, you he to disable mpbios, as follows:</li>
 
<li>After ending installation, but before shutting down the virtual machine, you he to disable mpbios, as follows:</li>
Line 39: Line 40:
  
 
The OS installer will offer to reboot, but do not do that. Instead, kill the VM window and then, in the host OS, interrupt with Ctrl-C the kvm program.
 
The OS installer will offer to reboot, but do not do that. Instead, kill the VM window and then, in the host OS, interrupt with Ctrl-C the kvm program.
 
  
 
== Configuration ==
 
== Configuration ==

Revision as of 17:30, 2 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.

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_openbsd.qcow2 12G
    
  • Get OpenBSD installation CD. For example:
  • # 32 bits
    wget http://mirror.meerval.net/pub/OpenBSD/5.8/i386/install58.iso
    mv install58.iso /almacen/iso/openbsd-install58-i386.iso
    # 64 bits
    wget http://ftp.eu.openbsd.org/pub/OpenBSD/5.8/amd64/install58.iso
    mv install58.iso /almacen/iso/openbsd-install58-amd64.iso
    
  • Create the virtual machine with:
  • # 32 bits
    vnx --create-rootfs vnx_rootfs_kvm_openbsd.qcow2 --install-media /almacen/iso/openbsd-install58-i386.iso --mem 512M
    # 64 bits
    vnx --create-rootfs vnx_rootfs_kvm_openbsd64.qcow2 --install-media /almacen/iso/openbsd-install58-amd64.iso --mem 512M --arch=x86_64
    
  • Follow OpenBSD installation menus to install a basic system:
    • 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" disk and "Auto layout".
    • Choose cd0 for the "location of sets" question if you have installed from the .iso disk as proposed here (you can alternatevely downloading packages from the network using http). Besides, you can update the system later. Choose the default "sets".
  • After ending installation, but before shutting down the virtual machine, you he to disable mpbios, as follows:
  • chroot /mnt
    config -ef /bsd
    disable mpbios
    quit
    
  • Finally, halt the system:
  • halt -p
    

The OS installer will offer to reboot, but do not do that. Instead, kill the VM window and then, in the host OS, interrupt with Ctrl-C the kvm program.

Configuration

  • Start the system with the following command:
  • vnx --modify-rootfs vnx_rootfs_kvm_openbsd.qcow2 --update-aced --mem 512M --arch x86_64
    

    Note: ignore the errors "timeout waiting for response on VM socket".

  • Access the system through the text console to easy the copy-paste of commands:
  • # virsh list
    Id    Name                           State
    ----------------------------------------------------
    31    vnx_rootfs_kvm_openbsd64-5.8-v025.qcow2-912 running
     
    # virsh console 31
    
  • Loogin as root in the console and configure the network with DHCP:
  • dhclient re0
    
  • Configure the environment variable with network repository:
  • export PKG_PATH=ftp://ftp.eu.openbsd.org/pub/OpenBSD/`uname -r`/packages/`machine -a`/
    
  • Install bash and change package repository (change ftp.es.freebsd.org to your nearest mirror):
  • 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
    
  • Install XML::LibXML and NetAddr-IP perl libraries:
  • pkg_add -r p5-XML-LibXML p5-NetAddr-IP 
    
  • Install VNX autoconfiguration daemon:
  • mount_msdos /dev/wd1i /mnt
    perl /mnt/vnxaced-lf/install_vnxaced
    
  • Create a file /etc/vnx_rootfs_version to store version number and informacion about modification:
  • VER=v0.25
    OS=OpenBSD 5.8
    DESC=Basic OpenBSD 5.8 root filesystem without GUI
    
  • Configure interface em0 so that it does not get configured with DHCP. To do that, if file /etc/hostname.em0 exists, edit it and delete or comment the line with "dhcp".
  • Stop the machine with that script:
  • vnx_halt
    
  • Configure the serial console by editting /etc/ttys file and changing the line:
  • tty00 "/usr/libexec/getty std.9600"   dialup  off secure
    

    to:

    tty00 "/usr/libexec/getty std.9600"   vt100  on secure
    

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 scenario distributed with VNX.