openvt
Start a program in a new virtual terminal
SYNOPSIS
openvt [options] [command [arguments...]]
openvt {-h|--help|-V|--version}
PARAMETERS
-c <console>
Specifies the virtual terminal (VT) number to use. By default, openvt finds the first available unused VT.
-f
Do not fork. The parent process will wait for the command to complete. If this option is used, -s is ignored.
-l
Makes the executed command a login shell by prepending a '-' to its name.
-s
Switches to the newly opened VT when the command starts. The caller's VT is restored after the command terminates. Ignored if -f is set.
-u
Finds a VT owned by the current user. This option can only be used by a regular user (not root) and prioritizes VTs owned by the calling user.
-v
Enables verbose output, providing more information about openvt's operations.
--
Marks the end of options. All subsequent arguments are interpreted as the command and its arguments.
command [arguments...]
The command to execute on the new virtual terminal. If omitted, /bin/login is run by default.
-h, --help
Displays help information and exits.
-V, --version
Displays version information and exits.
DESCRIPTION
openvt is a utility that finds an unused virtual console (VT) and executes a specified command on it. If no command is provided, it defaults to running /bin/login. This command is particularly useful for tasks requiring a separate, isolated terminal session, such as launching graphical environments, system recovery, or running daemons in the background without affecting the current console.
When openvt launches the command, it detaches itself from the controlling terminal and forks the process into a new session, directing all standard input/output to the new VT. Users can choose to immediately switch to the new VT using the -s option, or prevent forking with the -f option. It also allows non-root users to find VTs they own, promoting secure multi-user environments on consoles. openvt is a key component of the util-linux package, providing essential console management capabilities on Linux systems.
CAVEATS
Requires appropriate permissions, typically root, to open and manage virtual terminals unless the -u option is used for a user-owned VT. The command depends on the Linux kernel's virtual terminal subsystem. If the current terminal is not in console mode (e.g., an X terminal), openvt will exit with an error. The new VT is not activated by default; use -s to switch to it immediately.
DEFAULT COMMAND
If no command is specified, openvt defaults to executing /bin/login on the new virtual terminal.
VT SELECTION
By default, openvt finds the first available unused virtual terminal. The -c option allows specifying a particular unused VT, while -u can be used by non-root users to find VTs they own.
HISTORY
The openvt command is part of the util-linux project, a collection of essential utilities for the Linux operating system. Its functionality for managing virtual terminals has been a core component of Linux console management from its early days, providing a robust way to isolate and run processes on dedicated console sessions.