{"id":13798805,"url":"https://github.com/parke/lxroot","last_synced_at":"2025-05-13T06:31:36.432Z","repository":{"id":45214950,"uuid":"237704413","full_name":"parke/lxroot","owner":"parke","description":"A lightweight, flexible, and safer alternative to chroot and/or Docker.","archived":false,"fork":false,"pushed_at":"2025-04-25T22:46:32.000Z","size":197,"stargazers_count":104,"open_issues_count":2,"forks_count":10,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-06T09:58:39.682Z","etag":null,"topics":["chroot","chroot-environment","cli","lightweight","linux","namespace","userland","virtualization"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parke.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-02-02T01:52:32.000Z","updated_at":"2025-05-04T21:45:46.000Z","dependencies_parsed_at":"2024-01-28T13:11:44.660Z","dependency_job_id":"d22d6a83-a200-400c-99c9-1412349d860c","html_url":"https://github.com/parke/lxroot","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parke%2Flxroot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parke%2Flxroot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parke%2Flxroot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parke%2Flxroot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parke","download_url":"https://codeload.github.com/parke/lxroot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253888872,"owners_count":21979521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chroot","chroot-environment","cli","lightweight","linux","namespace","userland","virtualization"],"created_at":"2024-08-04T00:00:54.079Z","updated_at":"2025-05-13T06:31:36.420Z","avatar_url":"https://github.com/parke.png","language":"C++","readme":"# Lxroot - a software virtualization tool\n\n\n### About Lxroot\n\n`lxroot` is a lightweight and safe alternative to `chroot`, Docker, and other software virtualization tools.\n\n`lxroot` allows a non-root user to easily and safely create a \"chroot-style\" virtual software environment (via Linux namespaces), and then run one or more programs inside that environment.\n\n### Requirements \n\n1. Lxroot requires Linux kernel version 3.9 or later.  (And preferably version 5.11 or later, see `man user_namespaces` for details.)\n2. The kernel must have been compiled with unpriveleged namespace support.  (See [related discussion](https://github.com/parke/lxroot/issues/26#issuecomment-2827862361).)\n3. Unpriveleged namespace support must also be [enabled at runtime](https://www.baeldung.com/linux/kernel-enable-user-namespaces).\n\nAs of 2025 (and possibly even since 2020), most common Linux distributions by default both (a) support unpriveleged namespaces and (b) enable them by default.\n\n###  Project Status\n\nAs of September 2023, Lxroot is still under intermittent development.\nI seem to work on Lxroot several times per year.  Typically, when I\nwork on Lxroot, I spend several days either adding new features or\nrefactoring existing features to make Lxroot easier to use.\n\nI personally run software inside Lxroot every hour of every day, all year long.\nAs time passes, I am increasing the quantity and variety of programs that I run inside of Lxroot.\n\nTo the best of my knowledge, I am the only person who uses Lxroot\nregularly.  Therefore, I have been investing my energy in improving\nLxroot, rather than documenting the improvements and publishing\nupdates.  **Therefore, if you are interested in using Lxroot, please let\nme know so that I can provide you with the updated and improved source\ncode.**\n\n###  Lxroot Worlds\n\nAs of September 2023, I now call an Lxroot-based chroot-style-environment a \"world\".\n\nTo manually create Apline Linux world named `alpine`, I could\n(for example), do the following:\n\n```\n$  mkdir  -p  alpine/newroot    #  this directory is required.\n$  tar  xzf  alpine-minirootfs.tar.gz  -C alpine/newroot\n$  mkdir  alpine/home           #  this directory is optional.\n$  mkdir  alpine/tmp            #  this directory is optional.\n$  lxroot  alpine               #  use Lxroot to enter the world.\n```\n\nWhen Lxroot runs, the following directories will be bind-mounted into\n`alpine/newroot`:\n\n```\nsource           target\nalpine/home  -\u003e  alpine/newroot/home\nalpine/tmp   -\u003e  alpine/newroot/tmp\n```\n\nThen Lxroot will chroot into `alpine/newroot`.\n\nAny of `newroot`, `home`, and `tmp` can be symbolic links.  This\nallows directories to be shared across multiple worlds.  (Lxroot can\nbind-mount any subdirectory into `newroot`, not just the two examples shown above.)\n\nOn a Linux kernel version 5.11 and later,\nLxroot can also create and chroot into a kernel-level overlay\nfilesystem.  An Lxroot-world can simultaneously use both an overlay filesystem\nand one or more bind-mounted subdirectories.\n\nI have written custom scripts that create Lxroot-worlds based on\nvarious Linux distributions.  The below table summaries the types of\nLxroot-worlds that I regularly create and/or use.  The distros are\nordered from most commonly used (by me) to least commonly used.\n\n|  Base distro           |  Create world with     |  Install binary packages with  |  Can build packages?  |\n|  :--                   |  :-:                   |  :-:                           |  :-:                  |\n|  Debian, Ubuntu, Mint  |  [`mk-deb.sh`](https://github.com/parke/lxroot/blob/master/aux/mk-deb.sh)  |  `fakeroot` and `apt`          |  Probably?            |\n|  Alpine                |  `mk-alpine.sh`  (1)   |  `apk`                         |  Probably?            |\n|  Flatpak               |  `mk-alpine.sh`  (1)   |  `flatpak`                     |  Probably?            |\n|  Arch                  |  `mk-arch.sh`  (1)     |  `pacman`                      |  Probably?            |\n|  Arch AUR              |  `mk-arch.sh`  (1)     |  (n/a)                         |  Probably?            |\n|  Void                  |  Create by hand?  (2)  |  `xbps-install`?  (2)          |  Probably?            |\n\nNotes:  (1) I have not yet published `mk-alpine.sh` and `mk-arch.sh`.  (2) It has been a long time since I used Void Linux inside Lxroot, but there is a good chance that XBPS will \"just work\" inside Lxroot.\n\n(Aside: Previously, I used a separate tool called `vland` to create and\nwork with Lxroot environments.  However, `vland` is now obsolete and\nunsupported.  `vland`'s functionality was either (a) moved into Lxroot\nitself, or (b) moved into smaller, stand-alone scripts.)\n\n### Videos\n\n-  Lxroot presentation at PackagingCon 2021:  [**abstract**](https://pretalx.com/packagingcon-2021/talk/PMPUSW/)  |  [**slides**](https://pretalx.com/media/packagingcon-2021/submissions/PMPUSW/resources/20211110_Lxroot_7ILURuB.pdf)  |  [**video**](https://www.youtube.com/watch?v=1rw7ww0k_mk)\n\n\u003c!--  version  20230926.0  --\u003e\n","funding_links":[],"categories":["Sandboxes"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparke%2Flxroot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparke%2Flxroot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparke%2Flxroot/lists"}