Difference between revisions of "Vnx-rootfslxccentos"
(Created page with "{{Title|How to create a LXC CentOS root filesystem for VNX}} == Basic installation == Follow this procedure to create a CentOS based LXC root filesystem for VNX. The procedu...") |
(→Basic installation) |
||
Line 13: | Line 13: | ||
<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_centos /usr/share/vnx/filesystems/vnx_rootfs_lxc_centos64-7-v025 | mv /var/lib/lxc/vnx_rootfs_lxc_centos /usr/share/vnx/filesystems/vnx_rootfs_lxc_centos64-7-v025 | ||
− | li>Edit the rootfs configuration file (/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu-16.04/config) to reflect the directory change:</li> | + | <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_centos64-7-v025/rootfs | lxc.rootfs = /usr/share/vnx/filesystems/vnx_rootfs_lxc_centos64-7-v025/rootfs | ||
<li>Create fstab file (if not created):</li> | <li>Create fstab file (if not created):</li> | ||
Line 19: | Line 19: | ||
<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_centos64-7-v025 -F -f /usr/share/vnx/filesystems/vvnx_rootfs_lxc_centos64-7-v025/config | lxc-start -n vnx_rootfs_lxc_centos64-7-v025 -F -f /usr/share/vnx/filesystems/vvnx_rootfs_lxc_centos64-7-v025/config | ||
− | <li>Once the VM has started, make login (root/xxxx) and | + | <li>Once the VM has started, make login (root/xxxx) and add VNX user and change the passwords:</li> |
− | |||
− | |||
adduser vnx | adduser vnx | ||
passwd vnx | passwd vnx |
Revision as of 02:21, 5 August 2017
How to create a LXC CentOS root filesystem for VNX
Basic installation
Follow this procedure to create a CentOS based LXC root filesystem for VNX. The procedure has been tested with CentOS version 7.
- Create the rootfs with:
sudo apt-get install yum lxc-create -t centos -n vnx_rootfs_lxc_centos -- -R 7 -a x86_64
chroot /var/lib/lxc/vnx_rootfs_lxc_centos/rootfs passwd
mv /var/lib/lxc/vnx_rootfs_lxc_centos /usr/share/vnx/filesystems/vnx_rootfs_lxc_centos64-7-v025
lxc.rootfs = /usr/share/vnx/filesystems/vnx_rootfs_lxc_centos64-7-v025/rootfs
touch vnx_rootfs_lxc_centos64-7-v025/fstab
lxc-start -n vnx_rootfs_lxc_centos64-7-v025 -F -f /usr/share/vnx/filesystems/vvnx_rootfs_lxc_centos64-7-v025/config
adduser vnx passwd vnx
yum update yum install perl telnet wget openssh-clients traceroute tcpdump net-tools
sudo vi /etc/hosts # change name to vnx sudo vi /etc/hostname # "
sed -i -e "/exit 0/d" /etc/rc.local echo "# /dev/net/tun" >> /etc/rc.local echo "mkdir -p /dev/net/" >> /etc/rc.local echo "mknod -m 666 /dev/net/tun c 10 200" >> /etc/rc.local echo "" >> /etc/rc.local echo "# /dev/kvm" >> /etc/rc.local echo "mknod -m 660 /dev/kvm c 10 232" >> /etc/rc.local
history -c
halt
tar --numeric-owner -czpf vnx_rootfs_lxc_centos64-7-v025.tgz vnx_rootfs_lxc_centos64-7-v025
cd /usr/share/vnx/filesystems ln -s vnx_rootfs_lxc_centos64-7-v025 rootfs_lxc_centos64