Created
June 7, 2016 17:23
-
-
Save antoneliasson/3b0033747c7dd08e99d58dd8effb9769 to your computer and use it in GitHub Desktop.
LXC console commands to set up guest TTYs for libvirt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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