Vnx-rootfskvmdebian

From VNX
Jump to: navigation, search

How to create a KVM Debian Linux root filesystem for VNX

Basic installation

Follow this procedure to create a KVM Debian Linux based root filesystem for VNX. The procedure has been tested with Debian 6, 7 and 8, as well as Debian based Kali Linux distribution (http://www.kali.org).

  • Create the filesystem disk image:
  • qemu-img create -f qcow2 vnx_rootfs_kvm_debian.qcow2 8G
    
  • Get Ubuntu installation CD. For example:
  • wget http://cdimage.debian.org/debian-cd/6.0.7/i386/iso-cd/debian-6.0.7-i386-netinst.iso
    cp debian-6.0.7-i386-netinst.iso /almacen/iso
    
  • Create the virtual machine with:
  • vnx --create-rootfs vnx_rootfs_kvm_debian.qcow2 --install-media /almacen/iso/debian-6.0.7-i386-netinst.iso --mem 512M
    

    Note: add "--arch x86_64" option for 64 bits virtual machines

  • Follow Debian Linux installation menus to install a the system (with or without GUI).
  • Configure a serial console on ttyS0:
    • Edit /etc/default/grub:
    • GRUB_TIMEOUT=0
      GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"
      
    • Add the following line to /etc/inittab (skip this step for Debian 8 Jessie):
    • 0:2345:respawn:/sbin/getty 38400 ttyS0
      
    • Make grub process the previous config changes:
    • update-grub
      
  • Finally, delete the net udev rules file and halt the system:
  • rm /etc/udev/rules.d/70-persistent-net.rules
    halt -p
    

Configuration

  • Restart the system with the following command:
  • vnx --modify-rootfs vnx_rootfs_kvm_debian.qcow2 --update-aced --mem 512M
    

    Note: add "--arch x86_64" option for 64 bits virtual machines 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 console vnx_rootfs_kvm_debian.qcow2
    
  • Access the console with root account and update the system
  • apt-get update
    apt-get dist-upgrade
    
  • Install XML::DOM perl package and ACPI daemon:
  • apt-get install libxml-libxml-perl libnetaddr-ip-perl acpid
    
  • Install VNX autoconfiguration daemon:
  • mount /dev/sdb /mnt/
    perl /mnt/vnxaced-lf/install_vnxaced
    
  • Edit /etc/network/interfaces file and comment all lines related to eth0, eth1, etc interfaces. Leave only the loopback (lo) interface.
  • Optional: install other services:
    • Apache server:
    • apt-get install apache2
      update-rc.d -f apache2 remove   # to avoid automatic start
      
  • Create a file /etc/vnx_rootfs_version to store version number and informacion about modification:
  • VER=v0.25
    OS=debian 6.0.7
    DESC=Basic Debian 6.0.7 root filesystem
    
  • Stop the machine with vnx_halt:
  • sudo 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_debian.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_debian.qcow2
    
  • Check network connectivity. Maybe you have to activate the network interface by hand:
  • dhclient eth0
    

    Note: use "ip link show" to know which network interface to use.

  • Do the modifications you want.
  • Finally, halt the system using:
  • vnx_halt
    

Examples

  • dhcp server and relay:
    • Install dhcp3 packages:
    • apt-get install dhcp3-server dhcp3-relay
      
    • Disable autostart (optional):
    • update-rc.d -f isc-dhcp-server remove
      update-rc.d -f isc-dhcp-relay remove
      


Updating VNXACED

You can automatically update the VNXACE daemon with the following command:

vnx --modify-rootfs vnx_rootfs_kvm_debian.qcow2 --update-aced -y

If VNXACE daemon is not updated automatically, you can do it manually by accessing the virtual machine console and type:

mount /dev/sdb /mnt/
perl /mnt/vnxaced-lf/install_vnxaced

Known problems

  • None described yet