Revision as of 11:27, 29 September 2010 by David (talk | contribs) (Created page with '{{Title|How to create a Ubuntu root-file-system for VNX}} Follow this procedure to create a Ubuntu based root-file-system for VNX. The procedure has been tested with Ubuntu 9.10…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to create a Ubuntu root-file-system for VNX

Follow this procedure to create a Ubuntu based root-file-system for VNX. The procedure has been tested with Ubuntu 9.10 and 10.04.

  • Create the filesystem disk image:
  • qemu-img create -f qcow2 root_fs_ubuntu-base.qcow2 5GB
  • Get Ubuntu installation CD. For example:
  • wget
    cp ubuntu-10.04-server-i386.iso /almacen/iso
  • Create a libvirt XML definition (root_fs_freebsd.xml) containing the virtual machine description:
  • <domain type='kvm'>
        <type arch="i686">hvm</type>
        <boot dev='hd'/>
        <boot dev='cdrom'/>
      <clock sync="localtime"/>
        <disk type='file' device='disk'>
          <source file='/usr/share/vnx/filesystems/root_fs_ubuntu-base.qcow2'/>
          <target dev='hda'/>
        <disk type='file' device='cdrom'>
          <source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/>
          <target dev='hdb'/>
        <interface type='network'>
          <source network='default'/>
        <graphics type='vnc'/>

    Note: change "source file=" lines to whatever fits your case (use full paths).

  • Start the virtual machine with:
  • virsh create root_fs_ubuntu.xml
  • Access virtual machine console with:
  • virt-viewer Ubuntu
  • Follow Ubuntu installation menus to install a basic system with ssh server and after that:
    • Update the system
    • apt-get update
      apt-get dist-upgrade
    • Install XML::DOM perl package:
    • apt-get install libxml-dom-perl
    • Install VNX autoconfiguration daemon to:
    • cp vnxdaemon.conf /etc/init
      cp /etc/init.d/ 
    • Delete udev rules files:
    • rm /etc/udev/rules.d/70-persistent-net.rules
      rm /etc/udev/rules.d/70-persistent-cd.rules
    • Only for Ubuntu 10.04:
      • create /media/cdrom* directories:
      • mkdir /media/cdrom0
        mkdir /media/cdrom1
        ln -s /media/cdrom0 /media/cdrom
        ln -s /cdrom /media/cdrom
      • add the following lines to /etc/fstab:
      • /dev/scd0  /media/cdrom0    udf,iso9660  user,noauto,exec,utf8  0  0
        /dev/scd1  /media/cdrom1    udf,iso9660  user,noauto,exec,utf8  0  0
    • Optional: install graphical user interface.
      • Minimal:
      • sudo apt-get install xorg gnome-core gksu gdm gnome-system-tools gnome-nettool firefox-gnome-support
      • Complete:
      • sudo apt-get install ubuntu-desktop
    • Optional: install other services, for example, an apache server:
    • sudo apt-get install apache2
      update-rc.d -f apache2 remove   # to avoid automatic start
    • Stop the machine with: halt

Installing additional software

To install additional software or modify your root file system, you just have to start it as described above and make the operations required on the filesystem.

Known problems

  • Each a cdrom is mounted (for example, ehenever a command is executed on the virtual machine) the following error appear in the console:
  • Jul 27 22:33:31 vnx kernel: [ 4384.875886] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
    Jul 27 22:33:31 vnx kernel: [ 4385.291374] ata1.01: BMDMA stat 0x5
    Jul 27 22:33:31 vnx kernel: [ 4385.493411] sr 0:0:1:0: [sr0] CDB: Read(10): 28 00 00 00 00 18 00 00 01 00
    Jul 27 22:33:31 vnx kernel: [ 4385.493460] ata1.01: cmd a0/01:00:00:00:08/00:00:00:00:00/b0 tag 0 dma 2048 in
    Jul 27 22:33:31 vnx kernel: [ 4385.493461]          res 01/60:00:00:00:08/00:00:00:00:00/b0 Emask 0x3 (HSM violation)
    Jul 27 22:33:31 vnx kernel: [ 4386.263553] ata1.01: status: { ERR }

    However, the command are executed correctly. This error does not appear on Ubuntu 9.10 filesystems.