arrow-down coffee engineering consultancy development remote-management support linkedin twitter youtube email phone

Hacking on NodeOS

Submitted by Raj Kissu on February 19, 2014

Building a operating system, even a simple one, is no small feat. For starters, you will have to be familiar with programming in Assembly or a low level language like C/C++. In addition to possessing technical know-how of your chosen language, a lot of thought would have to go into its design:

  • does it have a GUI, a command line, or both?
  • what processor architecture will be designed for? 32-bit or 64-bit?
  • build from scratch or use an existing kernel?
  • use an existing boot loader or roll your own?
  • which API to implement for easier porting of applications from other OSes?
  • go with a monolithic or microkernel?
  • and so on ...

Given the high barrier of entry, it doesn't come as a surprise that not just every programmer out there wants to build an OS - at least not in the conventional sense. Not unless, of course, you have the right tools to make OS development much easier - tools like

. In fact, the project author Jacob Groundwater did just that when he started working on NodeOS.

For now, NodeOS seems more of an experimental idea which presents a custom shell -

- on top of the Linux kernel. However, the project has ambitious goals - with the author intent on getting it to work on hardware, hypervisors (VirtualBox, VMWare), as well as on cloud providers like Joyent and Amazon.

System Structure

NodeOS can be broken down into layers, making development much easier. There are 5 layers at this point in time, and they are all managed by

  • Layer-0: boot loader and kernel, provided by Docker
  • Layer-1: Linux shared libraries
  • Layer-2: Node.js binary
  • Layer-3: core NodeOS - init daemon and package manager
  • Layer-4: customizing distributions by adding userland modules

Want to add changes to the NodeOS core? Add code to Layer 3. Feel the need to customize the NodeOS distribution by packaging userland modules? Add them to layer 4.

Getting Started

To get started with NodeOS, you need

installed on your machine. I recommend spinning up a virtual machine with Ubuntu Precise 12.04 (LTS) (64-bit) as your operating system of choice.

Install Docker

If you don't already have

, use this curl script to automate your installation.

curl -s | sudo sh

Install NodeJS

Use the

apt repository to get your installation up and running:

apt-get install python-software-properties
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs

Run the Demo!

Loading the default NodeOS demo is as easy as running a single


sudo docker run -i -t nodeos/nodeos

Once the container loads, you're introduced to the

shell. Go ahead and try some basic commands like
. NodeOS provides implementations for these commands via layers 3 and 4:

/ # ls
[ 'etc', 'lib', 'lib64', 'root', 'bin', 'sys', 'usr', 'share', 'proc' ]

/ # cd etc /etc # pwd /etc

/etc # ifconfig { lo: { address: '' }, eth0: { address: '' } }

Install Packages

NodeOS uses

as its package manager, albeit under the alias of
. Use
to install packages as you would with
. Bear in mind that
connects to a different registry as opposed to

To use curl for example, first install the


/ # npkg install bin-ncurl
npm http GET
npm http 200
npm http GET
npm http 200
/root/bin/ncurl -> /root/lib/node_modules/ncurl/bin/ncurl
ncurl@0.1.0 /root/lib/node_modules/ncurl

Next, use

from the commandline:

/ # ncurl

Exiting the shell is as easy as pressing

Ctrl + D

/ # ^D

Setting up Express on NodeOS

Now let's see just how fast we can roll out a common Node.js application - an embedded RESTful webserver.



/ # npkg install express
npm http GET
npm http 200

Now create a project directory and bootstrap it with express:

/ # mkdir opt / # cd opt /opt # mkdir blog /opt # cd blog /opt/blog # express .

Don't forget to install package dependencies locally using


/opt/blog $ npm install -d

Finally, run the server and viola - simple wasn't it?

/opt/blog $ node app.js

Express server listening on port 3000


NodeOS is far from being a full-fledged operating system. However, despite its infancy, functional NodeOS images can be generated because of


Though still a work in progress, there's a lot more in store for NodeOS. A couple of things missing right now are:

  • management of system users and groups
  • a viable service manager
  • a graphical user interface

As it's an open-source project, you're more than welcome to contribute to its advancement - so get started by forking NodeOS at

There are additional NodeOS repositories as well, for different parts of the OS:

I don't know about you, but I can barely wait to see what the future holds for NodeOS! To stay updated with what's going on with NodeOS, check out the official blog