Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to build a Linux based OS which is custom made for only one application and is totally light-weight and uses minimum system resources. How do I go about this?

Would stripping down an already existing OS such as Ubuntu be a good idea?

share|improve this question
2  
What kind of application? A graphical one that depends on many things like a X server, desktop environment, possible network access or other... Or an application like for an embedded system, that can be the only process running on the machine? –  Stéphane Chazelas Jan 17 '13 at 11:08
    
@StephaneChazelas: Yes , it would typically support GUI. I would most probably host a gui based application, but my idea is that when i run that os, directly that application starts and when i close it, the os shuts down –  sreeraag Jan 17 '13 at 13:13
    
For your requirement, starting with compiling your own kernel from source would be the way to go. Compile the kernel from source and include only the applications that you want. Remember that everything that is not the kernel or a kernel module is an application. –  midnightsteel Jan 17 '13 at 17:44
    
Gentoo might be a distro you might want to check if you really want Linux. If not, as said below, a BSD is worth a look. –  schaiba May 25 at 16:42

4 Answers 4

I have been thinking about it as well, as there are many ways a big application can fail in security, like a browser, as it always has bugs/vulnerabilities to be solved.

I believe you have to start compiling a kernel for a virtual machine emulator, drivers for that especific video card, drivers for just one ether card and no need for shadowed passwords, usb support, bluetooth, wireles drivers, filesystems and all exoteric stuff there is.

You also need the minimum amount of /bin/ /sbin/ /usr/ and the directory hierarchy files to boot the system.

So you end up creating a really thin system with none of the complexities a complete Linux system has.

Actually I believe there is a lot o people in need of such a distro and it would be very easy to keep updating it, I would definitely contribute to a project like that with money.

Separate the big and dangerous applications from the main system and run them isolated on a VM.

The bottom system could be a more security rigorous system such as OpenBSD or FreeBSD.

Plus, I wish there was a WORKSTATION OpenBSD distro as well (not a server OpenBSD distro) to run this pocket linux distros on OpenBSD with Qemu.

Why?! Because the base system for OpenBSD is audited and none of the linux code is, most of the time (not completely sure).

Lots of big and security risky apps could be running on that lightweight distro, like: gimp, libreoffice, all sorts of browsers (open and closed source), java ides, p2p apps of all sorts and many others.

Another thing is that the base distro could be distributed as an qemu image or with all other types of VM disk image formats, and also the application images, with all that is necessary to run that specific application like an image as well.

This way we will end up with a kernel, a base linux filesystem image and many application images and they can all be updated in separate.

The distro could be loaded with one image for the base linux distro in one virtual drive, the app image in another virtual disk drive and voilà!

Sand boxing, jailing and running securely all sorts of applications !

share|improve this answer

If you want to build a Linux based OS that runs only what's necessary for the computer to work, and if you have time for that you should have a look at LFS.
http://www.linuxfromscratch.org/
It is a book that explains everything you need to know about compiling the linux kernel. Of course it takes a lot of time but in the end it's always a good idea to have a look. After you made your custom Linux distribution, then you can read BLFS (Beyond Linux From Scratch) to add some applications.
In the process of creating your Linux distribution, you will see how to launch the applications at startup.

By the way, forking Ubuntu is the WORST idea ever. It's absolutely not light and runs a bunch of applications at startup. I would recommend you Archlinux. It's a lot lighter than Ubuntu. Hope it helps.

Archlinux Link : https://www.archlinux.org/ As the title says, it's a lightweight distribution, might be just what you look for. Instead of building your own distribution, just give a shot at Arch and make your application run at the startup, it's not that complicated.

share|improve this answer

The basic idea would be to start your application as init (but be careful, process 1 is very special). Perhaps start with one of the mini-distributions, and work from there? Or even set up an initramfs with what is needed, and never leave it?

Also consider carefully if the savings of not having even a minimal userland available are worth the absolute impossibility of troubleshooting/tweaking.

share|improve this answer

This one might be a kind of opposite answer.

Take a look at DSL(Damn Small Linux). This might be what you need. This one is actually built to be used on a system with low hardware configuration like low memory. It comes with basics components like just vim and nano editor, a browser, a remote-desktop viewer, and some other basic features. Checkout this wiki link for more info on it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.