Getting Started with NetNIX
Everything you need to know to install, configure, and use your virtual UNIX environment.
01 — Installation
System Requirements
- .NET 8.0 Runtime (or SDK if building from source)
- Any platform supported by .NET 8: Windows, macOS, Linux, Android (via Termux)
- Console/terminal application — no GUI required
- Disk space: ~30 MB for the application + rootfs archive
Option A: Windows Installer
Download the installer from the downloads page and run it. The installer will guide you through the process.
Option B: Build from Source
02 — First-Time Setup
When NetNIX starts for the first time (no rootfs.zip exists), it runs the First-Time Setup wizard automatically:
- Creates the standard UNIX directory hierarchy (/bin, /etc, /home, …)
- Installs default skeleton files for new users
- Prompts you to set a root password
- Creates the root account and the sudo group
- Optionally creates a regular user account
- Installs the sandbox configuration (/etc/sandbox.conf)
- Installs all built-in commands into /bin and /sbin
- Installs built-in libraries into /lib
- Installs manual pages into /usr/share/man
- Installs factory files (default configs, demo scripts)
- Saves everything to the rootfs.zip archive
After setup, you are presented with the login prompt.
03 — Using the Shell (nsh)
After logging in, you are dropped into nsh (NetNIX Shell). The prompt shows your username, hostname, current directory, and privilege level:
user@netnix:/home/user$ (regular user) root@netnix:/root# (root)
Basic Usage
| Syntax | Description |
|---|---|
| command arg1 arg2 | Run a command with arguments |
| command > file | Redirect output to a file |
| command >> file | Append output to a file |
| cmd1 | cmd2 | cmd3 | Pipe output between commands |
| help | Show all available commands |
| man <topic> | Read the manual page for a topic |
| clear | Clear the screen |
| exit / logout | Log out of the current session |
Shell Scripts
Source a file containing one command per line:
source myscript.sh . myscript.sh
Lines starting with # are treated as comments.
The file ~/.nshrc is automatically sourced on login.
04 — Built-in Commands
Shell Builtins
| Command | Description |
|---|---|
| help | Show command overview |
| man | Manual page viewer |
| cd | Change directory (cd, cd ~, cd -) |
| chmod | Change file permissions |
| chown | Change file owner (root only) |
| adduser | Create a new user (root only) |
| su | Switch user |
| sudo | Run a command as root |
| daemon | Manage background services |
| run | Run a .cs script file |
| source / . | Execute a shell script |
User Commands (/bin)
| Command | Description |
|---|---|
| ls | List directory contents |
| cat | Display file contents |
| cp / mv / rm | Copy, move/rename, remove files |
| mkdir / rmdir | Create/remove directories |
| grep | Search file contents with patterns |
| find | Find files by name pattern |
| head / tail | Display first/last lines of a file |
| wc | Word, line, and character count |
| curl / wget / fetch | Network transfer tools |
| edit | Built-in text editor |
| zip / unzip | Archive management within the VFS |
| echo / pwd / whoami | Print text, directory, or username |
System Administration (/sbin — root/sudo)
| Command | Description |
|---|---|
| useradd / userdel / usermod | Manage user accounts |
| groupadd / groupdel / groupmod | Manage groups |
| mount / umount | Mount/unmount .zip archives |
| export / importfile | Bridge to host filesystem |
| npak | Package manager |
| nxconfig | Host-side configuration tool |
| httpd | HTTP server daemon |
| telnetd | Telnet server daemon (remote multi-user access) |
05 — Virtual File System
NetNIX uses a fully in-memory virtual filesystem persisted as a .zip archive. All paths are UNIX-style (forward slashes, rooted at "/").
Default Archive Location
| Platform | Path |
|---|---|
| Windows | %APPDATA%\NetNIX\rootfs.zip |
| Linux | ~/.config/NetNIX/rootfs.zip |
| macOS | ~/Library/Application Support/NetNIX/rootfs.zip |
Directory Layout (FHS)
| Path | Purpose |
|---|---|
| /bin | User command scripts |
| /sbin | System/admin command scripts |
| /lib | Shared libraries |
| /etc | Configuration files |
| /home | User home directories |
| /root | Root's home directory |
| /tmp | Temporary files (world-writable) |
| /usr | Secondary hierarchy (bin, lib, share) |
| /var | Variable data (logs, packages, www) |
| /mnt | Mount points for external archives |
Permissions
Every file and directory has a 9-character permission string representing owner, group, and other access. Root (uid 0) bypasses all permission checks.
chmod rwxr-xr-x myfile # symbolic notation chmod 755 myfile # octal notation chown username myfile # change owner (root only)
06 — Writing C# Scripts
Scripts are plain-text .cs files stored in the virtual filesystem. They are compiled at runtime by Roslyn and executed inside the NetNIX sandbox.
Basic Structure
The NixApi Object
The api parameter provides safe access to the entire environment:
| Category | Methods |
|---|---|
| File I/O | ReadText, WriteText, ReadBytes, WriteBytes, AppendText, Exists, Delete, Copy, Move |
| Directories | IsDirectory, ListDirectory, CreateDir, CreateDirWithParents |
| Paths | ResolvePath, GetName, GetParent, Cwd |
| Users | Uid, Gid, Username, GetUsername, GetGroupName |
| Permissions | CanRead, CanWrite, CanExecute, GetPermissions |
| Networking | Net.Get, Net.Post, Net.Put, Net.Delete, Net.Patch, Net.Head |
| Host Logging | HostLog, HostLogRaw |
| Persistence | Save |
The #include System
#include <libraryname> // Search /lib, /usr/lib, /usr/local/lib #include "path/to/file.cs" // Resolve relative to cwd or absolute
Built-in Libraries
| Library | Description |
|---|---|
| demoapilib | Demo/example library showing API usage patterns |
| netlib | Networking helper library |
| settingslib | Persistent key/value settings storage for scripts |
| ziplib | Zip archive manipulation within the VFS |
NetNIX includes 80+ built-in manual pages. Once inside the environment, use
man <topic> to read detailed documentation on any command or concept,
man --list to see all available pages, or man -k <keyword> to search.