Difference between revisions of "Vnx-rootfslxc"
(→Basic installation) |
|||
Line 3: | Line 3: | ||
== Basic installation == | == Basic installation == | ||
− | Follow this procedure to create a Ubuntu based LXC root filesystem for VNX. The procedure has been tested | + | Follow this procedure to create a Ubuntu based LXC root filesystem for VNX. The procedure has been tested with Ubuntu versions from 13.10 to 16.04. |
<ul> | <ul> | ||
<li>Create the rootfs with:</li> | <li>Create the rootfs with:</li> | ||
− | lxc-create -t ubuntu -n vnx_rootfs_lxc_ubuntu- | + | lxc-create -t ubuntu -n vnx_rootfs_lxc_ubuntu-16.04 |
Note1: The default username/password is ubuntu/ubuntu.<br> | Note1: The default username/password is ubuntu/ubuntu.<br> | ||
− | Note2: | + | Note2: This method creates an image with the same architecture (32 or 64 bits) as the host. To create a 32 bits image in a 64 bits host, the only method known to work is to follow the procedure described in this page inside a KVM 32 bits virtual machine. |
− | |||
− | |||
<li>Move the rootfs to VNX filesystems directory:</li> | <li>Move the rootfs to VNX filesystems directory:</li> | ||
− | mv /var/lib/lxc/vnx_rootfs_lxc_ubuntu- | + | mv /var/lib/lxc/vnx_rootfs_lxc_ubuntu-16.04/ /usr/share/vnx/filesystems/ |
− | <li>Edit the rootfs configuration file (/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu- | + | <li>Edit the rootfs configuration file (/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-16.04/config) to reflect the directory change:</li> |
− | lxc.rootfs = /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu- | + | lxc.rootfs = /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-16.04/rootfs |
− | lxc.mount = /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu- | + | lxc.mount = /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-16.04/fstab |
<li>Create fstab file (if not created):</li> | <li>Create fstab file (if not created):</li> | ||
− | touch vnx_rootfs_lxc_ubuntu- | + | touch vnx_rootfs_lxc_ubuntu-16.04/fstab |
<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 vnx_rootfs_lxc_ubuntu- | + | lxc-start -n vnx_rootfs_lxc_ubuntu-16.04 -F -f /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-16.04/config |
<li>Once the VM has started, make login (ubuntu/ubuntu) and:</li> | <li>Once the VM has started, make login (ubuntu/ubuntu) and:</li> | ||
<ul> | <ul> | ||
Line 48: | Line 46: | ||
<li>Optionally, create a short link to the rootfs:</li> | <li>Optionally, create a short link to the rootfs:</li> | ||
cd /usr/share/vnx/filesystems | cd /usr/share/vnx/filesystems | ||
− | ln -s vnx_rootfs_lxc_ubuntu- | + | ln -s vnx_rootfs_lxc_ubuntu-16.04 rootfs_lxc |
</ul> | </ul> |
Revision as of 16:38, 7 May 2016
How to create a LXC Ubuntu root filesystem for VNX
Basic installation
Follow this procedure to create a Ubuntu based LXC root filesystem for VNX. The procedure has been tested with Ubuntu versions from 13.10 to 16.04.
- Create the rootfs with:
lxc-create -t ubuntu -n vnx_rootfs_lxc_ubuntu-16.04
Note1: The default username/password is ubuntu/ubuntu.
Note2: This method creates an image with the same architecture (32 or 64 bits) as the host. To create a 32 bits image in a 64 bits host, the only method known to work is to follow the procedure described in this page inside a KVM 32 bits virtual machine.
mv /var/lib/lxc/vnx_rootfs_lxc_ubuntu-16.04/ /usr/share/vnx/filesystems/
lxc.rootfs = /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-16.04/rootfs lxc.mount = /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-16.04/fstab
touch vnx_rootfs_lxc_ubuntu-16.04/fstab
lxc-start -n vnx_rootfs_lxc_ubuntu-16.04 -F -f /usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-16.04/config
- Add VNX user and change the passwords:
sudo adduser vnx sudo adduser vnx sudo sudo passwd root
sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install aptsh openssh-server traceroute telnet nmap apache2 wget tcpdump update-rc.d -f apache2 remove # to avoid automatic start
sudo vi /etc/hosts # change name to vnx sudo vi /etc/hostname # "
echo "pts/0" >> /etc/securetty
sudo deluser ubuntu
halt
tar --numeric-owner -czpf vnx_rootfs_lxc_ubuntu-16.04-v025.tgz vnx_rootfs_lxc_ubuntu-16.04-v025
cd /usr/share/vnx/filesystems ln -s vnx_rootfs_lxc_ubuntu-16.04 rootfs_lxc