Skip to content

Instantly share code, notes, and snippets.

@dm0-
Created July 18, 2016 21:10
Show Gist options
  • Save dm0-/e7ac2f3b2d0c84439625ac8834cf374d to your computer and use it in GitHub Desktop.
Save dm0-/e7ac2f3b2d0c84439625ac8834cf374d to your computer and use it in GitHub Desktop.
Sample alternate Fedora container service (incomplete, X input fails)
[Unit]
Description=Start the local Fedora installation in a container
After=getty@tty2.service getty@tty3.service \
boot.mount mnt-fedora.mount opt.mount
Conflicts=getty@tty2.service getty@tty3.service
Requires=mnt-fedora.mount
Wants=boot.mount opt.mount
[Service]
Delegate=yes
DevicePolicy=auto
KillMode=mixed
Slice=machine.slice
Type=notify
ExecStart=/usr/bin/systemd-nspawn \
--capability=all \
--directory=/mnt/fedora \
--keep-unit \
--link-journal=try-guest \
--machine=fedora \
--network-veth \
--register=yes \
--settings=override \
--bind=/opt \
--bind-ro=/boot:/boot/efi \
--bind-ro=/etc/resolv.conf:/run/NetworkManager/resolv.conf \
--bind-ro=/dev/null:/etc/fstab \
--bind-ro=/lib/firmware \
--bind-ro=/lib/modules \
--bind=/etc/systemd/system/fedora-container.target:/usr/lib/systemd/system/getty.target \
--bind=/etc/systemd/system/fedora-container.target.wants:/etc/systemd/system/getty.target.wants \
--bind=/etc/systemd/system/fedora-container.target.wants/xdm.service:/usr/lib/systemd/system/xdm.service \
--boot 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment