LinuxCommandLibrary

openvt

Start a program in a new virtual terminal

SYNOPSIS

openvt [-c NUM] [-s] [-l] [-w] [-v] [--] [command arg ...]

PARAMETERS

-c NUM
    Switch to VT NUM; 0 opens new VT

-s
    Switch to new VT immediately after starting

-l
    Use login shell instead of $SHELL

-w
    Wait for command to complete before returning

-v
    Enable verbose output

--
    End of options; treat rest as command args

DESCRIPTION

The openvt command launches a program in a new virtual terminal (VT) on Linux systems supporting virtual consoles. It switches to a new or specified VT and executes the provided command, defaulting to the current shell if none is given. Primarily used in console environments for multitasking without X11 or Wayland, it's ideal for system administrators to spawn new sessions from initrd, recovery modes, or multi-user setups.

Virtual terminals are text-based consoles accessible via Ctrl+Alt+F1-F6. openvt automates switching and execution, enhancing workflow on servers or embedded systems. It requires appropriate privileges (often root or console access) and interacts with kernel VT drivers. Common in util-linux toolkit, it's lightweight and non-interactive unless options dictate otherwise.

CAVEATS

Requires root or console permissions; fails on headless systems without VT support. Not for graphical sessions; may interfere with getty processes.

EXAMPLES

openvt -s /bin/bash
Opens new VT and switches to bash.

openvt -c 3 -w top
Switches to VT3, runs top, waits.

HISTORY

Part of util-linux since early 2000s; evolved from console-tools. Maintained for legacy VT management in modern kernels.

SEE ALSO

chvt(8), deallocvt(8), mingetty(8), setfont(8)

Copied to clipboard