Tomasz Ostrowski
2011-Jul-27 09:38 UTC
[CentOS] HOWTO install CentOS 6 on low memory computer or virtual machine (even 192MB RAM)
I've managed to install CentOS 6 on a 192MB virtual machine using LiveCD install-to-disk graphical method. This is not normally possible because of: - hard-coded minimum supported memory in Anaconda installer - it will show a message "You do not have enough RAM to install CentOS Linux on this machine" if you try or force you to use seriously crippled text installer; - a bug in Anaconda installer, which prevents it from using swap during installation. I think it would be useful to be able to install CentOS 6 (or Scientific Linux 6 or RedHat Enterprise Linux - RHEL 6) on low memory old computer or laptop, as it can be very capable firewall, home www server, proxy etc. So the procedure is as follows: 1. Boot to 32-bit CentOS LiveCD (CentOS-6.0-i386-LiveCD.iso) in graphical mode (if you have at least 256MB RAM) or text mode (if you have less than 256MB RAM). 2. Login as root. 3. Edit a file /usr/sbin/anaconda - using vim in text mode or gedit in graphical mode - search for "within" and modify function "within_available_memory" adding a line "return True" like this: def within_available_memory(needed_ram): return True # kernel binary code estimate that is # not reported in MemTotal by /proc/meminfo epsilon = 15360 # 15 MB return needed_ram < (iutil.memInstalled() + epsilon) This would get rid of artificial hard-coded memory requirement. 4. Edit a file /usr/lib/anaconda/storage/__init__.py - search for 4th occurrence of "swapoff" and modify a fragment of function "umountFilesystems" from: for device in devices: if not device.format.mountable and \ (device.format.type != "swap" or swapoff): continue to: for device in devices: if not (device.format.mountable and \ (device.format.type != "swap" or swapoff)): continue (add parentheses - left one after "if not" and right one after "or swapoff"). This would fix a bug in installer. 5. Run "liveinst" which should start graphical installer. 6. During installation create swap partition so that you have at least 1GB of available memory (RAM+swap) (default setup should suffice, but I personally do not recommend it as it used LVM, which AFAIK prevents disks from using barriers). The bug is reported upstream: https://bugzilla.redhat.com/show_bug.cgi?id=708966 but for Fedora Linux. Regards Tometzky -- ...although Eating Honey was a very good thing to do, there was a moment just before you began to eat it which was better than when you were... Winnie the Pooh
R P Herrold
2011-Jul-27 11:06 UTC
[CentOS] HOWTO install CentOS 6 on low memory computer or virtual machine (even 192MB RAM)
On Wed, 27 Jul 2011, Tomasz Ostrowski wrote:> I've managed to install CentOS 6 on a 192MB virtual machine using LiveCD > install-to-disk graphical method.<snip rework of Anaconda, Live CD discussions> I think you are over-thnking this. Anaconda is overkill if all you want to do is blow images onto arbitrary hardware So long as you are going through all this, why not just install to taste into a chroot with yum or RPM, rsync into a prepared hard drive, optionally fix up the fstab grub.conf settings, and run grubby or do a mkinitrd and grub initialization (The transfer and bootloader fixup my be done with a minimal image, PXE loaded, so one does not even need a working CD/DVD/ USB port. PXE has been on substantially all hardware built for the last decade) That approach is portable, and works across all CentOS variants -- Russ herrold