# Disable getty in a NixOS Container

**URL:** https://discourse.nixos.org/t/disable-getty-in-a-nixos-container/40940
**Category:** Help
**Created:** [March 7, 2024, 8:01am UTC](https://discourse.nixos.org/t/disable-getty-in-a-nixos-container/40940 "2024-03-07T08:01:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nomeata](https://discourse.nixos.org/user_avatar/discourse.nixos.org/nomeata/32/3624_2.png) [@nomeata](https://discourse.nixos.org/u/nomeata)
#### Post date: [March 7, 2024, 8:01am UTC](https://discourse.nixos.org/t/disable-getty-in-a-nixos-container/40940/1 "2024-03-07T08:01:52Z")

</div>

I am setting up a local NixOS container to separate some processes from my main machine. I am entering the container using `machinectl shell`, so I do not need a login prompt at the “console”, yet there is a `agetty` process running:

```auto
~ $ machinectl shell jojo@dev /usr/bin/env ps -A
Connected to machine dev. Press ^] three times within 1s to exit session.
    PID TTY TIME CMD
      1 ? 00:00:00 systemd
    135 ? 00:00:00 systemd-journal
    217 ? 00:00:00 systemd-oomd
    221 ? 00:00:00 nsncd
    234 ? 00:00:00 systemd-logind
    282 ? 00:00:00 dbus-daemon
    293 pts/0 00:00:00 agetty
   5788 pts/1 00:00:00 ps
   5791 ? 00:00:00 systemd
   5792 ? 00:00:00 (sd-pam)
   5799 pts/1 00:00:00 (sd-pam)
Connection to machine dev terminated.

```

In the interest of running as few processes there as possible, is there a (easy, supported) way to disable the `agetty` there?

---

<div class="post-metadata">

### Author: ![sigmasquadron](https://discourse.nixos.org/user_avatar/discourse.nixos.org/sigmasquadron/32/17592_2.png) [@sigmasquadron](https://discourse.nixos.org/u/sigmasquadron)
#### Post date: [August 17, 2026, 5:15pm UTC](https://discourse.nixos.org/t/disable-getty-in-a-nixos-container/40940/2 "2026-08-17T17:15:33Z")

</div>

Set `services.getty.enable` to `false` inside the container.
