7 ms·
Ubuntu low-memory install for VMs
- lucb1e 14y agoOkay, so what's the downside? Half the disk usage and 10x less memory, something is left out. What is? Very good tip though, I always overlooked the F4 modes and never knew there was a minimal mode.
- ams6110 14y agoThe downside is that nothing is installed by default. You have basically the bare minimum to boot and run. Need Apache? you will need to install it. Need to send email? You will need to set that up. Need python? Ditto. And hope you like working at the command line because you have no X. Etc. It's a nice way to get a system that does just what you need it to do and nothing more, but "minimal" installs are rarely useful all by themselves; they are a starting point.
- drdaeman 14y agoIIRC, Ubuntu Server does not install X11 and it does not install Apache (unless you chose "Web Server" role or tick "Apache" checkbox in "Custom" role at install time) or any MTA or MDA.
- porker 14y agoThat's correct
- TallGuyShort 14y agoThat's what package managers are for. 'sudo apt-get ...'. Done.
- lucb1e 14y agoThen what does it take 600MB for? That's as big as WinXP with a full GUI and all MS' bloatware.
- xionon 14y agoA minimal install is going to require you to install dozens of related packages just to accomplish simple tasks. It's basically a blank slate, with nothing you might want aside from the OS and terminal. It's a great starting place if you know exactly what you want to do with that VM and how to configure it; it's kind of a pain if you're using it as a general purpose server.
- bradleyland 14y agoAll my infrastructure build materials are run against a VM built from Debian netinst. The benefit of this is that I won't be dependent upon some happy default in the Debian full install that may disappear or change at a later date. The dependency stack is fully exposed all the way down to the bare OS. If that sounds like more work, that's because it is, but the next time something breaks, it's more immediately obvious that a an underlying package has changed.
- bluedino 14y agoIt's easy to make the argument that you shouldn't have anything installed on a server that you don't specifically need - each additional service/program is just another attack vector.
- ukandy 14y agoYou get a very clean starting point, allowing you to note the exact software a server is dependant on. It's more secure to only have the bare minimum software installed.
- wereHamster 14y agoA debootstrap'ped ubuntu quantal is just 260M. That's much less than the 680M that are used by the minimal installation.
- trapezor 14y agoThe cloud images are like 200mb, too: http://cloud-images.ubuntu.com/quantal/current/ http://cloud-images.ubuntu.com/quantal/current/
- wereHamster 14y agoIs there any documentation available how these images were built?
- drasch 14y agoMemory analysis isn't right on this. real difference is: 561M - 487M(cached) - 23M(buffers) = 51M vs. 50M - 21M(cached) - 6M(buffers) = 23M 2x difference (4M of which is vmtoolsd)
- FooBarWidget 14y agoYes, this is how you're supposed to read memory usage in 'top' and 'free'. One must substract caches and buffers from the 'free memory' value. A lot of people read the values wrong and think that they're running out of memory.
- redblacktree 14y agoObviously there is the man page, but could you explain that a little more fully? (or link to something that does) I think I may have been misreading the numbers, but I don't quite follow your recommended approach.
- heiska 14y agohttp://www.linuxatemyram.com http://www.linuxatemyram.com explains it.
- redblacktree 14y agoThanks! Exactly what I needed and entertaining too!
- fredsted 14y agoI'm wondering how a blog labeling itself "Advanced persistent cybersecurity" does not know this.
- jeffcutsinger 14y agoBecause, as the OP says, he spends more time programming than doing SysOps.
- Wilya 14y agoIf you allocate more memory, programs will use it. Web browsers are notorious for abusing this, but it applies in lots of other places, including system cache. In other words: if you allocate 1GB of RAM to a system and 256MB to another, the first will appear to use more RAM. You're reducing memory usage and performance at the same time. Whether you want that or not depends on what you want to run.
- redtuesday 14y agoWhy not just use the Server version?
- henrikgs 14y agoJudging by the pictures (well the text also) he is using the server version
- redtuesday 14y agoAh, thanks, totaly overlooked that. :)
- taylorlapeyre 14y agoDoes anybody have a vagrant box with this setup?
- carrja99 14y agoI usually just modify the ram arguments for the actual machine. vb.customize [ 'modifyvm', :id, '--name', node[:hostname], '--memory', node[:ram].to_s ] We use this to perform cluster testing locally with 4 to 6 128mb nodes. :)
- hosay123 14y agoAs others have mentioned a debootstrapped install can be much thinner, but even debootstrap will pull in some needless stuff. For example /usr/share/doc, or support for every internationalization even though your server app always runs (or should always run?) with C locale – there's 100mb right there.
- denysonique 14y agoGentoo Linux to the rescue.
- IgorPartola 14y agoExcept with Gentoo, you have to install all the header files for every library you use, which easily outweighs any benefit you get from not having to install certain locales, etc. When I saw that my 2GB install of Gentoo was equivalent to a 500MB install of Ubuntu I abandoned it. Also, if you are a developer, do you really want to be a one man/woman IT show just to get your laptop up and running? Gentoo is a great learning distro that is slightly more abstracted away than Linux From Scratch, but that's where its usefulness ends. Doing a proper "compile newer version of GCC, then recompile GCC with it, then recompile GCC again" voodoo is just tiresome after the first time. Yes you may lose some performance, but chances are your time is worth way more than what the setup takes.
- markokocic 14y ago> Doing a proper "compile newer version of GCC, then recompile GCC with it, then recompile GCC again" voodoo is just tiresome after the first time. Yes you may lose some performance, but chances are your time is worth way more than what the setup takes. I agree the recompiles take time, but it's not like you are going to sit in front of the computer and stare at the console output window while emerge is running.
- IgorPartola 14y agoCompare a multi-hour bootstrapping process of Gentoo with the under 10 minute installation of Ubuntu. When you are trying to quickly bring up a new server (especially as the old one is failing), this counts. Also from my years of using Gentoo, you had to babysit a large portion of the initial installation.
- trotsky 14y agoHe made the two vms with different amounts of ram: the small one has 256M and the big one has 1G. That's what the OS is supposed to do, fille a large portion of the unused and available memory with disk cache. My ubuntu install uses almost 8 gigs in cache, what a pig! BTW - if he installed open-vm-tools with the balloon driver it would recover all that disk cache ram as soon as the hypervisor was under any amount of memory pressure.
- gillianseed 14y agoAgreed, keeping programs (once they've been exited) and data in cache is a good thing as it means that you don't have to read them from disk again in subsequent runs/accesses. And given that a cache is a mirror of existing data (as opposed to buffers which are temporary storage space), the cache can be instantly flushed by the system if you need that ram for anything else. This means that it's good if the memory resources the operating system needs to function are low, since it then has more memory for caching. This flies in the face of the often heard comment -'it doesn't matter if operating system X is a ram hog, I want my memory to be used'. I also want my memory to be used, but by the applications I run, not the base operating system. If the operating system is lean, the more memory is available to the applications you launch, aswell as the system being able to keep as much data as possible cached to prevent slow disk reads.
- ParadisoShlee 14y agowhen it comes to slim bloatfree distros, Id rather just install archlinux. because there isn't a smaller footprint than core.
- indigo_daddy 14y agoExcept that of course, as a server OS, Arch is not ideal. Ideal slim bloatfree distro for as a server would of course be Debian.
- mrinterweb 14y agoThis article makes me believe the author does not understand how memory allocation on Linux works. It should not be a mystery that a VM with 4x memory utilizes more available memory.
- hazov 14y agoI think you need to test the netinst Debian image, the iso is only 180 mb, there's even a biz card version which is 50 mb, I generally use this for testing.
- Lycanthrope 14y agoThere is also Ubuntu Core [0] (my install uses 140MB on disk, 25MB RAM). It has no installer, so you have to do everything yourself — from partitioning to boot loader installation. [0] https://wiki.ubuntu.com/Core https://wiki.ubuntu.com/Core
- peterwwillis 14y agoThis may have much more to do with the install process than how much memory an installed system needs. For example, old RHEL install images required at least 512MB or more to install, because it would uncompress a gigantic bootstrap/initrd into memory instead of running cloop'd or off the disk. An installed system only needs enough memory for the kernel and whatever apps you need to run. Install it with a lot of memory, then reduce the memory footprint to fit your application.
- epo 14y agoA front page story on "Hacker News" recommends installing minimal versions of Linux to cut down on VM resource usage, and gets votes. What next? Get computers to behave exactly as you want them to by configuring them according to your needs?
- marshray 14y agoIt's a system admin tip that's valuable in proportion to the number of Ubuntu VM images you have running. For some folks here, that's quite a few. Note that in Erratasec's case, they need to have a diversity of VMs for real hacking. Go check out the the Ubertooth One mentioned in the article, it's badass. In my case, I was just going to be installing one in the next few days and was looking for ways to reduce drive space used on my SSD.
- est 14y agoto quote reddit: "because I haven't seen it before"
- StavrosK 14y agoIt sounds like most people here don't know about Ubuntu Mini: https://help.ubuntu.com/community/Installation/MinimalCD https://help.ubuntu.com/community/Installation/MinimalCD It's a 28 Megabyte .iso, installing it gives you a server with around 20-30 MB of RAM usage. I use it for everything, and then install vim and htop and I'm good to go. I haven't noticed anything missing, so it's definitely my go-to install for low-RAM servers or VMs.
- edmundhuber 14y agoI use this as a starting point for every laptop/desktop I've used in the past few years. Instant boot, no mystery services, yet access to the same great Ubuntu repos.
- sandGorgon 14y agointeresting - can one create an iso from this with only my packages? I want to use it to install across an entire office.
- mydoghasworms 14y agoHave you looked at Suse Studio? http://susestudio.com/ http://susestudio.com/ Frankly, as an Ubuntu/Debian-derivative user, I'm a bit jealous. I wish there were something like this based on Debian (or Ubuntu for that matter). You can tailor a system to your needs and then download or share your custom ISO.
- dkuntz2 14y agoWhy not just use Arch?
- porker 14y agoI'm really curious about Arch. What gap in the market does it fill? What advantages does it have over Debian or Ubuntu? It's certainly mentioned a lot on HN...
- locofacetwice 14y agowhy don't just install debian.....
- avenger123 14y agoSince we are on the subject. How much memory for a VM would be optimal for a git server running on 12.04? This would just be for personal use. Can it get by with 256 MB allocated? I know there is a lot of "it depends" on this.
- benjarrell 14y agoThe OS installer will need more, but that should fine.
- indigo_daddy 14y agoI have NetbootCD on a USB stick, works great for netinstalls of Ubuntu, Debian, CentOS/Scientific, Fedora, etc: http://netbootcd.tuxfamily.org/ http://netbootcd.tuxfamily.org/
- amitgupta151 14y agoThis sounds really great!