Skip to content

Instantly share code, notes, and snippets.

@antoneliasson
Created June 7, 2016 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antoneliasson/3b0033747c7dd08e99d58dd8effb9769 to your computer and use it in GitHub Desktop.
Save antoneliasson/3b0033747c7dd08e99d58dd8effb9769 to your computer and use it in GitHub Desktop.
LXC console commands to set up guest TTYs for libvirt
#!/bin/bash
# Start the container with lxc-start and run this in the console to prepare the
# OS for libvirt.
set -e
# Disable getty on TTYs
systemctl mask getty-static
rm /etc/systemd/system/getty.target.wants/*
# Allow root login from pseudo TTY 0 (console)
echo >> /etc/securetty
echo pts/0 >> /etc/securetty
# We are done. Power off and then start the container in libvirt.
poweroff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment