Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nosada/mkosi-files
Configs and files for creating basic Arch Linux container image on systemd-nspawn using mkosi
https://github.com/nosada/mkosi-files
archlinux mkosi nspawn
Last synced: 5 days ago
JSON representation
Configs and files for creating basic Arch Linux container image on systemd-nspawn using mkosi
- Host: GitHub
- URL: https://github.com/nosada/mkosi-files
- Owner: nosada
- License: wtfpl
- Created: 2017-07-09T04:46:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-30T06:11:53.000Z (4 months ago)
- Last Synced: 2024-08-02T18:42:31.031Z (3 months ago)
- Topics: archlinux, mkosi, nspawn
- Language: Shell
- Homepage:
- Size: 181 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# What's this
[Mkosi](https://github.com/systemd/mkosi) configs and files for Arch Linux [systemd-nspawn](https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html) images.
Expected to be used in Arch Linux box.
# How to use
1. Install `base-devel`, `git`
2. Install `mkosi` (or `mkosi-git` in AUR)
3. Clone this repositoryAfter cloning it, you can do the followings:
## Simple way
Run `update-nspawn-images` as root:
```bash
update-nspawn-images CONTAINER [OTHER_CONTAINER ...]
```where `CONTAINER` or `OTHER_CONTAINER` are nspawn container name in this repository.
`update-nspawn-images` will do below:
1. Build specified nspawn image
2. Remove existing image (nspawn container will be terminated)
3. Install new image and config## Complicated way
### Create container image
```bash
cd CONTAINER/
sudo make
```### Import built image
- Import container image via `machinectl`
- Install nspawn config to `/etc/systemd/nspawn/` as `CONTAINER.nspawn````bash
cd CONTAINER/
sudo make install
```### Remove container image
- Remove container image via `machinectl`
- Delete nspawn config installed as `/etc/systemd/nspawn/CONTAINER.nspawn````bash
cd CONTAINER/
sudo make uninstall
```### Clean built files
Delete container image and `mkosi.default` in `CONTAINER/`
```bash
cd CONTAINER/
sudo make clean
```# Containers on this repository
- `corespawn/`: Basic Arch LInux container
- `mstdnspawn/`: Configuable Mastodon instance
- `guispawn/`: Packaging GUI apps. Currently only web browsers (Tor browser & Chromium)
- `tlspawn/`: Packaging Tex Live utilities
- `torspawn/`: Running Tor proxy (Tor + Privoxy; tcp:8118 opened)
- `sngskspawn/`: Web app run as [sngsk.info](https://sngsk.info)## Notes
### Communicating outside container with `VirtualEthernet=yes`
See [this comment](https://github.com/nosada/mkosi-files/issues/6#issuecomment-706651468).
### Using `guispawn`
Some environment variables are required to run X apps. Use below snippet:
```bash
machinectl shell \
--setenv=display=:0 \
--setenv=xauthority="\${HOME}/.xauthority" \
--setenv=pulse_server=unix:/run/user/host/pulse/native \
gui@guispawn /usr/bin/COMMAND ARGUMENTS
```Or you can use script `launch-app-in-container` like below:
```bash
launch-app-in-container COMMAND ARGUMENTS
```This will do same thing of above snippet.