Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
0
answers
571
views
Why can't I switch virtual terminal now?
I have noticed I can't lock the screen because of `vlock` hangs. `chvt` also hangs on `VT_WAITACTIVE` and only attempts to switch the terminal (I see the image blinking). Pressing keys that in usually switches VT in text mode (Alt+arrows, Alt+Fx) also makes Xorg picture blink and hide cursor for a s...
I have noticed I can't lock the screen because of
vlock
hangs.
chvt
also hangs on VT_WAITACTIVE
and only attempts to switch the terminal (I see the image blinking).
Pressing keys that in usually switches VT in text mode (Alt+arrows, Alt+Fx) also makes Xorg picture blink and hide cursor for a second.
The keyboard input also flows to text console in addition to Xorg. I noticed a stray session at tty2. I can log in to tty2 without leaving Xorg:
# ps aux | grep qwjerewqr
vi 27051 0.0 0.0 3644 1144 tty2 S+ 20:38 0:00 grep qwjerewqr
root 27053 0.0 0.0 3644 1236 pts/27 SN+ 20:38 0:00 grep qwjerewqr
So,
1. What may have caused this?
2. How do I bring the system back to normal without rebooting (or restarting X applications)?
3. Shall I report a bug report somewhere?
Update: Finally just rebooted it (because of other unrelated problem).
Vi.
(5985 rep)
Oct 6, 2015, 03:32 AM
• Last activity: May 15, 2024, 12:32 AM
0
votes
0
answers
389
views
How to tell if I am on active virtual console?
This is probably linux-specific question... I am running multiple virtual sessions and switching between them using "Ctrl+Alt+Fn". I am trying to write a script which would trigger some actions after I switch in/out of consoles. I understand that I can read `/sys/class/tty/tty0/active` device to see...
This is probably linux-specific question...
I am running multiple virtual sessions and switching between them using "Ctrl+Alt+Fn". I am trying to write a script which would trigger some actions after I switch in/out of consoles.
I understand that I can read
/sys/class/tty/tty0/active
device to see which is currently active virtual console:
$ cat /sys/class/tty/tty0/active
tty2
Now, how do I identify which virtual tty am I actually running in? tty
command does not return that information:
$ tty
/dev/pts/0
$DISPLAY
also shows :0
, not tty2
. How can I determine that I am indeed running in tty2
?
galets
(1297 rep)
Apr 23, 2021, 11:04 PM
2
votes
1
answers
7695
views
What is this openvt command doing?
What is this command really doing (step by step)? openvt -c 40 /bin/agetty tty40 linux I tried this command instead : openvt -c 41 /bin/agetty tty40 linux and agetty was started on tty40 (not tty41). Why is that? It seems the `-c 41` option is not necessary. Removing it yields the same result.
What is this command really doing (step by step)?
openvt -c 40 /bin/agetty tty40 linux
I tried this command instead :
openvt -c 41 /bin/agetty tty40 linux
and agetty was started on tty40 (not tty41). Why is that? It seems the
-c 41
option is not necessary. Removing it yields the same result.
Gradient
(3749 rep)
Apr 8, 2017, 03:27 PM
• Last activity: Jan 11, 2021, 10:39 PM
6
votes
3
answers
24480
views
How to manually run/init/start a Xorg server on a different VT/TTY?
I want to start an Xorg server (which should only feature a minimal `xterm` terminal emulator from a newly created "pristine" `tty`). I have thought this to be as simple as issuing a `xinit` or maybe a `startx` however both have failed me. Therefore the question: **How to manually run/init/start a X...
I want to start an Xorg server (which should only feature a minimal
xterm
terminal emulator from a newly created "pristine" tty
). I have thought this to be as simple as issuing a xinit
or maybe a startx
however both have failed me. Therefore the question:
**How to manually run/init/start a Xorg server on a different VT/TTY?**
here the
## Longer background story to the question at hand: ##
This is the backgroud and what I have tried already:
Looking at man openvt
I was able to run a shell on a newly created tty
(or vt
, cannot tell precisly the different *vt**tty*) like this:
$> sudo openvt -s /bin/bash
the -s
of causes the direct switch to that new tty/vt
on that new tty I wanted to manually start a Xorg
server which according to man xinit
should start with a minimal xterm
application. On the new shell on the switched to tty I (created via openvt
) I hence issues this command:
$> su -c 'xinit xterm -display :4 -- :4' - mahr &>/tmp/output
and I receive this output
$> cat /tmp/output
X.Org X Server 1.19.6
Release Date: 2017-12-20
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-148-generic x86_64 Ubuntu
Current Operating System: Linux scitech 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-4.15.0-70-generic root=/dev/mapper/ubuntu--vg-root ro
Build Date: 03 June 2019 08:10:35AM
xorg-server 2:1.19.6-1ubuntu4.3 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.34.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/mahr/.local/share/xorg/Xorg.4.log", Time: Thu Nov 28 10:57:53 2019
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at "/home/mahr/.local/share/xorg/Xorg.4.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
Session terminated, terminating shell...xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: unexpected signal 2
...terminated.
fraleone
(897 rep)
Nov 28, 2019, 10:04 AM
• Last activity: Dec 9, 2019, 03:00 PM
0
votes
1
answers
264
views
How to reset VT 1 (or avoid getting into a bad state)?
This is a cross-post from RPi. I wrote a series of bash functions to allow me to switch between Raspbian, kodi, and emulationstation so that I could use Siri/homebridge to initiate the switch. Switching works all pretty well. The only problem is that stopping any of the OSs without starting another...
This is a cross-post from RPi. I wrote a series of bash functions to allow me to switch between Raspbian, kodi, and emulationstation so that I could use Siri/homebridge to initiate the switch. Switching works all pretty well. The only problem is that stopping any of the OSs without starting another one leaves the console’s connection to VT1 in some sort of weird state. All I see is a black screen.
I can manually fix this using either alt+F1 or by executing
sudo chvt 2;sudo chvt 1
to reinitialize VT1, but I would prefer to avoid this bad state entirely. I assume that this is happening as a side-effect using pkill to stop the OSs. E.g. pkill emulationstatio;pkill xinit;pkill kodi;
.
I could add sudo chvt 2;sudo chvt 1
to my stop functions, but I’d rather not since I don’t know in that function whether another OS is starting or going to start.
So how can I cleanly stop kodi/emulationstation/raspbian so that VT 1 is left in a good state so that I can see the console after the OS has stopped?
BTW, this is on a raspberry pi. I have been testing via ssh and watching the results on the hdmi-connected TV from the couch.
hepcat72
(195 rep)
May 6, 2019, 09:48 AM
• Last activity: May 18, 2019, 10:08 PM
1
votes
1
answers
1298
views
Prevent Xorg from suspending when changing tty
I'm running two applications on two different ttys. Say application A runs on ttyA and application B runs on ttyB. If I switch from ttyA to ttyB I get the following message `x-daemon[544]: (II) AIGLX: Suspending AIGLX clients for VT switch`. So application A on ttyA, which obviously is a Xorg applic...
I'm running two applications on two different ttys. Say application A runs on ttyA and application B runs on ttyB. If I switch from ttyA to ttyB I get the following message
x-daemon: (II) AIGLX: Suspending AIGLX clients for VT switch
.
So application A on ttyA, which obviously is a Xorg application, isn't updated anymore. This eventually causes my system to freeze due to a sort of memory leak as buffers in application A are not swapped anymore.
Question: Is it possible to keep refreshing X when the X server is not in the active tty?
I tried starting Xorg with -novtswitch
but that didn't work.
plazmakeks
(191 rep)
May 16, 2019, 01:27 PM
• Last activity: May 16, 2019, 07:54 PM
1
votes
1
answers
442
views
invoking password-less sudo via xbindkeys
I tried to set up key bindings for changing the virtual terminal (VT) in `X`, as described in [this post][1]. Typing `sudo chvt $(($XDG_VTNR-1))` into a terminal emulator appropriately changes the VT. However, I find that running `chvt` with elevated privileges works only when executed as a command...
I tried to set up key bindings for changing the virtual terminal (VT) in
X
, as described in this post . Typing sudo chvt $(($XDG_VTNR-1))
into a terminal emulator appropriately changes the VT. However, I find that running chvt
with elevated privileges works only when executed as a command to a terminal emulator (e.g., xterm -e
), a requirement that I am trying to circumvent.
To describe my setup:
The following line was added to /etc/sudoers
:
me ALL=NOPASSWD:/bin/chvt
where me
is the output of whoami
. I also tried variations on this line (e.g., me ALL=(ALL) NOPASSWD:/bin/chvt
and me ALL=(ALL:ALL) NOPASSWD:/bin/chvt
)
To ~/.xbindkeysrc
, I added key bindings, either:
"sudo chvt $(($XDG_VTNR-1))"
alt + c:113
"sudo chvt $(($XDG_VTNR+1))"
alt + c:114
or
"sudo chvt $(($XDG_VTNR-1))"
m:0x8 + c:113
"sudo chvt $(($XDG_VTNR+1))"
m:0x8 + c:114
The first was suggested by the author of the linked post and the latter was determined by running xbindkeys -k
on my system.
The key bindings failed and I ran xbindkeys
in non-daemon mode to investigate. Pressing Alt+left or Alt+right while running xbindkeys -n
gives the following error:
sudo: no tty present and no askpass program specified
Changing the command in ~/.xbindkeysrc
to xterm -e sudo chvt ...
produces a working key binding (but at the cost of opening an xterm
instance and prompting for a password), which confirms that the lack of a tty
is the issue. How can the invocation of sudo
in .xbindkeys
be achieved without first summoning a terminal
?
System details: debian v9.2., dwm v6.1, openbox v.3.6.1, xbindkeys v1.8.6, sudo v1.8.19p1
user001
(3808 rep)
Oct 30, 2017, 07:33 PM
• Last activity: Oct 30, 2017, 09:02 PM
1
votes
1
answers
886
views
How to copy text of virtual terminal from graphics mode?
Linux have virtual terminals, one can switch between them with `chvt 1`, `chvt 7` commands. Former is in the text mode, later is in the graphics mode. I want to copy all the text from first terminal, with some utility from graphics mode. `fbgrab -c 1 ~/image.png` saves an image, but in my case it is...
Linux have virtual terminals, one can switch between them with
chvt 1
, chvt 7
commands. Former is in the text mode, later is in the graphics mode.
I want to copy all the text from first terminal, with some utility from graphics mode.
fbgrab -c 1 ~/image.png
saves an image, but in my case it is a transparent rectangle.
There is no ebuild for fbdump, so I can't check it. And actually I want some paste (as with wgetpaste -s gists
), not a picture.
OS is Sabayon Linux with MATE DE on AMD GPU
I need this because my chrome browser starts to execute some js, and hangs the system (mouse cursor freezes), then there is a message in virtual terminal about crash in chrome plugin. I want to paste that message, but don't know how to do this.
Vsyache Puz
(53 rep)
Jan 29, 2016, 04:46 PM
• Last activity: Jan 29, 2016, 04:59 PM
Showing page 1 of 8 total questions