Difference between revisions of "Vnx-rootfslxc"

From VNX
Jump to: navigation, search
(Created page with "{{Title|How to create a LXC Ubuntu/Debian root filesystem for VNX}} == Basic installation == === Creación de un rootfs === Follow this procedure to create a LXC Ubuntu/Deb...")
 
(Creación de un rootfs)
Line 2: Line 2:
  
 
== Basic installation ==
 
== Basic installation ==
 
=== Creación de un rootfs ===
 
  
 
Follow this procedure to create a LXC Ubuntu/Debian based root filesystem for VNX. The procedure has been tested over Ubuntu 13.10.  
 
Follow this procedure to create a LXC Ubuntu/Debian based root filesystem for VNX. The procedure has been tested over Ubuntu 13.10.  

Revision as of 10:54, 17 February 2014

How to create a LXC Ubuntu/Debian root filesystem for VNX

Basic installation

Follow this procedure to create a LXC Ubuntu/Debian based root filesystem for VNX. The procedure has been tested over Ubuntu 13.10.

  • Create the rootfs with:
  • lxc-create -t ubuntu -n vnx_rootfs_lxc_ubuntu-13.10
    

    Change "ubuntu" by "debian" in case you want to create a Debian rootfs. The default username/password is ubuntu/ubuntu.

  • Move the rootfs to VNX filesystems directory:
  • mv /var/lib/lxc/vnx_rootfs_lxc_ubuntu-13.10/ /usr/share/vnx/filesystems/
    
  • Edit the rootfs configuration file (/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-13.10-v025/config) to reflect the directory change:
  • lxc.rootfs = /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-13.10/rootfs
    lxc.mount  = /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-13.10/fstab
    
  • Start the new rootfs to configure it and install new software:
  • lxc-start -n vnx_rootfs_lxc_ubuntu-13.10-v025 -f /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-13.10/config
    
  • Once the VM has started, make login (ubuntu/ubuntu) and:
    • Add VNX user and change the passwords:
    • sudo adduser vnx
      sudo passwd root
      
    • Update and install software:
    • sudo apt-get update
      sudo apt-get dist-upgrade
      sudo apt-get install aptsh openssh-server traceroute telnet nmap apache2 wget tcpdump
      
    • Change VM name in hosts and hostname files:
    • sudo vi /etc/hosts         # change name to vnx
      sudo vi /etc/hostname      #     "
      
    • Important: Edit /etc/network/interfaces and coment "inet dhcp" lines to avoid delays at startup. Besides, edit /etc/init/failsafe.conf and change all "sleep XX" commands to "sleep 1".
  • Stop the VM with:
  • halt
    
  • Optionally, create a short link to the rootfs:
  • cd /usr/share/vnx/filesystems
    ln -s vnx_rootfs_lxc_ubuntu-13.10 rootfs_lxc