Difference between revisions of "Vnx-rootfslxcdebian"
(8 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
== Basic installation == | == Basic installation == | ||
− | Follow this procedure to create a LXC Debian based root filesystem for VNX. The procedure has been tested creating a Debian | + | Follow this procedure to create a LXC Debian based root filesystem for VNX. The procedure has been tested creating a Debian Squeeze (6) over an Ubuntu 13.10 host. |
<ul> | <ul> | ||
<li>Create the rootfs with:</li> | <li>Create the rootfs with:</li> | ||
− | lxc-create -t | + | lxc-create -t debian -n vnx_rootfs_lxc_debian |
− | Note1: | + | Note1: The default username/password is root/root.<br> |
Note2: use linux32 command to create a 32 bits image from a 64 bits machine, that is: | Note2: use linux32 command to create a 32 bits image from a 64 bits machine, that is: | ||
linux32 lxc-create -t debian -n vnx_rootfs_lxc_debian | linux32 lxc-create -t debian -n vnx_rootfs_lxc_debian | ||
+ | Note3: (revise, the template does not work)the debian lxc template distributed with ubuntu creates a Debian 6 (squeeze) image. To create a Debian 7 (Wheezy) image you have to download a template, for example, following the procedure described [http://www.pokorra.de/2014/01/lxc-linux-containers-on-jiffybox-running-centos-on-ubuntu/ here]. | ||
+ | wget https://gist.github.com/tpokorra/8488744/raw/f1d050704e8cc8c70dd956eb18e6374d70f8ecf6/lxc-debian-wheezy | ||
+ | mv lxc-debian-wheezy /usr/share/lxc/templates/lxc-debian-wheezy | ||
+ | chmod a+x /usr/share/lxc/templates/lxc-debian-wheezy | ||
+ | lxc-create -t debian-wheezy -n vnx_rootfs_lxc_debian | ||
+ | |||
<li>Move the rootfs to VNX filesystems directory:</li> | <li>Move the rootfs to VNX filesystems directory:</li> | ||
− | mv /var/lib/lxc/ | + | mv /var/lib/lxc/vnx_rootfs_lxc_debian/ /usr/share/vnx/filesystems/ |
− | <li>Edit the rootfs configuration file (/usr/share/vnx/filesystems/ | + | <li>Edit the rootfs configuration file (/usr/share/vnx/filesystems/vnx_rootfs_lxc_debian/config) to reflect the directory change:</li> |
− | lxc.rootfs = /usr/share/vnx/filesystems/ | + | lxc.rootfs = /usr/share/vnx/filesystems/vnx_rootfs_lxc_debian/rootfs |
− | |||
<li>Start the new rootfs to configure it and install new software:</li> | <li>Start the new rootfs to configure it and install new software:</li> | ||
− | lxc-start -n | + | lxc-start -n vnx -f /usr/share/vnx/filesystems/vnx_rootfs_lxc_debian/config |
− | <li>Once the VM has started, make login ( | + | <li>Once the VM has started, make login (root/root) and:</li> |
<ul> | <ul> | ||
<li>Add VNX user and change the passwords:</li> | <li>Add VNX user and change the passwords:</li> | ||
− | + | adduser vnx | |
− | + | adduser vnx sudo | |
− | + | passwd root | |
<li>Update the system:</li> | <li>Update the system:</li> | ||
− | + | apt-get update | |
− | + | apt-get dist-upgrade | |
− | <li>And install additional software, for example (list taken from [http://wiki.pcprobleemloos.nl/using_lxc_linux_containers_on_debian_squeeze/creating_a_lxc_virtual_machine_template here]): | + | <li>And install additional software, for example (list taken from [http://wiki.pcprobleemloos.nl/using_lxc_linux_containers_on_debian_squeeze/creating_a_lxc_virtual_machine_template here]):</li> |
− | |||
apt-get --no-install-recommends install -y adduser apt-utils iproute netbase sudo iputils-ping iptables rsyslog | apt-get --no-install-recommends install -y adduser apt-utils iproute netbase sudo iputils-ping iptables rsyslog | ||
Line 37: | Line 41: | ||
apt-get install net-tools ifupdown sockstat | apt-get install net-tools ifupdown sockstat | ||
apt-get install wget less lsof screen apt-utils nano telnet inetutils-ping psmisc | apt-get install wget less lsof screen apt-utils nano telnet inetutils-ping psmisc | ||
+ | apt-get install aptsh traceroute nmap apache2 wget tcpdump vim | ||
<li>Change VM name in hosts and hostname files:</li> | <li>Change VM name in hosts and hostname files:</li> | ||
− | + | vi /etc/hosts # change name to vnx | |
− | + | vi /etc/hostname # " | |
− | <li>'''Important:''' edit /etc/network/interfaces and coment "inet dhcp" lines to avoid delays at startup | + | <li>'''Important:''' edit /etc/network/interfaces and coment "inet dhcp" lines to avoid delays at startup. |
</ul> | </ul> | ||
<li>Stop the VM with:</li> | <li>Stop the VM with:</li> |
Latest revision as of 00:28, 5 May 2014
How to create a LXC Debian root filesystem for VNX
DRAFT, DRAFT, DRAFT...not finished yet
Basic installation
Follow this procedure to create a LXC Debian based root filesystem for VNX. The procedure has been tested creating a Debian Squeeze (6) over an Ubuntu 13.10 host.
- Create the rootfs with:
lxc-create -t debian -n vnx_rootfs_lxc_debian
Note1: The default username/password is root/root.
Note2: use linux32 command to create a 32 bits image from a 64 bits machine, that is:
linux32 lxc-create -t debian -n vnx_rootfs_lxc_debian
Note3: (revise, the template does not work)the debian lxc template distributed with ubuntu creates a Debian 6 (squeeze) image. To create a Debian 7 (Wheezy) image you have to download a template, for example, following the procedure described here.
wget https://gist.github.com/tpokorra/8488744/raw/f1d050704e8cc8c70dd956eb18e6374d70f8ecf6/lxc-debian-wheezy mv lxc-debian-wheezy /usr/share/lxc/templates/lxc-debian-wheezy chmod a+x /usr/share/lxc/templates/lxc-debian-wheezy lxc-create -t debian-wheezy -n vnx_rootfs_lxc_debian
mv /var/lib/lxc/vnx_rootfs_lxc_debian/ /usr/share/vnx/filesystems/
lxc.rootfs = /usr/share/vnx/filesystems/vnx_rootfs_lxc_debian/rootfs
lxc-start -n vnx -f /usr/share/vnx/filesystems/vnx_rootfs_lxc_debian/config
- Add VNX user and change the passwords:
adduser vnx adduser vnx sudo passwd root
apt-get update apt-get dist-upgrade
apt-get --no-install-recommends install -y adduser apt-utils iproute netbase sudo iputils-ping iptables rsyslog apt-get install --no-install-recommends openssh-blacklist openssh-blacklist-extra openssh-server apt-get install net-tools ifupdown sockstat apt-get install wget less lsof screen apt-utils nano telnet inetutils-ping psmisc apt-get install aptsh traceroute nmap apache2 wget tcpdump vim
vi /etc/hosts # change name to vnx vi /etc/hostname # "
halt
cd /usr/share/vnx/filesystems ln -s vnx_rootfs_lxc_ubuntu-13.10 rootfs_lxc