Repository navigation
The files machine
A USB stick's filesystem is whatever its last owner put on it, and the kernel's filesystem code is some of its most attacked. On a PC, drives and SD cards are mounted in sys-files, a machine of their own, and only their files cross to the host. sys-files has no network card at all, so nothing on a drive can reach anything but the host.
Like the network machine, sys-files is BusyBox, one
program (losos-filesd) and the host's own kernel, hidden from the
Machines app.
- A USB drive is moved there by the peripherals router, over USB/IP. The router starts sys-files if it is not running.
- An SD card reader on the PCI bus is handed to sys-files at boot, and sys-files starts at boot to hold it.
losos-filesd mounts each filesystem it recognises: FAT, exFAT, NTFS,
ext2 to ext4, Btrfs, XFS, F2FS, and CD and DVD formats. Nothing on a drive
can run, and nothing on it can be a device. It leaves other things alone,
such as swap or an encrypted volume.
On the host, losos-files-host mounts each volume for the person whose
session is in front, under /run/media/<user>/<name>. It uses sshfs, with
OpenSSH's sftp-server in the machine at the other end of a
losos-vm-call connection. The name is the volume's label. The files show
as the person's own, and the kernel checks access as it would for their
own files.
losos-files eject <name> unmounts a volume and tells the kernel the drive
is going, so it can be pulled out. losos-files list lists what is
mounted.
sys-files powers itself off five minutes after the last drive goes, and gives its memory back to the host while it runs. The next drive starts it again.
SMB, NFS and WebDAV shares are mounted in a second machine, sys-shares, which is sys-files with a network card. That card is on the host's link to the network machine, which routes it as it routes the host: through the ad blocker's DNS, and through Tor in schizo mode. sys-shares keeps the shares and their passwords on a small disk of its own, which only it reads. The host only remembers that shares were added, so it can start sys-shares at boot.
printf '%s\n%s\n' "$user" "$password" | losos-shares add Photos smb://nas/photos
losos-shares list
losos-shares remove PhotosThe shares appear under /run/media/<user>/<name> like drives.
Backups to a LosOS box do not use sys-shares. They talk HTTPS to the box through the LosOS boxes machine and check the box's certificate on every connection.
| Piece | Where |
|---|---|
| The files machine and its host half |
nixos/modules/files-machine.nix, losos-files-host.sh
|
| The network shares machine | nixos/modules/shares-machine.nix |
| The machines' program | src/losos-filesd |
Generated from docs/ in the repository at every change; edit the pages there, since an edit made here is overwritten.
- LosOS Desktop
- Building
- When something goes wrong
- Reporting a problem
-
The system
- Everything systemd, and the exceptions
- Virtual machine desktop
- Peripherals in machines of their own
- The network machine
- The files machine
- The portal machine
- Where the OS lives
- Hibernation
- Hardware and NVIDIA
- Boot loader and boot screen
- Secure Boot
- The installer
- The Windows installer
- Trying it in quickemu
- First-boot setup
- Signing in
- Security keys and smart cards
- More than one person
- Company accounts
- Releases and GHCR
- The memory allocator
- The security report
- Kernel hardening
- Schizo mode
- VPN
-
Desktop and apps
- GTK and Qt on a phone
- One icon theme
- Danube
- System-wide ad blocking
- The terminal
- Ask derisk
- The Store
- The Agent
- Active users and the choice screens
- LosOS boxes
- Windows app support
- The gaming machine
- Focus mode
- Android app support
- macOS app support
- arm64 macOS machines
- App windows
- Backups to a LosOS box
- Screenshots
- Building blocks
- Phones
- History and gaps